Announcement

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

  • manipulating stored results: random variance standard error and lower & upper bounds from r(table)? (mixed procedure)

    Hello,
    I use Stata version 16 on Windows 10. I'm running models using the mixed procedure, and then trying to work with elements from the r(table) stored results. My outcome is scores, and my predictor is timepoint (I have data from three time points on students nested within classes). The original output table shows estimated variance and standard error of the random variance, but the r(table) results are transformed. I know I need to exponentiate and square the first row of r(table) results to obtain the random variance estimate in the form it appears in the main Stata output. What I can't figure out is how to transform the second row of the r(table) output to obtain the standard error of the random variance estimate in the form it appears in the main Stata output, or the 5th and 6th rows to obtain the confidence bounds for the variance estimate in the form it appears in the main Stata output for the model. Can someone please educate me? Below is some code, with comments showing what works and what does not.

    Code:
    mixed scores i.timepoint || class: || student:  
    matrix define rtable = r(table)  // r(table) is a 9 x 7 matrix (columns 5,6,7 are random effects, and row 2 is standard errors)
    matlist r(table)
    matrix define rtable = r(table)
    display exp(2*rtable[1,5])   // this correctly displays the random intercept variance estimate for class
    * the above estimate can also be shown as .display exp(2*_b[lns1_1_1:_cons]
    display exp(2*rtable[2,5])   // this line does NOT give the estimated standard error corresponding to the random class intercept
    display exp(2*rtable[5,5])   // this line does NOT give the estimated lower confidence bound corresponding to the random class intercept
    display exp(2*rtable[6,5])   // this line does NOT give the estimated upper confidence bound corresponding to the random class intercept
    Can someone please tell me how to use the r(table) results to obtain the values of random variance standard error, and lower and upper confidence bounds for the random variance estimates, from a mixed model (in the form in which they appear in the main model output)? I'm sorry if this should be obvious--and I tried to search for this but was having no luck (if you want to educate me about search terms that would have helped here, I welcome that feedback as well!).

Working...
X