[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Fwd: Re: st: RE: problem with reshape
Dear statalist user,
My variables are
i=hhid (household id, for each household),
j= memno (line number, different for every member of each household. e.g the
2nd person in household 1 will have memno=2, as would the 2nd person of
household 3,4,5,6...and so on)
The variables such as age, sex, relation to household head etc go from 01 to
22, assuming that there is at least one household in the sample with up to 22
members, and are thus currently suffixed by their number. e.g memage_04
represents the age of the 4th member of any given household in the sample.
My data is currently wide.i.e. the title row: hhid
with columns going accross as memage_01 memex_01 reltohead_01 memage_02
memsex_02 reltohead_02......up to 22.
When typing in reshape long (varname), i(hhid) j(memno)
I get the message 'memno contains all missing values' and it will not allow the
reshape to commence. I would like to rehshape the data from wide to long.
My aim is to get a column for memno alongside columns for variables memage,
memsex, reltohead without the numbered suffix. i.e.
memno memsex memage reltohead
1 . . .
2 . . .
. . . .
. . . . (for household 1)
. . . .
22 . . .
* For searches and help try: