Announcement

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

  • Multilevel regresion xtmixed or mixed

    Hi all,

    I have date of 100 employees per company, for several companies. I would like to perform a Multilevel regresion where Dependent variable is at company level, independent variables are at employee/individual level, and control variable are at both levels, that is:

    - Dependent: Firm innovation level (inn)
    - Independent: Employee's productivity (Empprod), Employee creativity (empcrea)
    - Controls: Firm financial performance (ROA), firm size (size), Employee tenure (emptenure), employee level of studies (empstud)

    All my variables are CONTINOUS, so I performed:

    xtmixed inn emprod empcrea roa size emptenure empstud, mle

    My questions are:

    - Why the programm did not work if I set the syntax || company ? Am I okey using this methodology for this data or should I use another?
    - How can I obtain post stimation such as R-Squared or sd for both levels ?

    I would be very thanks if someone could she light on my problem

  • #2
    Welcome to the Stata Forum \ Statalist.

    Please present exactly what you typed. The command line in #1 doesn't show the levels ("||"), yet you referred to it in the next lines.

    Please explain what you meant by "did not work".

    Unless you're using an old version, the current command is - mixed -, but that won't change the output.

    Please read the FAQ. There you'll find important advice concerning the use of dataex, the best way to share data\output\results, etc.
    Best regards,

    Marcos

    Comment


    • #3
      Hi Marcos

      If I write xtmixed inn empprod empcrea roa size emptenure empstud, || company: , stata starts to make the iterations but never stop, and so I never get an output of my regression, that's what is not working. I used xtmixed since my version is stata 12, where mixed command is not available, but I read that they perform the same.

      Thanks you so much Marcos for your kind help!

      Manuel BG

      Comment


      • #4
        Maybe you wish to take a look at this thread.
        Best regards,

        Marcos

        Comment


        • #5
          Hi Marcos,

          Thanks for you kindly help! that was very useful for me. Now I ran the following code:

          xtmixed inn empprod empcrea roa size emptenure empstud, || company: roa size, covariance(independent) || employee: empprod empcrea emptenure empstud, covariance(independent) vce(cluster company) emonly

          However, I got the error r(430)

          "convergence not achieved;
          You have estimated a maximum-likelihood model, and Stata's
          maximization procedure failed to converge to a solution;
          see [R] maximize. Check if the model is identified."

          Is this because too many itarations are set? How can I correct this? I Think the error may be caused due to de Dependent variable is at company 2 level, or isnt matter?

          Thanks you so much for your hep

          best regards

          Manuel BG

          Comment


          • #6
            PS: the specific error is "likelihood evaluates to missing"

            thanks!

            Comment


            • #7
              Please use - dataex - (as per FAQ) to provide command/output. Thanks.

              I'm not sure if you are fully aware that having 6 variables in the random-effects side is quite a challenge, let alone the probability of not much (if any) improvement in the model.
              Best regards,

              Marcos

              Comment


              • #8
                Hi Marcos,

                Using dataex, i get this output:

                . dataex

                ----------------------- copy starting from the next line -----------------------
                Code:
                * Example generated by -dataex-. To install: ssc install dataex
                clear
                input byte company int(empstud emptenure) float roa byte sector float inn long size float(empprod empcrea) int employee
                29  4  26  8.305694  4  89.72603  149000        78   .4615385   1
                 7  7  40 2.7668295 11  80.50848   17582      58.8          0   2
                 9  2  16 11.469563  7  89.76608   21500     14.25  .07017544   3
                67 18  12 8.6745615  8    95.875  136000    25.875          0   4
                20  2  41  3.439679  4  60.41667   19000         0          0   5
                54 12   8 25.044924  8  87.13528   14800      30.4   .3585526   6
                48 19  93  8.651673  8   96.4191  350600  17.38889 .006389776   7
                42  5  45  8.157781  7  98.88393   11000        53   .6603774   8
                46  7  31 10.897026 12  83.33334  114000 19.142857          0   9
                 4  4  31 1.9788936  5  88.13953   45140       147          0  10
                79  3  13  7.093746  3  70.54794  360000        37          0  11
                90  5 130   6.14554  2  93.59756  135900        31          0  12
                 2  9 183   3.43599  7  92.98781  103000 34.307693          0  13
                58  8  73  .7287041  5  97.42991   48000      39.5   .4388186  14
                35  1  39   1.78653 11  96.89265   33383         0          0  15
                58  6  20  .7287041  5  97.42991   48000        10          0  16
                45  8 115  6.305442  6  73.02158   60000  62.33333          0  17
                59  6 210 13.493484  8    86.875  144000 15.333333          0  18
                31  7 250   4.71165  8        91   72000         0          0  19
                46 10  56 10.897026 12  83.33334  114000 37.416668          0  20
                 1 10 113 14.872394 12  81.11111   93516      19.4          0  21
                84  7 199 11.694198  2  90.64516  201000      28.2          0  22
                18  7  75  9.106699 12  99.30556  153000 34.666668          0  23
                42 13  49  8.157781  7  98.88393   11000        35          0  24
                89  3  65  10.02406 12  89.44954  481000        89          0  25
                60  4  66  1.042302  5  90.88785   59513 32.666668          0  26
                58  9  53  .7287041  5  97.42991   48000    33.375  .13857678  27
                 3 12  46  5.187766  9  98.64865   14000 26.555555          0  28
                80  6  27  31.82955  8  99.64539   29888 27.333334          0  29
                83  9  45 -9.080621  4 73.820755   38000 13.333333      .0875  30
                93  7  14 1.1976173  5  82.74478  262800  35.57143          0  31
                90  6  66   6.14554  2  93.59756  135900        58   .6482759  32
                43  2  14 1.0788869  5  99.30232   35600         0          0  33
                 1  8  21 14.872394 12  81.11111   93516 10.571428          0  34
                 7  4  15 2.7668295 11  80.50848   17582        11          0  35
                23 10 113  5.843965  6  98.24219   48600  9.333333          0  36
                13  8   6 1.2143474  5    73.126  209000 13.714286  .13541667  37
                67  1  69 8.6745615  8    95.875  136000         0          0  38
                11  5  17  3.941756  2  85.67073  258000     17.25          0  39
                58  6  18  .7287041  5  97.42991   48000        43   .1116279  40
                54  9  30 25.044924  8  87.13528   14800  62.42857          0  41
                67 10  23 8.6745615  8    95.875  136000     21.25 .011764706  42
                14  6  19  8.689546  7  91.81818   50000 11.666667          0  43
                75  9  45  3.055567  6  84.53237  100000 27.666666   .4698795  44
                68 11  70 15.917232  4  81.61765  267000    18.375          0  45
                45  7  27  6.305442  6  73.02158   60000     39.75   .6477987  46
                90  6  27   6.14554  2  93.59756  135900     49.75          0  47
                13  8  24 1.2143474  5    73.126  209000        34          0  48
                87  9  12  7.190012  7  31.72043   78700    10.625   .4352941  49
                61  4  61 -.1099945  6  77.33813   34220 12.666667          0  50
                84  8  19 11.694198  2  90.64516  201000      17.5          0  51
                83  3 264 -9.080621  4 73.820755   38000       264          0  52
                20 14 108  3.439679  4  60.41667   19000  95.33334   .6713287  53
                16  8  16 .57025766  5  71.26168  389000  67.85714   .6821052  54
                43  8  17 1.0788869  5  99.30232   35600 20.714285          0  55
                58 10  48  .7287041  5  97.42991   48000  48.44444  .05504587  56
                27  5 103  5.411412  2  78.47682  184000        68          0  57
                36 11  23  6.081564  6  95.70895   71000      10.6          0  58
                35  1  10   1.78653 11  96.89265   33383         0          0  59
                35  7  58   1.78653 11  96.89265   33383        17          0  60
                39  6  53  6.987097  9  95.34534   26800 12.666667   .4736842  61
                21  7  54 1.6322805  5  96.22793   50700 20.666666          0  62
                74  4  64 1.2248882  5  75.03987   19969      40.5          0  63
                61  9   7 -.1099945  6  77.33813   34220        69   .3217391  64
                87  4  97  7.190012  7  31.72043   78700 66.666664          0  65
                77  7  11  1.704518  4      8.75   13000     50.25   .4527363  66
                94  7  58     4.237 10  94.14414    9300        48          0  67
                77  6   6  1.704518  4      8.75   13000      31.8  .27044025  68
                44  6   5 14.292922  2  96.68435  107646 27.166666  .12269939  69
                59 11 140 13.493484  8    86.875  144000 28.833334  .16763006  70
                91  1  26  7.234611  4  84.80392  244000         0          0  71
                10  4  41 16.475676  8  90.57971  132000        25        .94  72
                17 10  16 1.1292744  5  94.18604   49100      71.5          0  73
                50  8  87 1.2596264  5  93.54067  254983     38.25   .5294118  74
                87  3  46  7.190012  7  31.72043   78700        64          0  75
                 6  5  63  6.740419  3  85.61644  653300      59.5          0  76
                 9  5  34 11.469563  7  89.76608   21500        63   .1904762  77
                59 10  45 13.493484  8    86.875  144000        31          0  78
                62 10  96 1.4224663  2  80.46358   28000      33.5   .4278607  79
                10  6  21 16.475676  8  90.57971  132000      10.5          0  80
                37  4  34  .8713331 12  77.31481  177000        37          0  81
                90 11 234   6.14554  2  93.59756  135900     23.75          0  82
                76  7 192 1.9919357 11  95.08671   29192        13          0  83
                91  1  29  7.234611  4  84.80392  244000         0          0  84
                14  5   9  8.689546  7  91.81818   50000      22.5   .6555555  85
                 1  5  56 14.872394 12  81.11111   93516      32.5          0  86
                74  4   5 1.2248882  5  75.03987   19969 13.666667          0  87
                37  9 108  .8713331 12  77.31481  177000 33.666668          0  88
                53  4   6  6.636198  3  91.53005  190000      32.5          0  89
                32  7 123 -10.64974  7  76.06061   16400      22.5          0  90
                15  5  33 1.6955787  7 70.467834  115498     26.75   .1588785  91
                92  9  17 3.5963635  4  94.44444 2200000        20     .31875  92
                 2  8  26   3.43599  7  92.98781  103000  52.14286          0  93
                 6  4   7  6.740419  3  85.61644  653300     13.75   .1818182  94
                13  7 259 1.2143474  5    73.126  209000        60          0  95
                92  6  65 3.5963635  4  94.44444 2200000      18.5  .04054054  96
                 1  6  50 14.872394 12  81.11111   93516     26.75          0  97
                26  6 154   21.2425  4  83.53658   34500      50.5          0  98
                 7  4 136 2.7668295 11  80.50848   17582        96          0  99
                34  7  56 1.8162453 11  83.33334   13688        23  .07971015 100
                end
                ------------------ copy up to and including the previous line ------------------

                Listed 100 out of 10760 observations
                Use the count() option to list more


                Im not sure if using a dependent variable of level 2 is suitable for this sintax, because if I use a dependent variable of level 1, the model coverge without problems...

                If I run just "xtmixed inn empprod empcrea roa size emptenure empstud" I get output, but if I run the mention "xtmixed inn empprod empcrea roa size emptenure empstud, || company: roa size, covariance(independent) || employee: empprod empcrea emptenure empstud, covariance(independent) vce(cluster company) emonly" I get an the error...

                So what can I do?

                I appreciate your help Marcos, thanks

                Manuel BG


                Comment


                • #9
                  Your orginal post says "Dependent variable is at company level, independent variables are at employee/individual level". If this is true, then I think you need to use a latent variable model, not -xtmixed-. I think you wnt to set this up in -sem-; you may also find this paper helpful : http://tinyurl.com/tvaysqp.

                  hth,
                  Jeph

                  Comment


                  • #10
                    Hi Jeph,

                    Thanks for your kindly help! Of course, my dependent variable (inn) was always at company level, and independent at indivudual level (with control variables for both levels)

                    For this reason, that was my question if I was correct using xtmixed, or if I should use another stimation technique. Your reference has been very useful, so finally, do you recomend sem for a structural eqyuation modeling or other commands such as gllamm? I think gllamm also accounts latent variable, but I made a mess with the syntax of this command.

                    Thaks you so much!

                    Manuel BG

                    Comment

                    Working...
                    X