Announcement

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

  • Ordinal Multilevel Regression and Intra-class correlation

    Hello,

    I am having some troubles with an ordinal multilevel regression. I have two levels and I would like to calculate the intra class correlation. After running my model, I used the estat icc command, but stata says "requested action not valid after most recent estimation command". I tried it with Stata 14 and 13.

    I would calculate it by hand but in my output the individual-level variance is not reported. Did I understand it right that this is because it is fixed (I read something like this in a post about binary multilevel models)? Is there any way to claculate the ICC?

    I'd be greatful for any help!

    Best,
    Julia

  • #2
    I believe that the individual level variance is taken as 1 for ordered probit regression and as π2 / 3 for ordered logistic regression. You can calculate ICC using the coefficient for the higher-level variance, which is returned from the fitted model as _b[var(_cons[higher-level varname]):_cons] for a conventional two-level model—illustrated below with an ordered probit regression.

    .ÿversionÿ14.1

    .ÿ
    .ÿclearÿ*

    .ÿsetÿmoreÿoff

    .ÿsetÿseedÿ`=date("2015-12-09",ÿ"YMD")'

    .ÿquietlyÿsetÿobsÿ250

    .ÿ
    .ÿgenerateÿintÿpidÿ=ÿ_n

    .ÿ//ÿVarianceÿofÿ4ÿbelow,ÿsoÿICCÿshouldÿbeÿaboutÿ4ÿ/ÿ(1ÿ+ÿ4)ÿ=ÿ0.8
    .ÿgenerateÿdoubleÿuÿ=ÿ2ÿ*ÿrnormal()

    .ÿÿÿ
    .ÿforvaluesÿtimeÿ=ÿ1/5ÿ{
    ÿÿ2.ÿÿÿÿÿgenerateÿdoubleÿlatent`time'ÿ=ÿuÿ+ÿ(`time'ÿ-ÿ3)ÿ/ÿ5ÿ+ÿrnormal()
    ÿÿ3.ÿ}

    .ÿquietlyÿreshapeÿlongÿlatent,ÿi(pid)ÿj(time)

    .ÿgenerateÿbyteÿresponseÿ=ÿ1

    .ÿforvaluesÿcutÿ=ÿ1/4ÿ{
    ÿÿ2.ÿÿÿÿÿquietlyÿreplaceÿresponseÿ=ÿresponseÿ+ÿ1ÿifÿnormal(latent)ÿ>=ÿ`cut'ÿ/ÿ5
    ÿÿ3.ÿ}

    .ÿ
    .ÿmeoprobitÿresponseÿi.timeÿ||ÿpid:ÿ,ÿnolrtestÿnolog

    Mixed-effectsÿoprobitÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿ1,250
    Groupÿvariable:ÿÿÿÿÿÿÿÿÿÿÿÿÿpidÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿ250

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿObsÿperÿgroup:
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿÿ5
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿÿ5.0
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿÿ5

    Integrationÿmethod:ÿmvaghermiteÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿIntegrationÿpts.ÿÿ=ÿÿÿÿÿÿÿÿÿÿ7

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWaldÿchi2(4)ÿÿÿÿÿÿ=ÿÿÿÿÿÿ42.49
    Logÿlikelihoodÿ=ÿ-1331.6879ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.0000
    ------------------------------------------------------------------------------
    ÿÿÿÿresponseÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
    -------------+----------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿtimeÿ|
    ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿ.3668335ÿÿÿ.1230521ÿÿÿÿÿ2.98ÿÿÿ0.003ÿÿÿÿÿ.1256559ÿÿÿÿ.6080111
    ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿÿ.267361ÿÿÿ.1252109ÿÿÿÿÿ2.14ÿÿÿ0.033ÿÿÿÿÿ.0219521ÿÿÿÿ.5127699
    ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿ.7566463ÿÿÿ.1252324ÿÿÿÿÿ6.04ÿÿÿ0.000ÿÿÿÿÿ.5111953ÿÿÿÿ1.002097
    ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿ.5771019ÿÿÿ.1251265ÿÿÿÿÿ4.61ÿÿÿ0.000ÿÿÿÿÿ.3318584ÿÿÿÿ.8223454
    -------------+----------------------------------------------------------------
    ÿÿÿÿÿÿÿ/cut1ÿ|ÿÿ-.5359971ÿÿÿ.1623752ÿÿÿÿ-3.30ÿÿÿ0.001ÿÿÿÿ-.8542466ÿÿÿ-.2177476
    ÿÿÿÿÿÿÿ/cut2ÿ|ÿÿÿ.0139792ÿÿÿ.1622471ÿÿÿÿÿ0.09ÿÿÿ0.931ÿÿÿÿ-.3040192ÿÿÿÿ.3319776
    ÿÿÿÿÿÿÿ/cut3ÿ|ÿÿÿ.5194045ÿÿÿ.1630069ÿÿÿÿÿ3.19ÿÿÿ0.001ÿÿÿÿÿ.1999168ÿÿÿÿ.8388922
    ÿÿÿÿÿÿÿ/cut4ÿ|ÿÿÿ1.065167ÿÿÿ.1647476ÿÿÿÿÿ6.47ÿÿÿ0.000ÿÿÿÿÿ.7422681ÿÿÿÿ1.388067
    -------------+----------------------------------------------------------------
    pidÿÿÿÿÿÿÿÿÿÿ|
    ÿÿÿvar(_cons)|ÿÿÿ4.330932ÿÿÿ.6659711ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ3.203991ÿÿÿÿ5.854251
    ------------------------------------------------------------------------------

    .ÿ
    .ÿdisplayÿinÿsmclÿasÿtextÿ"ICCÿ=ÿ"ÿ///
    >ÿÿÿÿÿasÿresultÿ%04.2fÿ_b[var(_cons[pid]):_cons]ÿ/ÿ(1ÿ+ÿ_b[var(_cons[pid]):_cons])
    ICCÿ=ÿ0.81

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .


    Comment


    • #3
      Thank you!

      Comment

      Working...
      X