Dear Martin and other statalists,
After my strive, I found a way to get the F-value for probit2 and logit2 programms.
In fact, the F-value is equal to that of regression by one cluster named group which is
got from "egen group=group(firmid year)". And all R-squareds are the same, no matter
cluster by one dimensions or two dimensions or not.
Am I right?
PS: I just want to get the statistics for regression to report in my paper, not to let the
programme show results properly in the window of stata, which I think it is much more difficult.
Thank you very much for any help!
Best regards,
Rose.
----- Original Message -----
From: Martin Weiss <[email protected]>
To: <[email protected]>
Subject: AW: st: AW: programming help---adjust standard error with -cluster- option by two dimensions
Date: 2009-9-18 05:29:43
<>
" And I even do not know whether it is difficult or not to correct the two
programmings."
It is hard to say w/o significant investment of time and sweat, but I would
imagine it to be rather difficult to get them to behave the way you want
them to.
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von [email protected]
Gesendet: Donnerstag, 17. September 2009 17:19
An: statalist
Betreff: Re: st: AW: programming help---adjust standard error with -cluster-
option by two dimensions
Martin,
thank you very much for your quick reply and help.
I knew Baum's high quality book previously and I am learning programming
now.
However, it is difficult for a novice to correct the programming error.
And I even do not know whether it is difficult or not to correct the two
programmings.
If difficult, I feel embarrassed to trouble you.
If not, could you point out the concrete errors and corrections to me?
thank you for any help.
Best regards,
Rose.
----- Original Message -----
From: Martin Weiss <[email protected]>
To: <[email protected]>
Subject: st: AW: programming help---adjust standard error with -cluster-
option by two dimensions
Date: 2009-9-17 17:31:55
<>
Both -program-s try to obtain the F-statistic, for instance, from the last
-internal- call to -probit- or -logit-, respectively, even though neither
command saves them, so they become blanks in the final output... A -version-
statement does not seem to be in place, either, which probably causes
problems for users.
If you are serious about programming, I highly recommend Baum (2009),
http://www.stata-press.com/books/isp.html
HTH
Martin
-----Urspr黱gliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von [email protected]
Gesendet: Donnerstag, 17. September 2009 11:19
An: statalist
Betreff: st: programming help---adjust standard error with -cluster- option
by two dimensions
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_progra
mming.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/
*
* 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/
*
* 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/
*
* 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/
*
* 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/