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
Loop over quarterly variables to find yearly meansHi Everyone, I'm quite new to Stata (version 17.0) and I'm having some trouble implementing a loop …
Would using the Wald Chi2 be appropriate to choose between xtprobit and xtlogit results?I've run xtlogit and xtprobit regressions that yield very similar results. Would it be fine if I use…
xtivreg2 and interpretation of post estimation resultsHi, I am running an xtivewg2 command using some instrumental variables. I would like to reconfirm m…
Problem with calculating particular percentages of flowsGood morning, first of all these are the first times I am using Stata, so this could be a very eleme…
My nl equation has an error, please help!Hello everyone, I am trying to estimate the parameters a and c of a nonlinear equation. The nonline…
Subscribe to:
Post Comments (Atom)
0 Response to Merging variables into one variable after rehaping
Post a Comment