Announcement

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

  • Large standard errors on random effects following mixed

    Hi all,

    I'm looking use a linear mixed model to analyze longitudinal changes in parental anxiety during the course of their child's oral immunotherapy. At it's most simple, the model has 3 variables. My DV total_impact measures parental anxiety continuously. I also have a discrete time variable (4 time points): con_time and a subject variable called id.

    When I run the model with just random intercepts the output looks unremarkable: anxiety goes down over time and the baseline level of anxiety varies to some degree. However, if I include a random slope component to the model, the results look a little more bizarre, particularly when I specificy an unstructured covariance stucture. In particular, the standard errors on some of the random effects seem unusually large. See below

    Code:
    xtmixed total_impact i.con_time, reml||id:i.con_time, cov(un)
    Performing EM optimization:
    
    Performing gradient-based optimization:
    
    Iteration 0:  Log restricted-likelihood = -2246.5011  (not concave)
    Iteration 1:  Log restricted-likelihood = -2243.7042  (not concave)
    Iteration 2:  Log restricted-likelihood = -2243.1187  
    Iteration 3:  Log restricted-likelihood = -2242.8357  
    Iteration 4:  Log restricted-likelihood = -2242.7075  
    Iteration 5:  Log restricted-likelihood = -2242.7061  
    Iteration 6:  Log restricted-likelihood = -2242.7061  
    
    Computing standard errors:
    
    Mixed-effects REML regression                        Number of obs    =    505
    Group variable: id                                   Number of groups =    333
                                                         Obs per group:
                                                                      min =      1
                                                                      avg =    1.5
                                                                      max =      4
                                                         Wald chi2(3)     = 100.57
    Log restricted-likelihood = -2242.7061               Prob > chi2      = 0.0000
    
    ------------------------------------------------------------------------------
    total_impact | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        con_time |
              2  |  -16.48735   1.903727    -8.66   0.000    -20.21859   -12.75611
              3  |  -20.92988   2.450287    -8.54   0.000    -25.73235    -16.1274
              4  |   -20.9626   2.711521    -7.73   0.000    -26.27708   -15.64812
                 |
           _cons |    73.2775   1.882855    38.92   0.000     69.58717    76.96783
    ------------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------
      Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
    -----------------------------+------------------------------------------------
    id: Unstructured             |
                  sd(2.con_time) |   19.91303    111.885      .0003285     1207166
                  sd(3.con_time) |   25.14283   88.64329      .0250857    25200.06
                  sd(4.con_time) |   24.53929   90.87722      .0172814    34845.47
                       sd(_cons) |   25.88462   43.05445      .9936193    674.3164
     corr(2.con_time,3.con_time) |   .9040906    3.81578            -1           1
     corr(2.con_time,4.con_time) |   .7601554   2.526025            -1           1
          corr(2.con_time,_cons) |  -.6110516   .1409119     -.8182008   -.2634813
     corr(3.con_time,4.con_time) |    .650417   1.095818     -.9944983    .9997525
          corr(3.con_time,_cons) |  -.7728544   .5873255     -.9991575    .9499431
          corr(4.con_time,_cons) |  -.7283099   .4030614     -.9891898    .6394607
    -----------------------------+------------------------------------------------
                    sd(Residual) |   6.716628   165.8342      6.47e-21    6.97e+21
    ------------------------------------------------------------------------------
    LR test vs. linear model: chi2(10) = 92.75                Prob > chi2 = 0.0000
    When I use the default covariance structure, however, the standard errors appear to be so small as to not be visible in the output.

    Code:
    xtmixed total_impact i.con_time, reml||id:i.con_time
    Performing EM optimization:
    
    Performing gradient-based optimization:
    
    Iteration 0:  Log restricted-likelihood = -2307.5562  (not concave)
    Iteration 1:  Log restricted-likelihood =  -2271.955  
    Iteration 2:  Log restricted-likelihood = -2262.1338  
    Iteration 3:  Log restricted-likelihood = -2260.2227  
    Iteration 4:  Log restricted-likelihood = -2260.1745  
    Iteration 5:  Log restricted-likelihood = -2260.1743  
    
    Computing standard errors:
    
    Mixed-effects REML regression                        Number of obs    =    505
    Group variable: id                                   Number of groups =    333
                                                         Obs per group:
                                                                      min =      1
                                                                      avg =    1.5
                                                                      max =      4
                                                         Wald chi2(3)     = 123.22
    Log restricted-likelihood = -2260.1743               Prob > chi2      = 0.0000
    
    ------------------------------------------------------------------------------
    total_impact | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        con_time |
              2  |  -17.17941   1.897695    -9.05   0.000    -20.89883      -13.46
              3  |  -20.02102    2.57513    -7.77   0.000    -25.06819   -14.97386
              4  |   -20.6856   2.704244    -7.65   0.000    -25.98582   -15.38538
                 |
           _cons |   73.51702   1.617422    45.45   0.000     70.34693    76.68711
    ------------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------
      Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
    -----------------------------+------------------------------------------------
    id: Independent              |
                  sd(2.con_time) |   .0000629          .             .           .
                  sd(3.con_time) |   .0000223          .             .           .
                  sd(4.con_time) |   .0002007          .             .           .
                       sd(_cons) |    17.0865          .             .           .
    -----------------------------+------------------------------------------------
                    sd(Residual) |   15.52083          .             .           .
    ------------------------------------------------------------------------------
    LR test vs. linear model: chi2(4) = 57.81                 Prob > chi2 = 0.0000
    I'm new to linear mixed models, so I would be very grateful if anyone can offer some insight into why the standard errors are so large in one model and very small in the other.

    thanks,
    -Mike
    Last edited by Mike Golding; 17 Nov 2023, 14:56.

  • #2
    the number of observations per group is too small for a precise result, esp. given the large number (relative to the data) of random effects; my advice, other than obtaining more data, is to have fewer random effects

    Comment


    • #3
      Ok that makes sense. Thanks Rich.

      Comment

      Working...
      X