Hi all!
I am working with DHS data and I am analyzing marriage institutions and siblings' marriage time. I want to arrange variables as child order, sex, age and all variables connected with the corresponding child.
The data look like the following:
hh_number birth_order01 birth_order02 birth_order03 birth_order04 sex_of_child01 ... sex_of_child04 .. (many other variables like this)
1 2 1 - - f ... m
2 4 3 2 1
2 1 - -
3
3
3
etc
As far as I understand, this is wide data, but I want to convert it to long data format. However, when I used this command:
reshape wide birth_order sex_of_child, i(hh_number) j(bord)
Stata is showing the error message:
variable bord not found
Data are already wide.
Ideally, I want the data to look like the following:
hh_number birth_order sex_of_child
1 2 f
1 1 f
2 4 (etc)
2 3
2 2
2 1
(etc)
PS: even though it is already a wide data, I tried to reshape from long to wide, but it showed an error message :
variable id does not uniquely identify the observations
----------------------------
Would appreciate to get any help!
Regards,
Farogat.
Related Posts with Trouble with reshape
MergingI am using time use survey 2019 in India.I have extracted 5 datasets of different levels.In level5 e…
High R-sqaured, Low Variable SignificanceHi everyone! I am currently working on a project that used secondary data and struggle a bit with th…
Long-term effective tax rate over 5 yearsDear Stata experts I am a bloody beginner when it comes to stata. I am working with unbalanced pan…
Combining TablesI have 4 different summary statistics (proportion) tables. I need to report all the results in one t…
List of unique values for a variableHello Statalist users, I am working on a dataset which contains the countries of export (in some ca…
Subscribe to:
Post Comments (Atom)
0 Response to Trouble with reshape
Post a Comment