Announcement

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

  • lnvar after suset with reg

    Hello everyone,

    I am trying to understand -lnvar- in the output of -suest- with -reg-.

    The following is an example from the manual:
    Code:
    . use https://www.stata-press.com/data/r18/income
    
    . regress inc edu exp male
    
          Source |       SS           df       MS      Number of obs   =       277
    -------------+----------------------------------   F(3, 273)       =     42.34
           Model |  2058.44672         3  686.148908   Prob > F        =    0.0000
        Residual |  4424.05183       273  16.2053181   R-squared       =    0.3175
    -------------+----------------------------------   Adj R-squared   =    0.3100
           Total |  6482.49855       276  23.4873136   Root MSE        =    4.0256
    
    ------------------------------------------------------------------------------
             inc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             edu |   2.213707    .243247     9.10   0.000     1.734828    2.692585
             exp |    1.47293    .231044     6.38   0.000     1.018076    1.927785
            male |   .5381153   .4949466     1.09   0.278     -.436282    1.512513
           _cons |   1.255497   .3115808     4.03   0.000      .642091    1.868904
    ------------------------------------------------------------------------------
    
    . est store Inc
    
    . probit promo edu exp male, nolog
    
    Probit regression                                       Number of obs =    277
                                                            LR chi2(3)    =  49.76
                                                            Prob > chi2   = 0.0000
    Log likelihood = -158.43888                             Pseudo R2     = 0.1357
    
    ------------------------------------------------------------------------------
           promo | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             edu |   .4593002   .0898537     5.11   0.000     .2831901    .6354102
             exp |   .3593023   .0805774     4.46   0.000     .2013735    .5172312
            male |   .2079983   .1656413     1.26   0.209    -.1166527    .5326494
           _cons |   -.464622   .1088166    -4.27   0.000    -.6778985   -.2513454
    ------------------------------------------------------------------------------
    
    . est store Promo
    
    . suest Inc Promo, vce(cluster famid)
    
    Simultaneous results for Inc, Promo                        Number of obs = 277
    
                                    (Std. err. adjusted for 135 clusters in famid)
    ------------------------------------------------------------------------------
                 |               Robust
                 | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
    Inc_mean     |
             edu |   2.213707   .2483907     8.91   0.000      1.72687    2.700543
             exp |    1.47293   .1890583     7.79   0.000     1.102383    1.843478
            male |   .5381153   .4979227     1.08   0.280    -.4377952    1.514026
           _cons |   1.255497   .3374977     3.72   0.000      .594014    1.916981
    -------------+----------------------------------------------------------------
    Inc_lnvar    |
           _cons |   2.785339    .079597    34.99   0.000     2.629332    2.941347
    -------------+----------------------------------------------------------------
    Promo_promo  |
             edu |   .4593002   .0886982     5.18   0.000     .2854549    .6331454
             exp |   .3593023    .079772     4.50   0.000     .2029522    .5156525
            male |   .2079983   .1691053     1.23   0.219    -.1234419    .5394386
           _cons |   -.464622   .1042169    -4.46   0.000    -.6688833   -.2603607
    ------------------------------------------------------------------------------
    From the help file:
    regress does not include its ancillary parameter, the residual variance, in its coefficient vector and (co)variance matrix. Moreover, while the score option is allowed with predict after regress, a score variable is generated for the mean but not for the variance parameter. suest contains special code that assigns the equation name mean to the coefficients for the mean, adds the equation lnvar for the log variance, and computes the appropriate score variables.
    Does it mean lnvar is the residual variance?
    I understand lnvar is not important when comparing coefficients across models, but I am just wondering what lnvar means, and whether it is useful in some way.

    Thanks.

  • #2
    Originally posted by Jasmine Xu View Post
    Does it mean lnvar is the residual variance?
    Not quite; it means that it's the natural logarithm of the residual variance.

    . . . I am just wondering what lnvar means, and whether it is useful in some way.
    Well, for example, when both models are linear regression, you can examine it for evidence of heteroscedasiticity, either just eyeballing it or with a formal test (a Wald test). Run the code below to see it in action for this purpose, along with a couple of alternatives that use a slightly different test statistic (a likelihood-ratio test instead of a Wald test), but allow a similar conclusion to be drawn.
    Code:
    version 18.0
    
    clear *
    
    quietly sysuse auto
    
    // Use in examining residual variance
    quietly regress headroom if !foreign
    estimates store Domestic
    quietly regress headroom if foreign
    estimates store Foreign
    
    suest Domestic Foreign
    * Wald test of equality of residual variance for headroom between foreign and domestic manufacturers
    test [Domestic_lnvar]_cons = [Foreign_lnvar]_cons
    
    // Alternative #1 (examine the LR test in the footnote)
    hetreg headroom i.foreign, het(i.foreign) nolog
    
    // Alternative #2 (same:  examine the LR test in the footnote)
    mixed headroom i.foreign, residuals(independent, by(foreign)) nolog
    
    exit
    I guess that it's accepted that logarithmic transformation renders the distribution of the residual variance symmetric enough to report standard errors, confidence bounds and Wald test statistics.

    Comment

    Working...
    X