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
Is it okay to use multiple imputation to create imputed values in a second dataset?Say I have two datasets A & B. They have the same variables in each except that set A has one ad…
Translating do file to pdfI am using the following command: translate 4th_Assignmnet.do 4th_Assignmnet.pdf and get: transla…
Creating Lead variables with respect to month (1, 3, 6) when I have daily datahello. I'm working on the U.S. stock market. I have entire stock market data ( thousands of stocks).…
Using outreg2 to export Heckman results to LaTeXHi, I'm having problems using outreg2 to export the results from a Heckman model to LaTeX (same prob…
Logit non-linear regressionHi, I have a non-linear model and wish to use logit command. Is the command the same for linear mod…
Subscribe to:
Post Comments (Atom)
0 Response to Trouble with reshape
Post a Comment