Bookmark and Share

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, is already up and running.

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

st: Generating variable in panel dataset

From   Shikha Sinha <>
Subject   st: Generating variable in panel dataset
Date   Tue, 28 Dec 2010 18:57:47 -0500

Dear all,

I have a county level panel data for two years: 2002 and 2008. I want
to create a binary variable "low" which categorizes counties by median
value of variable stroke in 2002. For example.

County   Year           Avg stroke    Low
A           2002            0.12              1
B           2002            0.17              1
C           2002            0.20               1
D           2002            0.24               0
E           2002            0.28               0
A           2008           0.10
B           2008           0.11
C           2008           0.34
D           2008           0.45
E           2008           0.23

In year 2002, the median value of stroke is 0.20, and I have coded
counties with avg stroke <= median stroke as low. so, A, B, C are
low=1 and D.E are low=0.
Now I want to code A,B, C in 2008  as low=1 and D,E as low=0. I do not
want to consider abg stroke in these counties in 2008. Is there a
simple way to complete the column "low"?
Hope my query is clear.

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index