Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: balanced sub-panel to test for selection bias

From   Kit Baum <>
Subject   st: RE: balanced sub-panel to test for selection bias
Date   Wed, 23 May 2007 09:52:45 -0400

sacrificial toaster oven

Olga wrote

I have unbalanced panel data (unequal time series for
observations, but no
missing observations)
Dataset contains variables on farms from 1980 to 1996.
Not all years are
present for each farm.
I would like to test it for selection bias by means of
Hausman test.
Therefore if I understand correctly I have to obtain
two models: balanced
and unbalanced.

My question is how can I obtain balanced sub-panel in
this situation?

egen nfarm = count(farm),by(year)
summarize nfarm, meanonly
by year: keep if nfarm == `r(max)'

Kit Baum, Boston College Economics and DIW Berlin
An Introduction to Modern Econometrics Using Stata:

*   For searches and help try:

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