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
Question about replace with multiple Criteria based on identifierHello friends. I have a dataset like this: ID Qualification Score A BS A Graduated A MS …
Ordered Logit coefficient interpretation with categorical (>2) independent variablesHi I am running an ologit model to understand the effect of parents' beliefs on students' high scho…
Doubts on autocorrelationDear Statalist users, I am kind of new with Stata and I'd really appreciate your help. I have been w…
Stata/MP 16: op. sys. refuses to provide memoryHi, I am having trouble with memory. My file size is 86mb and I have a memory of 8GM. I am using Sta…
Normalization of year interaction term to zero for interpretationDear all, I am working with a cross-sectional data set for the years 2005 to 2015. I am trying to e…
Subscribe to:
Post Comments (Atom)
0 Response to Trouble with reshape
Post a Comment