Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Identify 1st observation in each group in a panel data model


From   Dahlia El-Hawary <[email protected]>
To   [email protected]
Subject   st: Identify 1st observation in each group in a panel data model
Date   Mon, 11 Apr 2005 16:59:13 -0400

Hi,
I would very much appreciate your help with the following qusetion. 

I am working with an unbalanced annual panel data of over 50,000 
observations. The data set is made up of firms within countries over a 
time period from 1987 - 2002. I generated a variable called “code” as 
my panel identifier which assigns each firm a number. I also have 
a “countryid” giving each country a number. Year is the variable I am 
using for time. 

I would like to know how to identify the first observation of 
variable “X” for each firm in the panel ?. Specifically I would like 
to generate a dummy variable (DV==1) if the value of the first 
observation for variable X (for each firm) is less than “a”, and DV==0 
otherwise.

Thank you in advance,

Dahlia El-Hawary
PhD Candidate
Economics Department
George Wshington University


*
*   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