I have Panel data ranging over 8 time periods (quarters).
For each individual, there are 4 quarters worth of data for each variable.
Array
Each variable is written like so: AGE1, AGE2, AGE3, AGE4, AGE5, AGE6, AGE7, AGE8.
Instead, I would like to have just one AGE variable, but a separate column for QUARTER where I specify quarters 1-8. How can I do this? On excel or stata is fine.
My aim is to create a dummy variable for pre/post 1st April 2016. So I want to be able to tell stata that Q1-4 = 0 and Q5-8 = 1.
(My data is the one with PERSID at the top left, taken from LFS. The other image is from an example dataset which I want to imitate.)Array Array
Related Posts with Reorganising panel data
In logistic, binary response variable works but if it has 3 categories then it doesn't work!I'm using a logistic reg for my survey data. In the main control variable, it has 3 categories. The …
float to string format error results in wrong values -- why?I need to create the fipscode for census tracts that were formatted incorrectly. The error occurs w…
Inquire about keeping variables temporarilyLet me state my question clearly. I currently have a dataset which has so many variables. (since thi…
Combining observations within the same datasetHello all, So I have an individual level dataset, in which the household id (hhid) is not unique, h…
xtpmg works in Stata 13/14 but not in 15/16?Dear All, I use (ssc install) xtpmg to estimate the following model. Code: * Example generated by -…
Subscribe to:
Post Comments (Atom)
0 Response to Reorganising panel data
Post a Comment