Announcement

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

  • Add ICC to mixed model summary statistics using -esttab-

    Hi there,

    Is it possible to add the intra-class correlation from a two-level mixed linear model to the summary statistics table produced by -esttab- such as in the example below? I'm not sure if scalars exist with which to perform the calculation.

    . webuse pig
    xtmixed weight week || id: week
    esttab, se wide nostar transform(ln*: exp(@) exp(@)) ///
    eqlabels("" "sd(week)" "sd(_cons)" "sd(Residual)", none) ///
    varlabels(,elist(weight:_cons "{break}{hline @width}")) ///
    varwidth(13)

    Thanks,

    Steve
    Last edited by Steve Thomas; 10 Dec 2017, 19:42.

  • #2
    Code:
    webuse pig
    xtmixed weight week || id: week
    estat icc
    estadd scalar icc2 = r(icc2) // Use 'return list' to check for other scalars from 'estaticc' you might want
    esttab, se wide nostar transform(ln*: exp(@) exp(@)) ///
        eqlabels("" "sd(week)" "sd(_cons)" "sd(Residual)", none) ///
        varlabels(,elist(weight:_cons "{break}{hline @width}")) ///
        varwidth(13) scalars(icc2)

    Comment

    Working...
    X