Announcement

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

  • no standard errors and confidence intervals with random effects in "xtmixed"

    I am trying to estimate a mixed effects regression model using xtmixed on imputed data. The model runs fine when I have just a classroom-level random intercept. But if I include random effects for the three of my main classroom-level predictors, I do not get standard errors or confidence intervals with my predictors. Any idea what is wrong?

  • #2
    Portia:
    welcome to the list.
    Please, as per FAQ, post what you typed and what Stata gave you back. Thanks.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Agree with Carlo. More specifically, resist the temptation to post a screenshot of your results or some kind of attachment. Instead, copy your commands and Stata's response directly from Stata's Results window or your log file directly into a code block here on the Forum. (If you don't know how to set up a code block, see FAQ #12 for instructions.) That way you can be assured that what you post will be readable to everybody who uses the forum, especially those who might be inclined to try to answer your question, and that it will be an exact representation of what happened.

      Comment


      • #4
        [ mi estimate: xtmixed mathps inc1rr inc2rr inc3rr mathpf_c childinc2003 amsntdayp asmtageps spasmt chhsun18p boyp ilat iafam iother singlepar imomhs imombs state2 state3 state4 state5 state6 state10 state11 state12 state13 state14 fulldaypnew teachba exptotp cls_sizeps pctclsmin m_educp || clsrm_id: inc1rr inc2rr inc3rr, ]

        Multiple-imputation estimates Imputations = 20
        Mixed-effects ML regression Number of obs = 2,966

        Group variable: clsrm_id Number of groups = 709
        Obs per group:
        min = 1
        avg = 4.2
        max = 7
        Average RVI = .
        Largest FMI = .
        DF adjustment: Large sample DF: min = 38.26
        avg = .
        max = .
        Model F test: Equal FMI F( 32,18729.7) = 110.05
        Prob > F = 0.0000

        ------------------------------------------------------------------------------
        mathps | Coef. Std. Err. t P>|t| [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        inc1rr | -.0530004 .0401743 -1.32 0.187 -.131856 .0258551
        inc2rr | .0667139 .0173792 3.84 0.000 .0326412 .1007866
        inc3rr | -.0416121 .0482051 -0.86 0.388 -.1361218 .0528975
        mathpf_c | .6662194 .0144671 46.05 0.000 .6378476 .6945912
        childinc2003 | .0059649 .0071959 0.83 0.407 -.0081569 .0200868
        amsntdayp | .0023997 .0003955 6.07 0.000 .0015993 .0032
        asmtageps | .2434826 .0378597 6.43 0.000 .1692192 .3177461
        spasmt | -.0689297 .0446584 -1.54 0.123 -.156586 .0187266
        chhsun18p | .0111803 .0098376 1.14 0.256 -.0081289 .0304895
        boyp | -.0638691 .0222449 -2.87 0.004 -.1075606 -.0201776
        ilat | .0150089 .0434745 0.35 0.730 -.070253 .1002708
        iafam | -.042079 .0423963 -0.99 0.321 -.125216 .0410581
        iother | .0222246 .040008 0.56 0.579 -.056372 .1008212
        singlepar | -.0320791 .0256517 -1.25 0.211 -.0824243 .018266
        imomhs | .0086441 .0314177 0.28 0.783 -.0530116 .0702998
        imombs | .0424633 .0462321 0.92 0.359 -.0482172 .1331438
        state2 | -.1945853 .0732466 -2.66 0.008 -.3382896 -.0508809
        state3 | -.1835007 .0763917 -2.40 0.016 -.3332595 -.0337419
        state4 | -.0753666 .0773311 -0.97 0.330 -.2271497 .0764164
        state5 | -.102646 .0747843 -1.37 0.170 -.2494485 .0441564
        state6 | -.1052675 .0740378 -1.42 0.156 -.2506203 .0400852
        state10 | -.1320691 .0680352 -1.94 0.052 -.2655104 .0013721
        state11 | -.1722473 .073134 -2.36 0.019 -.3158461 -.0286486
        state12 | -.0091994 .0637581 -0.14 0.885 -.1342887 .11589
        state13 | -.1193681 .0649926 -1.84 0.067 -.2470189 .0082828
        state14 | -.0007856 .0664576 -0.01 0.991 -.1311656 .1295944
        fulldaypnew | .0221399 .0308138 0.72 0.473 -.0383576 .0826375
        teachba | .0569217 .0311389 1.83 0.068 -.0041664 .1180098
        exptotp | -.0007649 .0013629 -0.56 0.575 -.0034439 .0019142
        cls_sizeps | .0030649 .0024391 1.26 0.209 -.0017266 .0078564
        pctclsmin | .01728 .0572971 0.30 0.763 -.0950916 .1296516
        m_educp | .007553 .015224 0.50 0.620 -.0222933 .0373993
        _cons | -1.702252 .2832499 -6.01 0.000 -2.25836 -1.146144
        ------------------------------------------------------------------------------

        ------------------------------------------------------------------------------
        Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
        -----------------------------+------------------------------------------------
        clsrm_id: Independent |
        sd(inc1rr) | .0443541 . . .
        sd(inc2rr) | .0368465 . . .
        sd(inc3rr) | 7.07e-09 . . .
        sd(_cons) | 8.54e-07 . . .
        -----------------------------+------------------------------------------------
        sd(Residual) | .5373729 . . .
        ------------------------------------------------------------------------------
        ]

        Comment


        • #5
          Portia:
          unfortunately, you did not follow Clyde's wise suggestion about posting via CODE delimiters (please, spend some minutes of your time reading the FAQ: the payback is valuable, believe me); hence, your Stata output is hardly readable.
          That said, it may well be that you have some constant somewhere in your data: I would cross-check them to see whether or not this may be the cause of your problem.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            Carlo is right, your output shows up very jumbled because you did not use a code block as requested. That said, the random-effects parameters part of the output is not so cluttered and can be read. The first thing I notice is that the estimated random slope for inc3rr sd estimate is 7.07e-09, which means the variance estimate is in the ballpark of 5e-17. So it appears you are asking Stata to estimate a variance component that is extremely close to zero. Such estimations often go badly. I would eliminate the random slope for inc3rr from the model and run it again. That may improve everything. Your random intercept standard deviation is also quite small; removing the random slope for inc3rr may change that and get you a better estimate. But if it doesn't, then removing the random intercept from the model would be the next step.

            As an aside, if you are using the current version of Stata (14.1), the command -xtmixed- has been renamed -mixed-. (But that is not, in any case, the cause of the problems you are asking about.)

            Comment


            • #7
              Dear Clyde, Can we remove just one covariance combination from a model's random effects specification and not the variable that will remove all the variances and covariances that include this variable? For instance, in the case, you mention here, variable inc3rr?

              Comment


              • #8
                I don't understand what you are asking. Perhaps show the specific command you are thinking about, both with and without the potential removal.

                Comment


                • #9
                  this is a command i have in mind :

                  mixed ytot2 d1 d2 d3 d1time d2time d3time d1time_sq d2time_sq d3time_sq d1all d2all d3all d1timeall d2timeall d3timeall,nocons || country: d1 d2 d3 d1time d2time d3time, nocons covariance(independent)|| firm: d1 d2 d3 d1time d2time d3time, nocons covariance(unstructured) reml residuals(independent, by(dall)) toleranc(1e-5) difficult technique(nr) nonrtolerance

                  and delivers these results:
                  Click image for larger version

Name:	_2024-02-07_222159774.png
Views:	1
Size:	49.7 KB
ID:	1742455




                  If i remove for instance the random effects of d1 variable at firm level, then I will lose all the covariance combinations with d1 in my random effects table. Is there a way, for instance, to ask Stata not to estimate just the cov(d1,d2time) in my random effects table, because it may be very small, and in this way, i will avoid not getting the standard errors for all the variances and covariances of my model?
                  Last edited by Thomas ALexopoulos; 07 Feb 2024, 14:35.

                  Comment


                  • #10
                    I'm not aware of any way to do what you are asking to do here.

                    I also don't grasp why you want to do it. You talk about avoiding not getting standard errors for all the variances and covariances of your model. But you do get variance and covariance estimates for all of them. And there is nothing odd looking about the results for cov(d1, d2time). So what is the issue? What am I missing here?

                    Comment


                    • #11
                      If it try to run the same command having unstructured covariance at country level, stata brings no s.e. for all the covariances. I suspect due to a covariance value that is very small. My thought is if there is a specification in stata to skip estimating this variance that potentially causes the problem.

                      Comment


                      • #12
                        My thought is if there is a specification in stata to skip estimating this variance that potentially causes the problem.
                        As far as I know, there is no way to do that in Stata.

                        Comment


                        • #13
                          Thank you

                          Comment

                          Working...
                          X