Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Re: Report number of groups for first-difference regression


From   Ryan Turner <[email protected]>
To   [email protected]
Subject   st: Re: Report number of groups for first-difference regression
Date   Thu, 3 May 2012 23:00:36 -0400

Dear Statalist,

To answer my own question, I must confess: I was actually running xtreg s.y s.x (xtreg defaults to random effects, which was not my intention).  I corrected this mistake as noted in my first email, and also tried clustered standard errors because my t-stats are very good (In Mostly Harmless Econometrics p. 8 (Angrist & Pischke), they give a warning along these lines).

Well, when I switched from -xtreg s.y s.x Z, robust- to -reg s.y s.x Z, cluster(id)- I got identical results (for everything but the dummy variables, which have low t-stats), a big surprise to me!  Using clustered standard errors also allowed me to specify N_clust in place of N_g, resolving my original request.

So my two mistakes canceled each other out, go figure.  Any comments on what's going on here and why I get the same results for random effects and OLS with clustered errors?  I garnered some insight from this old post: http://www.stata.com/statalist/archive/2003-07/msg00415.html, but I am still curious.

Best,
Ryan

On May 3, 2012, at 5:34 PM, Ryan Turner wrote:

> Hi Statalist,
> 
> I have been working with panel data and mostly running xtreg, which reports the number of groups in addition to the number of observations.  I have come to rely on this number because my data set has large gaps for certain variables, and when I regress on those variables my N plummets.
> 
> I am trying to run the equivalent first-difference regressions, e.g. -reg s.y s.x-, which of course does not report groups because it is merely OLS on a field of points (whose values are determined by considering panel relationships (xtset)).
> 
> Is there any (easy) way to generate the number of groups being regressed on, and preferably report it in the regression output (or at least, generate it after the fact)?
> 
> Any hints appreciated.
> 
> Ryan

--
Ryan J. Turner <[email protected]>
Ph.D. Student in Engineering and Public Policy
Carnegie Mellon University





*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index