Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: programming help---adjust standard error with -cluster- option by two dimensions


From   gjhxmu@sina.com
To   statalist<statalist@hsphsun2.harvard.edu>
Subject   st: programming help---adjust standard error with -cluster- option by two dimensions
Date   Thu, 17 Sep 2009 17:18:59 +0800

I  posted "how to adjust standard error with -cluster- option by two dimensions" about two months ago.

And I got some help and valuable websites, one of which is 
http://www.kellogg.northwestern.edu/faculty/petersen/htm/papers/se/se_programming.htm.

In this website, professor Petersen gives logit2 and probit2 programmes for adjusting standard error with -cluster- option by two dimensions for logit model  and probit model. Using the data test_data in the website, I can run the following commands and the results are 

. u test_data,clear

. su y

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
           y |      5000    .0352381    2.252704  -7.843253    8.63729

. g y2=(y> r(mean))

. logit2 y2 x, fcluster( firmid) tcluster( year)
 
Logit with 2D clustered SEs
                                                      Number of obs =    5000
Number of clusters (firmid) =   500                   Wald chi2(  1) = 567.60
Number of clusters (year) =      10                   Prob > chi2   =  0.0000
Log pseudolikelihood = -3.128e+03                     Pseudo R2     =  0.0975
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           x |   .8208494   .0482432    17.01   0.000     .7262944    .9154043
       _cons |   .0111906   .0590119     0.19   0.850    -.1044706    .1268518
------------------------------------------------------------------------------
 
     SE clustered by firmid and year
 

. probit2 y2 x, fcluster( firmid) tcluster( year)
 
Probit with 2D clustered SEs                           Number of obs =    5000
                                                       F(  1,     .) =       .
                                                       Prob > F      =       .
Number of clusters (firmid) =   500                    R-squared     =       .
Number of clusters (year) =      10                    Root MSE      =       .
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           x |   .5015938   .0281373    17.83   0.000     .4464458    .5567419
       _cons |   .0071914   .0356859     0.20   0.840    -.0627516    .0771345
------------------------------------------------------------------------------
 
     SE clustered by firmid and year


I am confused by the equation statistic, which is Wald chi2 for logit2 but missing F vaule for probit2. And  then I type -eret li- , no matter logit2 or probit2, the related equation staistics are missing.

I have emailed professor Petersen before and he told me he was not a good programmer though he sincerely wanted to help me. 


Could anyone help me correct the programme if you know how to do it? 


Best regards,

Rose.

 

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index