Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Random effects fails when apply weights

    Hi all,

    I'm trying to define a Random within-between effect model (following Bell et al., 2019) on a 2 years-panel, where the time-variant predictors are demeaned within the Id over time, and the mean values are added as additional control to account for the between-variation. Therefore, the idea is to exploit both between and within variations in the workers over time.

    However, starting with a simple random effect model, I'm having troubles when apply the pweights. Specifically, it takes too long to compute the standard errors and I have to stop the computation. Here the data and the model I'm actually fitting:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(log_wage coeff_panel outsourced outfirm1 outworker1 ptime contract_type education)
    7.600903 281.13644 0 0 0 0 4 3
    7.863267         . 0 0 0 0 1 5
    8.006368         . 0 0 1 0 4 2
     7.17012  55.51101 1 1 1 0 4 2
    7.377759 152.79167 0 0 1 0 4 5
    7.090077 107.83526 0 0 0 0 4 6
    7.423568 107.83526 0 0 0 0 4 6
    7.377759         . 0 1 0 0 4 2
    6.912743         . 0 0 0 1 4 2
    7.582229  92.93236 0 0 1 0 4 2
    end
    label values contract_type contract_type
    label def contract_type 1 "Permanent", modify
    label def contract_type 4 "Other temporary", modify
    label values education education
    label def education 2 "CEP Brevet des collèges, BEPC, CAP, BEP", modify
    label def education 3 "Bac tech ou profes. ou dipl.de ce niveau", modify
    label def education 5 "Bac+2", modify
    label def education 6 "Bac+3 ou Bac+4", modify
    And I'm trying to run:
    Code:
     mixed log_wage i.gender outsourced outfirm1 outworker1 ptime i.contract_type i.education [pw=coeff_panel] || id:
    It converges, but keeps to compute standard errors forever, while it normally works if I re-run the same without weights. The same problem applies when I use the Random within-between effects.


    What could be the reason for such failure? The weights are standard coefficients for representative population, where I use the first-entry year of individual weight.

  • #2
    Luca:
    your -dataex- excerpt is not conistent with your code; therefore, it is impossible to replicate the issue you're complaining about.
    That said, I would check whether missing values play any role in that.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Yes Carlo, you're right. I miss gender in the dataex and use the first 10 rows for an idea of data. I update the dataex here:

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input float(log_wage coeff_panel outsourced outfirm1 outworker1 ptime contract_type education) byte gender
      7.600903 281.13644 0 0 0 0 4 3 1
      7.863267         . 0 0 0 0 1 5 0
      8.006368         . 0 0 1 0 4 2 1
       7.17012  55.51101 1 1 1 0 4 2 1
      7.377759 152.79167 0 0 1 0 4 5 0
      7.090077 107.83526 0 0 0 0 4 6 0
      7.423568 107.83526 0 0 0 0 4 6 0
      7.377759         . 0 1 0 0 4 2 1
      6.912743         . 0 0 0 1 4 2 0
      7.582229  92.93236 0 0 1 0 4 2 1
       7.36074 101.95383 0 0 0 1 1 2 0
      7.673223   60.2477 0 0 1 0 1 1 1
      7.354362   125.073 0 0 1 0 1 2 1
       8.34284  99.66017 0 0 0 0 1 6 1
      8.062748  82.25291 0 0 0 0 1 6 0
      8.070906  82.25291 0 0 0 0 1 6 0
      6.907755         . 0 0 0 1 4 2 0
      7.696213 117.65243 0 0 0 0 4 5 1
      7.377759 129.11101 0 0 0 0 1 5 0
      7.495542 129.11101 0 0 0 0 1 5 0
      7.495542         . 0 0 0 0 1 2 1
      5.991465   75.8704 0 0 1 0 5 1 0
      7.645876  87.60444 0 0 0 0 4 6 1
      7.783224  87.60444 0 0 0 0 4 6 1
      7.678789  97.53782 0 1 0 0 1 3 1
      7.218177         . 0 0 0 0 4 2 1
      7.313221         . 0 0 0 0 1 2 1
      7.467371  90.57919 0 0 1 0 1 2 0
      7.783224  149.7837 0 0 1 0 4 2 0
       7.17012         . 0 0 1 0 4 1 1
      7.313221         . 0 0 0 0 4 2 0
      7.600903 163.74648 0 0 0 0 4 2 0
      7.438384 71.240326 0 0 1 0 4 1 1
      7.495542 71.240326 0 0 1 0 4 1 1
      7.313221 103.50581 0 0 0 0 4 2 0
      7.438384 103.50581 0 0 0 0 4 2 0
      8.006368         . 0 0 0 0 4 6 0
      7.783224         . 0 0 0 0 4 6 1
      7.600903         . 0 0 0 0 1 6 0
      7.244227         . 0 0 1 0 4 4 0
      8.160519         . 0 0 1 0 4 2 1
      7.740664 103.70039 1 1 1 0 1 5 1
      7.696213 103.70039 0 0 1 0 4 5 1
      8.070906         . 0 0 1 0 1 4 0
      7.901007         . 0 0 1 0 1 6 1
      7.230563 123.17227 0 0 0 0 1 2 0
      8.294049         . 0 0 1 0 4 5 0
      7.327123  116.6377 0 0 0 0 4 2 0
      7.313221  95.39109 0 0 0 0 4 2 0
      7.090077         . 0 0 0 0 1 3 0
      6.214608  89.44495 0 0 1 1 4 2 0
      7.003066  57.20824 1 1 1 0 4 1 1
      7.123673  57.20824 1 1 1 0 1 1 1
      7.495542  110.8087 0 0 1 0 4 1 0
      7.696213  110.8087 0 0 0 0 1 1 0
      6.109248         . 0 0 1 1 4 1 0
      6.956545  59.25924 1 1 1 1 4 1 0
      7.313221         . 0 1 0 0 4 2 0
      7.090077  86.42432 0 0 1 0 4 2 0
       7.17012  86.42432 0 0 1 0 4 2 0
      8.070906         . 0 0 0 0 1 7 0
      7.038784  71.40295 0 0 0 0 1 4 0
      7.377759         . 0 0 1 0 4 2 1
             .  61.76126 0 0 1 1 4 5 0
      7.156177  60.24628 1 1 1 0 4 1 0
      7.696213  137.3872 0 0 0 0 1 2 1
      7.600903         . 0 0 0 0 4 6 0
      7.377759         . 0 0 0 0 1 2 0
      7.438384         . 0 0 0 0 4 6 0
      8.070906  97.22437 0 0 0 0 4 6 0
      7.313221 135.72983 0 0 1 0 4 1 1
      7.785721 115.85059 0 0 0 0 1 2 1
       7.37149         . 0 0 0 0 4 2 0
      7.600903         . 0 0 1 0 4 1 1
      7.244227  98.73022 0 0 0 0 4 6 0
      7.207119  98.73022 0 0 0 0 4 6 0
      7.495542         . 0 0 0 0 4 2 1
      7.495542  72.30367 0 0 1 0 4 1 1
      7.824046         . 0 0 1 0 4 2 1
      7.863267 119.88927 0 0 0 0 4 7 0
      7.313221 143.26909 0 0 1 0 1 4 1
      7.377759         . 0 0 1 0 1 2 0
      7.549609         . 0 0 0 0 1 5 1
       7.17012         . 0 0 0 0 4 2 1
      6.306275         . 0 0 0 1 4 4 0
      7.090077  158.2116 0 0 1 1 1 1 0
      7.330405         . 0 0 1 0 4 1 1
      7.090077         . 0 0 0 1 4 1 0
      7.495542         . 0 0 0 0 4 2 1
      8.476371  94.69165 0 0 1 1 4 2 0
      7.059618  95.15903 0 0 0 0 1 5 0
      7.313221         . 0 0 0 1 4 2 0
      7.600903         . 0 0 0 0 4 5 1
      7.549609   95.1027 0 0 0 0 1 2 0
      8.006368   78.5396 0 0 0 0 4 5 1
      7.438384         . 0 0 1 0 4 2 1
      7.130899         . 0 0 0 0 1 1 1
      7.600903   99.4316 0 0 1 0 4 5 1
      7.937375 73.948044 0 0 0 0 4 5 0
      8.192571         . 0 0 0 0 4 2 0
      end
      label values contract_type contract_type
      label def contract_type 1 "Permanent", modify
      label def contract_type 4 "Other temporary", modify
      label def contract_type 5 "No contract", modify
      label values education education
      label def education 1 "Aucun diplôme", modify
      label def education 2 "CEP Brevet des collèges, BEPC, CAP, BEP", modify
      label def education 3 "Bac tech ou profes. ou dipl.de ce niveau", modify
      label def education 4 "Bac général brevet supérieur", modify
      label def education 5 "Bac+2", modify
      label def education 6 "Bac+3 ou Bac+4", modify
      label def education 7 "Dip. supérieur à bac+4", modify
      label values gender gender
      label def gender 0 "Female", modify
      label def gender 1 "Male", modify
      That said, do you mean missing values in the weights variable?

      Thanks for your reply!

      Comment


      • #4
        Luca:
        by creating a fictitious cross-sectional -id- (as your -dataex- example came without it), this is what I got:
        Code:
        . mixed log_wage i.gender outsourced outfirm1 outworker1 ptime i.contract_type i.education [pw=coeff_panel] || id:
        
        Obtaining starting values by EM ...
        
        Performing gradient-based optimization:
        Iteration 0:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 1:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 2:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 3:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 4:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 5:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 6:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 7:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 8:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 9:   log pseudolikelihood =  287382.94  (not concave)
        Iteration 10:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 11:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 12:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 13:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 14:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 15:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 16:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 17:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 18:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 19:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 20:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 21:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 22:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 23:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 24:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 25:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 26:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 27:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 28:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 29:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 30:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 31:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 32:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 33:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 34:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 35:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 36:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 37:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 38:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 39:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 40:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 41:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 42:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 43:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 44:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 45:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 46:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 47:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 48:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 49:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 50:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 51:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 52:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 53:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 54:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 55:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 56:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 57:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 58:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 59:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 60:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 61:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 62:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 63:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 64:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 65:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 66:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 67:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 68:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 69:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 70:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 71:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 72:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 73:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 74:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 75:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 76:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 77:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 78:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 79:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 80:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 81:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 82:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 83:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 84:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 85:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 86:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 87:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 88:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 89:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 90:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 91:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 92:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 93:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 94:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 95:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 96:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 97:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 98:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 99:  log pseudolikelihood =  287382.94  (not concave)
        Iteration 100: log pseudolikelihood =  287382.94  (not concave)
        Iteration 101: log pseudolikelihood =  287382.94  (not concave)
        Iteration 102: log pseudolikelihood =  287382.94  (not concave)
        Iteration 103: log pseudolikelihood =  287382.94  (not concave)
        Iteration 104: log pseudolikelihood =  287382.94  (not concave)
        Iteration 105: log pseudolikelihood =  287382.94  (not concave)
        Iteration 106: log pseudolikelihood =  287382.94  (not concave)
        Iteration 107: log pseudolikelihood =  287382.94  (not concave)
        Iteration 108: log pseudolikelihood =  287382.94  (not concave)
        Iteration 109: log pseudolikelihood =  287382.94  (not concave)
        Iteration 110: log pseudolikelihood =  287382.94  (not concave)
        Iteration 111: log pseudolikelihood =  287382.94  (not concave)
        Iteration 112: log pseudolikelihood =  287382.94  (not concave)
        Iteration 113: log pseudolikelihood =  287382.94  (not concave)
        Iteration 114: log pseudolikelihood =  287382.94  (not concave)
        Iteration 115: log pseudolikelihood =  287382.94  (not concave)
        Iteration 116: log pseudolikelihood =  287382.94  (not concave)
        Iteration 117: log pseudolikelihood =  287382.94  (not concave)
        Iteration 118: log pseudolikelihood =  287382.94  (not concave)
        Iteration 119: log pseudolikelihood =  287382.94  (not concave)
        Iteration 120: log pseudolikelihood =  287382.94  (not concave)
        Iteration 121: log pseudolikelihood =  287382.94  (not concave)
        Iteration 122: log pseudolikelihood =  287382.94  (not concave)
        Iteration 123: log pseudolikelihood =  287382.94  (not concave)
        Iteration 124: log pseudolikelihood =  287382.94  (not concave)
        Iteration 125: log pseudolikelihood =  287382.94  (not concave)
        Iteration 126: log pseudolikelihood =  287382.94  (not concave)
        Iteration 127: log pseudolikelihood =  287382.94  (not concave)
        Iteration 128: log pseudolikelihood =  287382.94  (not concave)
        Iteration 129: log pseudolikelihood =  287382.94  (not concave)
        Iteration 130: log pseudolikelihood =  287382.94  (not concave)
        Iteration 131: log pseudolikelihood =  287382.94  (not concave)
        Iteration 132: log pseudolikelihood =  287382.94  (not concave)
        Iteration 133: log pseudolikelihood =  287382.94  (not concave)
        Iteration 134: log pseudolikelihood =  287382.94  (not concave)
        Iteration 135: log pseudolikelihood =  287382.94  (not concave)
        Iteration 136: log pseudolikelihood =  287382.94  (not concave)
        Iteration 137: log pseudolikelihood =  287382.94  (not concave)
        Iteration 138: log pseudolikelihood =  287382.94  (not concave)
        Iteration 139: log pseudolikelihood =  287382.94  (not concave)
        Iteration 140: log pseudolikelihood =  287382.94  (not concave)
        Iteration 141: log pseudolikelihood =  287382.94  (not concave)
        Iteration 142: log pseudolikelihood =  287382.94  (not concave)
        Iteration 143: log pseudolikelihood =  287382.94  (not concave)
        Iteration 144: log pseudolikelihood =  287382.94  (not concave)
        Iteration 145: log pseudolikelihood =  287382.94  (not concave)
        Iteration 146: log pseudolikelihood =  287382.94  (not concave)
        Iteration 147: log pseudolikelihood =  287382.94  (not concave)
        Iteration 148: log pseudolikelihood =  287382.94  (not concave)
        Iteration 149: log pseudolikelihood =  287382.94  (not concave)
        Iteration 150: log pseudolikelihood =  287382.94  (not concave)
        Iteration 151: log pseudolikelihood =  287382.94  (not concave)
        Iteration 152: log pseudolikelihood =  287382.94  (not concave)
        Iteration 153: log pseudolikelihood =  287382.94  (not concave)
        Iteration 154: log pseudolikelihood =  287382.94  (not concave)
        Iteration 155: log pseudolikelihood =  287382.94  (not concave)
        Iteration 156: log pseudolikelihood =  287382.94  (not concave)
        Iteration 157: log pseudolikelihood =  287382.94  (not concave)
        Iteration 158: log pseudolikelihood =  287382.94  (not concave)
        Iteration 159: log pseudolikelihood =  287382.94  (not concave)
        Iteration 160: log pseudolikelihood =  287382.94  (not concave)
        Iteration 161: log pseudolikelihood =  287382.94  (not concave)
        Iteration 162: log pseudolikelihood =  287382.94  (not concave)
        Iteration 163: log pseudolikelihood =  287382.94  (not concave)
        Iteration 164: log pseudolikelihood =  287382.94  (not concave)
        Iteration 165: log pseudolikelihood =  287382.94  (not concave)
        Iteration 166: log pseudolikelihood =  287382.94  (not concave)
        Iteration 167: log pseudolikelihood =  287382.94  (not concave)
        Iteration 168: log pseudolikelihood =  287382.94  (not concave)
        Iteration 169: log pseudolikelihood =  287382.94  (not concave)
        Iteration 170: log pseudolikelihood =  287382.94  (not concave)
        Iteration 171: log pseudolikelihood =  287382.94  (not concave)
        Iteration 172: log pseudolikelihood =  287382.94  (not concave)
        Iteration 173: log pseudolikelihood =  287382.94  (not concave)
        Iteration 174: log pseudolikelihood =  287382.94  (not concave)
        Iteration 175: log pseudolikelihood =  287382.94  (not concave)
        Iteration 176: log pseudolikelihood =  287382.94  (not concave)
        Iteration 177: log pseudolikelihood =  287382.94  (not concave)
        Iteration 178: log pseudolikelihood =  287382.94  (not concave)
        Iteration 179: log pseudolikelihood =  287382.94  (not concave)
        Iteration 180: log pseudolikelihood =  287382.94  (not concave)
        Iteration 181: log pseudolikelihood =  287382.94  (not concave)
        Iteration 182: log pseudolikelihood =  287382.94  (not concave)
        Iteration 183: log pseudolikelihood =  287382.94  (not concave)
        Iteration 184: log pseudolikelihood =  287382.94  (not concave)
        Iteration 185: log pseudolikelihood =  287382.94  (not concave)
        Iteration 186: log pseudolikelihood =  287382.94  (not concave)
        Iteration 187: log pseudolikelihood =  287382.94  (not concave)
        Iteration 188: log pseudolikelihood =  287382.94  (not concave)
        Iteration 189: log pseudolikelihood =  287382.94  (not concave)
        Iteration 190: log pseudolikelihood =  287382.94  (not concave)
        Iteration 191: log pseudolikelihood =  287382.94  (not concave)
        Iteration 192: log pseudolikelihood =  287382.94  (not concave)
        Iteration 193: log pseudolikelihood =  287382.94  (not concave)
        Iteration 194: log pseudolikelihood =  287382.94  (not concave)
        Iteration 195: log pseudolikelihood =  287382.94  (not concave)
        Iteration 196: log pseudolikelihood =  287382.94  (not concave)
        Iteration 197: log pseudolikelihood =  287382.94  (not concave)
        Iteration 198: log pseudolikelihood =  287382.94  (not concave)
        Iteration 199: log pseudolikelihood =  287382.94  (not concave)
        Iteration 200: log pseudolikelihood =  287382.94  (not concave)
        Iteration 201: log pseudolikelihood =  287382.94  (not concave)
        Iteration 202: log pseudolikelihood =  287382.94  (not concave)
        Iteration 203: log pseudolikelihood =  287382.94  (not concave)
        Iteration 204: log pseudolikelihood =  287382.94  (not concave)
        Iteration 205: log pseudolikelihood =  287382.94  (not concave)
        Iteration 206: log pseudolikelihood =  287382.94  (not concave)
        Iteration 207: log pseudolikelihood =  287382.94  (not concave)
        Iteration 208: log pseudolikelihood =  287382.94  (not concave)
        Iteration 209: log pseudolikelihood =  287382.94  (not concave)
        Iteration 210: log pseudolikelihood =  287382.94  (not concave)
        Iteration 211: log pseudolikelihood =  287382.94  (not concave)
        Iteration 212: log pseudolikelihood =  287382.94  (not concave)
        Iteration 213: log pseudolikelihood =  287382.94  (not concave)
        Iteration 214: log pseudolikelihood =  287382.94  (not concave)
        Iteration 215: log pseudolikelihood =  287382.94  (not concave)
        Iteration 216: log pseudolikelihood =  287382.94  (not concave)
        Iteration 217: log pseudolikelihood =  287382.94  (not concave)
        Iteration 218: log pseudolikelihood =  287382.94  (not concave)
        Iteration 219: log pseudolikelihood =  287382.94  (not concave)
        Iteration 220: log pseudolikelihood =  287382.94  (not concave)
        Iteration 221: log pseudolikelihood =  287382.94  (not concave)
        Iteration 222: log pseudolikelihood =  287382.94  (not concave)
        Iteration 223: log pseudolikelihood =  287382.94  (not concave)
        Iteration 224: log pseudolikelihood =  287382.94  (not concave)
        Iteration 225: log pseudolikelihood =  287382.94  (not concave)
        Iteration 226: log pseudolikelihood =  287382.94  (not concave)
        Iteration 227: log pseudolikelihood =  287382.94  (not concave)
        Iteration 228: log pseudolikelihood =  287382.94  (not concave)
        Iteration 229: log pseudolikelihood =  287382.94  (not concave)
        Iteration 230: log pseudolikelihood =  287382.94  (not concave)
        Iteration 231: log pseudolikelihood =  287382.94  (not concave)
        Iteration 232: log pseudolikelihood =  287382.94  (not concave)
        Iteration 233: log pseudolikelihood =  287382.94  (not concave)
        Iteration 234: log pseudolikelihood =  287382.94  (not concave)
        Iteration 235: log pseudolikelihood =  287382.94  (not concave)
        Iteration 236: log pseudolikelihood =  287382.94  (not concave)
        Iteration 237: log pseudolikelihood =  287382.94  (not concave)
        Iteration 238: log pseudolikelihood =  287382.94  (not concave)
        Iteration 239: log pseudolikelihood =  287382.94  (not concave)
        Iteration 240: log pseudolikelihood =  287382.94  (not concave)
        Iteration 241: log pseudolikelihood =  287382.94  (not concave)
        Iteration 242: log pseudolikelihood =  287382.94  (not concave)
        Iteration 243: log pseudolikelihood =  287382.94  (not concave)
        Iteration 244: log pseudolikelihood =  287382.94  (not concave)
        Iteration 245: log pseudolikelihood =  287382.94  (not concave)
        Iteration 246: log pseudolikelihood =  287382.94  (not concave)
        Iteration 247: log pseudolikelihood =  287382.94  (not concave)
        Iteration 248: log pseudolikelihood =  287382.94  (not concave)
        Iteration 249: log pseudolikelihood =  287382.94  (not concave)
        Iteration 250: log pseudolikelihood =  287382.94  (not concave)
        Iteration 251: log pseudolikelihood =  287382.94  (not concave)
        Iteration 252: log pseudolikelihood =  287382.94  (not concave)
        Iteration 253: log pseudolikelihood =  287382.94  (not concave)
        Iteration 254: log pseudolikelihood =  287382.94  (not concave)
        Iteration 255: log pseudolikelihood =  287382.94  (not concave)
        Iteration 256: log pseudolikelihood =  287382.94  (not concave)
        Iteration 257: log pseudolikelihood =  287382.94  (not concave)
        Iteration 258: log pseudolikelihood =  287382.94  (not concave)
        Iteration 259: log pseudolikelihood =  287382.94  (not concave)
        Iteration 260: log pseudolikelihood =  287382.94  (not concave)
        Iteration 261: log pseudolikelihood =  287382.94  (not concave)
        Iteration 262: log pseudolikelihood =  287382.94  (not concave)
        Iteration 263: log pseudolikelihood =  287382.94  (not concave)
        Iteration 264: log pseudolikelihood =  287382.94  (not concave)
        Iteration 265: log pseudolikelihood =  287382.94  (not concave)
        Iteration 266: log pseudolikelihood =  287382.94  (not concave)
        Iteration 267: log pseudolikelihood =  287382.94  (not concave)
        Iteration 268: log pseudolikelihood =  287382.94  (not concave)
        Iteration 269: log pseudolikelihood =  287382.94  (not concave)
        Iteration 270: log pseudolikelihood =  287382.94  (not concave)
        Iteration 271: log pseudolikelihood =  287382.94  (not concave)
        Iteration 272: log pseudolikelihood =  287382.94  (not concave)
        Iteration 273: log pseudolikelihood =  287382.94  (not concave)
        Iteration 274: log pseudolikelihood =  287382.94  (not concave)
        Iteration 275: log pseudolikelihood =  287382.94  (not concave)
        Iteration 276: log pseudolikelihood =  287382.94  (not concave)
        Iteration 277: log pseudolikelihood =  287382.94  (not concave)
        Iteration 278: log pseudolikelihood =  287382.94  (not concave)
        Iteration 279: log pseudolikelihood =  287382.94  (not concave)
        Iteration 280: log pseudolikelihood =  287382.94  (not concave)
        Iteration 281: log pseudolikelihood =  287382.94  (not concave)
        Iteration 282: log pseudolikelihood =  287382.94  (not concave)
        Iteration 283: log pseudolikelihood =  287382.94  (not concave)
        Iteration 284: log pseudolikelihood =  287382.94  (not concave)
        Iteration 285: log pseudolikelihood =  287382.94  (not concave)
        Iteration 286: log pseudolikelihood =  287382.94  (not concave)
        Iteration 287: log pseudolikelihood =  287382.94  (not concave)
        Iteration 288: log pseudolikelihood =  287382.94  (not concave)
        Iteration 289: log pseudolikelihood =  287382.94  (not concave)
        Iteration 290: log pseudolikelihood =  287382.94  (not concave)
        Iteration 291: log pseudolikelihood =  287382.94  (not concave)
        Iteration 292: log pseudolikelihood =  287382.94  (not concave)
        Iteration 293: log pseudolikelihood =  287382.94  (not concave)
        Iteration 294: log pseudolikelihood =  287382.94  (not concave)
        Iteration 295: log pseudolikelihood =  287382.94  (not concave)
        Iteration 296: log pseudolikelihood =  287382.94  (not concave)
        Iteration 297: log pseudolikelihood =  287382.94  (not concave)
        Iteration 298: log pseudolikelihood =  287382.94  (not concave)
        Iteration 299: log pseudolikelihood =  287382.94  (not concave)
        Iteration 300: log pseudolikelihood =  287382.94  (not concave)
        convergence not achieved
        
        Computing standard errors ...
        standard-error calculation has failed
        
        Mixed-effects regression                        Number of obs     =         57
        Group variable: id                              Number of groups  =         57
                                                        Obs per group:
                                                                      min =          1
                                                                      avg =        1.0
                                                                      max =          1
                                                        Wald chi2(10)     =          .
        Log pseudolikelihood =  287382.94               Prob > chi2       =          .
        
                                                                         (Std. err. adjusted for 57 clusters in id)
        -----------------------------------------------------------------------------------------------------------
                                                  |               Robust
                                         log_wage | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
        ------------------------------------------+----------------------------------------------------------------
                                           gender |
                                            Male  |   .2221819   .0715993     3.10   0.002     .0818498     .362514
                                       outsourced |  -.2449212   .1475039    -1.66   0.097    -.5340235    .0441811
                                         outfirm1 |  -.0362309   .0868196    -0.42   0.676    -.2063942    .1339325
                                       outworker1 |  -.0583639   .1003234    -0.58   0.561     -.254994    .1382663
                                            ptime |  -.0733635    .329661    -0.22   0.824    -.7194872    .5727602
                                                  |
                                    contract_type |
                                 Other temporary  |   -.114117   .0868196    -1.31   0.189    -.2842803    .0560464
                                     No contract  |  -1.384188   .1155947   -11.97   0.000     -1.61075   -1.157627
                                                  |
                                        education |
         CEP Brevet des collèges, BEPC, CAP, BEP  |   .0506772   .1313256     0.39   0.700    -.2067161    .3080706
        Bac tech ou profes. ou dipl.de ce niveau  |    .058821   .1245035     0.47   0.637    -.1852014    .3028435
                    Bac général brevet supérieur  |  -.3399236   .1261898    -2.69   0.007     -.587251   -.0925962
                                           Bac+2  |   .1736642   .1230843     1.41   0.158    -.0675766    .4149051
                                  Bac+3 ou Bac+4  |   .2733592    .171856     1.59   0.112    -.0634724    .6101909
                          Dip. supérieur à bac+4  |   .5433668   .1307474     4.16   0.000     .2871066    .7996271
                                                  |
                                            _cons |   7.434017   .1609209    46.20   0.000     7.118618    7.749416
        -----------------------------------------------------------------------------------------------------------
        
        ------------------------------------------------------------------------------
                                     |               Robust          
          Random-effects parameters  |   Estimate   std. err.     [95% conf. interval]
        -----------------------------+------------------------------------------------
        id: Identity                 |
                          var(_cons) |   .0009183          .             .           .
        -----------------------------+------------------------------------------------
                       var(Residual) |   7.10e-45          .             .           .
        ------------------------------------------------------------------------------
        
        Warning: Sampling weights were specified only at the first level in a multilevel model. If these weights are indicative of overall and
                 not conditional inclusion probabilities, then results may be biased.
        
        Warning: Convergence not achieved.
        Warning: Standard-error calculation failed.
        
        . mixed log_wage i.gender outsourced outfirm1 outworker1 ptime i.contract_type i.education  || id:
        
        Performing EM optimization ...
        
        Performing gradient-based optimization:
        could not calculate numerical derivatives -- discontinuous region with missing values encountered
        could not calculate numerical derivatives -- discontinuous region with missing values encountered
        r(430);
        
        .
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          I cannot figure out why the id should make a difference...as if I use the following set I get these results:

          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input float(log_wage coeff_panel outsourced outfirm1 outworker1 ptime contract_type education) byte gender float year double id
          7.600903 281.13644 0 0 0 0 4 3 1 2013 10000010100001
          7.863267         . 0 0 0 0 1 5 0 2016 10000031100001
          8.006368         . 0 0 1 0 4 2 1 2016 10000031100003
           7.17012  55.51101 1 1 1 0 4 2 1 2013 10000040100003
          7.377759 152.79167 0 0 1 0 4 5 0 2013 10000050100002
          7.090077 107.83526 0 0 0 0 4 6 0 2013 10000060100002
          7.423568 107.83526 0 0 0 0 4 6 0 2016 10000060100002
          7.377759         . 0 1 0 0 4 2 1 2016 10000081100001
          6.912743         . 0 0 0 1 4 2 0 2016 10000081100002
          7.582229  92.93236 0 0 1 0 4 2 1 2013 10000090100001
           7.36074 101.95383 0 0 0 1 1 2 0 2013 10000090100002
          7.673223   60.2477 0 0 1 0 1 1 1 2013 10000120100001
          7.354362   125.073 0 0 1 0 1 2 1 2013 10000160100001
           8.34284  99.66017 0 0 0 0 1 6 1 2013 10000170100001
          8.062748  82.25291 0 0 0 0 1 6 0 2013 10000170100002
          8.070906  82.25291 0 0 0 0 1 6 0 2016 10000170100002
          6.907755         . 0 0 0 1 4 2 0 2016 10000171100002
          7.696213 117.65243 0 0 0 0 4 5 1 2013 10000180100001
          7.377759 129.11101 0 0 0 0 1 5 0 2013 10000180100002
          7.495542 129.11101 0 0 0 0 1 5 0 2016 10000180100002
          7.495542         . 0 0 0 0 1 2 1 2016 10000181100001
          5.991465   75.8704 0 0 1 0 5 1 0 2013 10000190100002
          7.645876  87.60444 0 0 0 0 4 6 1 2013 10000200100002
          7.783224  87.60444 0 0 0 0 4 6 1 2016 10000200100002
          7.678789  97.53782 0 1 0 0 1 3 1 2013 10000220100002
          7.218177         . 0 0 0 0 4 2 1 2016 10000221100002
          7.313221         . 0 0 0 0 1 2 1 2016 10000221100003
          7.467371  90.57919 0 0 1 0 1 2 0 2013 10000230100001
          7.783224  149.7837 0 0 1 0 4 2 0 2013 10000240100001
           7.17012         . 0 0 1 0 4 1 1 2016 10000251100001
          7.313221         . 0 0 0 0 4 2 0 2016 10000261100002
          7.600903 163.74648 0 0 0 0 4 2 0 2013 10000280100001
          7.438384 71.240326 0 0 1 0 4 1 1 2013 10000290100001
          7.495542 71.240326 0 0 1 0 4 1 1 2016 10000290100001
          7.313221 103.50581 0 0 0 0 4 2 0 2013 10000290100002
          7.438384 103.50581 0 0 0 0 4 2 0 2016 10000290100002
          8.006368         . 0 0 0 0 4 6 0 2016 10000291100002
          7.783224         . 0 0 0 0 4 6 1 2016 10000321100001
          7.600903         . 0 0 0 0 1 6 0 2016 10000321100002
          7.244227         . 0 0 1 0 4 4 0 2016 10000341100001
          8.160519         . 0 0 1 0 4 2 1 2016 10000341100002
          7.740664 103.70039 1 1 1 0 1 5 1 2013 10000350100001
          7.696213 103.70039 0 0 1 0 4 5 1 2016 10000350100001
          8.070906         . 0 0 1 0 1 4 0 2016 10000351100001
          7.901007         . 0 0 1 0 1 6 1 2016 10000351100002
          7.230563 123.17227 0 0 0 0 1 2 0 2013 10000360100001
          8.294049         . 0 0 1 0 4 5 0 2016 10000361100002
          7.327123  116.6377 0 0 0 0 4 2 0 2013 10000370100001
          7.313221  95.39109 0 0 0 0 4 2 0 2013 10000390100001
          7.090077         . 0 0 0 0 1 3 0 2016 10000421100001
          6.214608  89.44495 0 0 1 1 4 2 0 2013 10000430100203
          7.003066  57.20824 1 1 1 0 4 1 1 2013 10000440100001
          7.123673  57.20824 1 1 1 0 1 1 1 2016 10000440100001
          7.495542  110.8087 0 0 1 0 4 1 0 2013 10000450100001
          7.696213  110.8087 0 0 0 0 1 1 0 2016 10000450100001
          6.109248         . 0 0 1 1 4 1 0 2016 10000461100001
          6.956545  59.25924 1 1 1 1 4 1 0 2013 10000470100001
          7.313221         . 0 1 0 0 4 2 0 2016 10000481100001
          7.090077  86.42432 0 0 1 0 4 2 0 2013 10000490100001
           7.17012  86.42432 0 0 1 0 4 2 0 2016 10000490100001
          8.070906         . 0 0 0 0 1 7 0 2016 10000491100001
          7.038784  71.40295 0 0 0 0 1 4 0 2013 10000510100001
          7.377759         . 0 0 1 0 4 2 1 2016 10000511100002
                 .  61.76126 0 0 1 1 4 5 0 2013 10000530100001
          7.156177  60.24628 1 1 1 0 4 1 0 2013 10000570100001
          7.696213  137.3872 0 0 0 0 1 2 1 2013 10000620100001
          7.600903         . 0 0 0 0 4 6 0 2016 10000631100001
          7.377759         . 0 0 0 0 1 2 0 2016 10000641100002
          7.438384         . 0 0 0 0 4 6 0 2016 10000641100003
          8.070906  97.22437 0 0 0 0 4 6 0 2013 10000650100001
          7.313221 135.72983 0 0 1 0 4 1 1 2013 10000650100002
          7.785721 115.85059 0 0 0 0 1 2 1 2013 10000670100001
           7.37149         . 0 0 0 0 4 2 0 2016 10000671100001
          7.600903         . 0 0 1 0 4 1 1 2016 10000701100001
          7.244227  98.73022 0 0 0 0 4 6 0 2013 10000730100002
          7.207119  98.73022 0 0 0 0 4 6 0 2016 10000730100002
          7.495542         . 0 0 0 0 4 2 1 2016 10000751100002
          7.495542  72.30367 0 0 1 0 4 1 1 2013 10000760100001
          7.824046         . 0 0 1 0 4 2 1 2016 10000761100003
          7.863267 119.88927 0 0 0 0 4 7 0 2013 10000770100001
          7.313221 143.26909 0 0 1 0 1 4 1 2013 10000770100002
          7.377759         . 0 0 1 0 1 2 0 2016 10000771100001
          7.549609         . 0 0 0 0 1 5 1 2016 10000771100002
           7.17012         . 0 0 0 0 4 2 1 2016 10000781100001
          6.306275         . 0 0 0 1 4 4 0 2016 10000801100001
          7.090077  158.2116 0 0 1 1 1 1 0 2013 10000810100001
          7.330405         . 0 0 1 0 4 1 1 2016 10000811100001
          7.090077         . 0 0 0 1 4 1 0 2016 10000811100002
          7.495542         . 0 0 0 0 4 2 1 2016 10000831100001
          8.476371  94.69165 0 0 1 1 4 2 0 2013 10000840100001
          7.059618  95.15903 0 0 0 0 1 5 0 2013 10000850100001
          7.313221         . 0 0 0 1 4 2 0 2016 10000881100001
          7.600903         . 0 0 0 0 4 5 1 2016 10000901100002
          7.549609   95.1027 0 0 0 0 1 2 0 2013 10000920100001
          8.006368   78.5396 0 0 0 0 4 5 1 2013 10000920100002
          7.438384         . 0 0 1 0 4 2 1 2016 10000931100001
          7.130899         . 0 0 0 0 1 1 1 2016 10000941100001
          7.600903   99.4316 0 0 1 0 4 5 1 2013 10000950100001
          7.937375 73.948044 0 0 0 0 4 5 0 2013 10000960100001
          8.192571         . 0 0 0 0 4 2 0 2016 10000991100002
          end
          label values contract_type contract_type
          label def contract_type 1 "Permanent", modify
          label def contract_type 4 "Other temporary", modify
          label def contract_type 5 "No contract", modify
          label values education education
          label def education 1 "Aucun diplôme", modify
          label def education 2 "CEP Brevet des collèges, BEPC, CAP, BEP", modify
          label def education 3 "Bac tech ou profes. ou dipl.de ce niveau", modify
          label def education 4 "Bac général brevet supérieur", modify
          label def education 5 "Bac+2", modify
          label def education 6 "Bac+3 ou Bac+4", modify
          label def education 7 "Dip. supérieur à bac+4", modify
          label values gender gender
          label def gender 0 "Female", modify
          label def gender 1 "Male", modify
          
           mixed log_wage i.gender outsourced outfirm1 outworker1 ptime i.contract_type i.education [pw=coeff_panel] in 1/100 || id: 
          
          Performing gradient-based optimization: 
          
          Iteration 0:   log pseudolikelihood =  10471.691  
          Iteration 1:   log pseudolikelihood =  10471.691  (backed up)
          
          Computing standard errors:
          
          Mixed-effects regression                        Number of obs     =         57
          Group variable: id                              Number of groups  =         46
          
                                                          Obs per group:
                                                                        min =          1
                                                                        avg =        1.2
                                                                        max =          2
          
                                                          Wald chi2(10)     =          .
          Log pseudolikelihood =  10471.691               Prob > chi2       =          .
          
                                                                           (Std. Err. adjusted for 46 clusters in id)
          -----------------------------------------------------------------------------------------------------------
                                                    |               Robust
                                           log_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          ------------------------------------------+----------------------------------------------------------------
                                             gender |
                                              Male  |   .2146024   .0833776     2.57   0.010     .0511853    .3780195
                                         outsourced |   -.033605   .0002123  -158.29   0.000    -.0340212   -.0331889
                                           outfirm1 |  -.0427752   .0003911  -109.37   0.000    -.0435417   -.0420086
                                         outworker1 |  -.0799935   .0004626  -172.91   0.000    -.0809002   -.0790868
                                              ptime |  -.0873131   .3504094    -0.25   0.803     -.774103    .5994767
                                                    |
                                      contract_type |
                                   Other temporary  |  -.1206617   .0003911  -308.50   0.000    -.1214283   -.1198951
                                       No contract  |  -1.322504   .1223586   -10.81   0.000    -1.562322   -1.082685
                                                    |
                                          education |
           CEP Brevet des collèges, BEPC, CAP, BEP  |   .1078143   .1395732     0.77   0.440    -.1657443    .3813728
          Bac tech ou profes. ou dipl.de ce niveau  |   .1129998   .0946673     1.19   0.233    -.0725447    .2985444
                      Bac général brevet supérieur  |  -.2852608   .1128181    -2.53   0.011    -.5063802   -.0641415
                                             Bac+2  |   .2206229   .1386525     1.59   0.112    -.0511309    .4923768
                                    Bac+3 ou Bac+4  |   .3945379   .1768672     2.23   0.026     .0478846    .7411911
                            Dip. supérieur à bac+4  |   .5899667   .1224205     4.82   0.000     .3500268    .8299065
                                                    |
                                              _cons |   7.393962   .1224497    60.38   0.000     7.153965    7.633959
          -----------------------------------------------------------------------------------------------------------
          
          ------------------------------------------------------------------------------
                                       |               Robust           
            Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
          -----------------------------+------------------------------------------------
          id: Identity                 |
                            var(_cons) |   .1045031   .0404469      .0489418    .2231405
          -----------------------------+------------------------------------------------
                         var(Residual) |   .0015432   .0010173      .0004239    .0056174
          ------------------------------------------------------------------------------
          In any case, also excluding some missings in the outcome variable, using the full sample I still encounter the same problem when applying weights....

          Comment


          • #6
            Luca:
            we usually use -id- in longitudinal study to divide the dataset in panels.
            As I do not know nothing about your research (exception made for what you decided to share), I thought it was interesting to notice if, for instance, you have singletons among your observations.
            That said, the usual recipe in this cases is to add one predictor at a time and see when Stata starts to have convergence problems.
            As an side, full reference are a good habit, especilly for those (like me) who are totally unfamiliar with (Bell, 2019), as you might be with (Black, 1990).
            Kind regards,
            Carlo
            (StataNow 18.5)

            Comment

            Working...
            X