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: panel data cross referencing bewtween variables in different time
From
"MoZo" <[email protected]>
To
<[email protected]>
Subject
st: panel data cross referencing bewtween variables in different time
Date
Sat, 6 Mar 2010 13:24:41 -0500
I have a panel dataset which was set up as follow:
ID Year X1 X2 X3
111 1990 89 21 0
111 1991 29 53 0
111 1992 87 76 1
111 1993 87 98 1
111 1994 45 88 0
222 1990 98 88 0
222 1991 98 44 0
222 1992 45 71 0
.
.
.
.
999 1990 76 98 0
999 1991 54 43 0
999 1992 65 32 0
999 1993 65 87 1
999 1994 76 32 0
I want to do simple calculation referencing to one variable X3. For example,
sum X1 for ID (panel) if the panel's X3=1 in ANY year. I can't find a
command I can make reference to a variable that may occur any time. For
example, in this data sample, I want to all X1 for all ID whose X3 is 1 in
ANY year.
Thank you in advance.
Mike
*
* 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/