I have a panel data set with a large number of variables.
the variables are named hhid_06 age_06 age_12 etc
the identifier for individuals is Findid and the years are 06 and 12
I tried the below ( which was provided by @Clyde Schechter in another post) but smthg went wrong as indicated below. I think because of the zero in 06
ds Findid, not
local stubs `r(varlist)'
forvalues i = 06/12 {
local stubs: subinstr local stubs "`i'" "", all
}
local stubs: list uniq stubs
reshape long `stubs', i(Findid) j(year)
The message I got is:
(note: j = 6 12)
(note: hhid_6 not found)
(note: indid_6 not found)
(note: pn_6 not found)
(note: in_206 not found)
I think it is messed up because of the zero. how can I fix this?
Many thanks,
Maye
the variables are named hhid_06 age_06 age_12 etc
the identifier for individuals is Findid and the years are 06 and 12
I tried the below ( which was provided by @Clyde Schechter in another post) but smthg went wrong as indicated below. I think because of the zero in 06
ds Findid, not
local stubs `r(varlist)'
forvalues i = 06/12 {
local stubs: subinstr local stubs "`i'" "", all
}
local stubs: list uniq stubs
reshape long `stubs', i(Findid) j(year)
The message I got is:
(note: j = 6 12)
(note: hhid_6 not found)
(note: indid_6 not found)
(note: pn_6 not found)
(note: in_206 not found)
I think it is messed up because of the zero. how can I fix this?
Many thanks,
Maye
Comment