Announcement

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

  • Standard error for rho - xtreg, mle

    Calculating rho by hand after xtreg, mle would be - if not already outputted anyway:
    rho = (sigma_u)^2/[(sigma_u)^2 + (sigma_e)^2]
    I can get the SE's for sigma_u and sigma_e by the output from e(V) - but how to I calculate the SE for rho from these values - it is outputted, by I need to store the values for bootstrapping thereafter?
    Cheers and thanks!

  • #2
    Many ways to do this. Easiest is probably:

    Code:
    . webuse nlswork, clear
    (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
    
    .  xtset idcode
           panel variable:  idcode (unbalanced)
    
    . qui xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race not_smsa south, mle
    
    . dis el(r(table), 2,14)
    .00748276
    see this thread for elaboration of r(table)

    https://www.statalist.org/forums/for...-it-documented

    Another way would be to use the formula that you used plus -nlcom- like this:

    Code:
    . nlcom (/sigma_u)^2/[(/sigma_u)^2 + (/sigma_e)^2]
    
           _nl_1:  (/sigma_u)^2/[(/sigma_u)^2 + (/sigma_e)^2]
    
    ------------------------------------------------------------------------------
         ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _nl_1 |   .4204033   .0074828    56.18   0.000     .4057374    .4350693
    ------------------------------------------------------------------------------

    Comment


    • #3
      display el(r(table),,) -> now that's a real Stata'y geek thing :---)
      Would never have found it without your help! Thanks and cheers!
      PS nlcom throws an "could not calculate numerical derivative" error...

      Comment


      • #4
        You are welcome ! Of course first check in which position the standard error of tau is hiding by estimating the model, and then typing:

        Code:
        matlist r(table)
        in my illustrative model it was hiding in position second row, 14 column of the table. In your model it will be in the second row (because this is where the standard errors are) but in some other column, probably the last column too, but it will not be column 14.

        I do not know why -nlcom- might be complaining, you might again eyeball what is in the place of sigma_u and sigma_e by typing
        Code:
        matlist e(b)
        and then check what is in the lower right triangle of e(V) containing their variances and covariance by typing

        Code:
        matlist e(V)
        But if there are no missing values in the estimates and their variance, I do not know why -nlcom- might be complaining.

        Originally posted by Stefan Kreisel View Post
        display el(r(table),,) -> now that's a real Stata'y geek thing :---)
        Would never have found it without your help! Thanks and cheers!
        PS nlcom throws an "could not calculate numerical derivative" error...

        Comment

        Working...
        X