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
three-dimensional fixed effects and summing variable by 4 groupsHi all, I am a master student and I am trying to estimate effect of sanctions on import. Database c…
Error in forestplot: option lalign() not allowedHello, on running the "metan" command, metan OR ORlci ORuci, label(namevar=id) wgt(bweight) first(0.…
Gravity model estimation using PPML with fixed effectsHello All, I'm trying to estimate GVC trade flows in a gravity model, using the PPML method. My dep…
Help interpreting resultsHi, I am very new to STATA and econometrics and I need some help interpreting my results. I wish to …
Saving first-stage F-statistic with -ivprobit, twostep-I am running -ivprobit, twostep first- and want to capture the first-stage F-statistic. The e(return…
Subscribe to:
Post Comments (Atom)
0 Response to Merging variables into one variable after rehaping
Post a Comment