Hi everyone, this is my first post to Statalist so I kindly request some patience as well as welcome feedback regarding my post format.
I had a long database that I have reshaped to wide.
This is my reshape code:
Array Accordingly, this has generated multiple age and multiple sex variables per observation (e.g. age1, age2, age3), whereas in the original long format, I only had one age and one sex variable per observation. Below you can see an example which also offers more details regarding the storage types, etc.
Array
I would like to merge the age variables into one per observation. I would also like to do the same for the multiple sex variables.
I am also having trouble knowing exactly which term to use to address this issue (i.e. I am still learning the language of STATA). For example, having done my own research, I've learned that I am NOT looking to stack or concatenate (as this would require I reshape back to long).
I therefore have two questions:
1. Can someone please confirm I am looking to MERGE these variables into one new variable #STATALanguage?
2. Can someone please offer guidance as to how I can accomplish this.
Kind regards,
Kate
Related Posts with Merging variables into one variable after rehaping
Set seed command not respected for -bsqreg-Hi all, I am using the following code to attempt to get reproducible results for a median regressio…
Bootstrapped standard errors in panel data with sample weightsHello there, I am working with a panel collected from the Panel Study of Income Dynamics (survey da…
combine variables panel data graphsHi I'm working with panel data, trade among 10 countries in the past 27 years. I want to add and gra…
Dropping Variables Based on Other Variable, Student ProjectHey there, I'm a student working with Stata and have a data set that contains a variable associated…
Categorical data analysis (likert scale)Hello everyone, I'm working with categorical data on likert scale (4 scales) referred to the same sa…
Subscribe to:
Post Comments (Atom)
0 Response to Merging variables into one variable after rehaping
Post a Comment