Hi all,
I'm not familiar of the command -reshape-. So I was wondering if anyone
could help me with an example of how to use -reshape- command.
The data set I'm working on looks like this(w means wage)
------------------------------------------------------------------------
-
id age80 age81 age82 age93 age84 w80 w81 w82 w83 w84
1 18 19 20 21 22 10 11 13 14 14.2
2 19 20 21 22 23 15 16 16 14 15
3 17 18 19 20 21 9 9 10 11
11.4
---------------------------------------------------------------------
When I reshape the data set, I want to limit the age to the range
[19,20].
In order to use fixed effects and random effects models to analyze, I
want to reshape the data into:
---------------------------------------------------------------------
id age w year
1 19 11 81
1 20 13 82
2 19 15 80
2 20 16 81
3 19 10 82
3 20 11 83
---------------------------------------------------------------------
What I tried is as follows:
.reshape long age w ,i(id) j(year)
.drop if age~=19 | age~20
.sort id age
My question is, is there any better way to do this? I'm not sure if
what I did is OK, although I havn't found any weired thing in the
result now.
Thanks in advance!
Mandy Jia
*
* 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/