Statalist The Stata Listserver


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

st: RE: Retain only one observation for each id in an unbalanced panel


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Retain only one observation for each id in an unbalanced panel
Date   Mon, 6 Feb 2006 15:31:02 -0000

bysort firmid (year) : keep if _n == 1

Nick 
[email protected] 

ALICE DOBSON

> I use Stata 9.1. I have an unbalanced panel of firms [firmid] 
> over several 
> years [year] and want to consider only the first year for each id.
> 
> Basically, I need to convert the panel data into a 
> cross-sectional data to 
> test for an interaction effect.
> 
> Could anybody please help me?

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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