Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

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

From |
Nick Cox <n.j.cox@durham.ac.uk> |

To |
"'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: panel data regression - number of observations |

Date |
Fri, 22 Jun 2012 13:00:06 +0100 |

I'll pass on #2. The answer to #1 is No. This is easy enough to check. For example, from this code webuse grunfeld xtset d xtreg invest year drop if year < 1940 & company == 1 xtreg invest year you will see that -xtreg- uses what it can, including incomplete panels. Indeed incompleteness is, roughly speaking, like beauty, in the mind of the beholder, and not something Stata generally knows or cares about. You can certainly insist on using what you regard as complete panels. Your syntax will work if and only if a variable called -time- has the value 124 for only those observations you want to include. You can do something like this xtreg y x1 x2 x3 egen count = total(e(sample)), by(company) xtreg y x1 x2 x3 if count == 120 or 124 if you prefer. Nick n.j.cox@durham.ac.uk Braunfels, Philipp I have a large panel dataset, covering 10 years of monthly data. One of my variables is stock return for which I have approximately 3000 companies. However, the return observations are not complete for all 3000 companies (some just have 2 or 5 years of data e.g.). In this respect I would have two questions: 1) if I run a panel-regression, does stata automatically exclude all companies for which the return data are not complete? (e.g. I regress years 1990-2000 and for 500 companies the data from 1990-1993 are missing. Are these companies completely excluded from the analysis?) If stata does not exclude observations (companies) with an insufficient number of values (returns over time) how can I account for this (maybe using sth. <xtreg y x1 x2 x3 if time==124, fe> - where 124 are monthly observations for the 10 years I cover? 2) The hausman test predicts that I should use FE. The output gives me three values for R-square (between, within, overall). But when I use the command <estimates table output, stats(r2)> I am given a different R-square than those reported in the <xtreg,fe> output. So where does the <estimates table output, stats(r2)> come from (I also run an <areg> regression and this R-square differs as well!) * * 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/

**Follow-Ups**:**st: AW: RE: panel data regression - number of observations***From:*"Braunfels, Philipp (Stud. SBE / Alumni)" <P.Braunfels@student.maastrichtuniversity.nl>

**References**:**st: panel data regression - number of observations***From:*"Braunfels, Philipp (Stud. SBE / Alumni)" <P.Braunfels@student.maastrichtuniversity.nl>

- Prev by Date:
**Re: st: FW: equivalent SAS PRINQUAL procedure in Stata** - Next by Date:
**Re: st: how to set colors in a .scheme file using -colorstyle- syntax** - Previous by thread:
**st: panel data regression - number of observations** - Next by thread:
**st: AW: RE: panel data regression - number of observations** - Index(es):