Announcement

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

  • Xtreg output: standard error

    Dear Statalists,

    I have a basic question for which I can't find an anwer.

    I am using the Monte Carlo method to test my mediating effect after running multiple regressions.

    In order to run the test, I need the values "cov(a) and cov(b)", which represent the squared standard errors of my variable of interest.

    My question is do I use the standard error produced by the regression output or do I have to high square it first.

    I don't no if the standard error produced by Stata is originally a squared value or if I am suppose to calculate it manually.

    I hope someone can help me with this!!

    Kind Regards,
    Siham

  • #2
    I am using the Monte Carlo method to test my mediating effect after running multiple regressions.

    In order to run the test, I need the values "cov(a) and cov(b)", which represent the squared standard errors of my variable of interest.

    My question is do I use the standard error produced by the regression output or do I have to high square it first.
    I do not get the part that the variance is the covariance. In fact, if you refer to a covariance, it cannot be cov(a) but something like cov(a, b). The interesting case is cov(a, a) = var(a). In any case, here is how to get the variance of an estimated coefficient.

    Two ways: You can either square the standard error or pick the variance directly from the VCE matrix

    Code:
    webuse grunfeld, clear
    xtreg invest mvalue kstock, fe
    di (_se[mvalue])^2
    mat l e(V)
    di e(V)[1, 1]

    Res.:

    Code:
    .
    . xtreg invest mvalue kstock, fe
    
    Fixed-effects (within) regression               Number of obs     =        200
    Group variable: company                         Number of groups  =         10
    
    R-sq:                                           Obs per group:
         within  = 0.7668                                         min =         20
         between = 0.8194                                         avg =       20.0
         overall = 0.8060                                         max =         20
    
                                                    F(2,188)          =     309.01
    corr(u_i, Xb)  = -0.1517                        Prob > F          =     0.0000
    
    ------------------------------------------------------------------------------
          invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mvalue |   .1101238   .0118567     9.29   0.000     .0867345    .1335131
          kstock |   .3100653   .0173545    17.87   0.000     .2758308    .3442999
           _cons |  -58.74393   12.45369    -4.72   0.000    -83.31086     -34.177
    -------------+----------------------------------------------------------------
         sigma_u |  85.732501
         sigma_e |  52.767964
             rho |  .72525012   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(9, 188) = 49.18                     Prob > F = 0.0000
    
    .
    . di (_se[mvalue])^2
    .00014058
    
    .
    . mat l e(V)
    
    symmetric e(V)[3,3]
                mvalue      kstock       _cons
    mvalue   .00014058
    kstock  -.00007747   .00030118
     _cons  -.13068152   .00066516   155.09442
    
    .
    . di e(V)[1, 1]
    .00014058
    Last edited by Andrew Musau; 27 Nov 2019, 09:50.

    Comment

    Working...
    X