Announcement

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

  • Using nlcom on random effects from mixed model

    I am running a mixed model to calculate an ICC and have managed to save the random effects and their standard errors. The code below can obtain the ICC. However I would like to obtain 95% CI for the ICC and I suspect nlcom can do this? However I do not have the usual beta coefficients from a regression model but rather the estimate and se stored as scalars. Any advice? Note that I'm also running more complex models and so the usual ICC commands are not suitable.


    * Run model
    mixed y || _all:R.examiner || subject:, reml

    * To select var comp for examiner
    _diparm lns1_1_1, f(exp(2*@)) d(2*exp(2*@))
    scalar r_examiner = r(est)

    * To select var comp for subject
    _diparm lns2_1_1, f(exp(2*@)) d(2*exp(2*@))
    scalar r_subj = r(est)

    * To select var comp for error
    _diparm lnsig_e, f(exp(2*@)) d(2*exp(2*@))
    scalar r_error = r(est)

    * Calculate ICC
    scalar icc1 = r_subj/(r_subj+r_examiner+r_error)
    display icc1

  • #2
    -nlcom- requires the use of the various coefficients in _b. You can get the names by running -matrix list e(b)-: the variance components (or, more exactly, the logarithms of the standard deviations, will be at the end of the output.) -nlcom- will not have any information about variance of the scalars you generated, so it will not be able to calculate any confidence intervals from them. So at the lowest level the ICC (subject level) might be something like:

    Code:
    nlcom exp(2*_b[lns2_1_1:_cons])/(exp(2*_b[lns2_1_1:cons]) + exp(2*_b[lnsig_e:_cons]))

    Comment


    • #3
      Excellent - thank you. The final command I used was:
      Code:
      nlcom exp( 2*_b[lns2_1_1:_cons] ) / (exp(2*_b[lns2_1_1:_cons]) + exp(2*_b[lns1_1_1:_cons]) + exp(2*_b[lnsig_e:_cons]) )
      Last edited by Rachel Sore; 19 Apr 2016, 23:01.

      Comment

      Working...
      X