Hey,
in the panel study I am working with, there are two times the same variable (t34005a & t34005b). The first is only asked to people who no longer live at home and the second is only asked to those who still live at home.
I would like to create a new variable from this so that I have all the cases.
My idea was the following:
// restrict variable 2 to the cases who live either with the father or with the mother.
keep t34005a if t743024==1 | t743025==1
then the same for the variable of persons who no longer live at home:
keep t34005b if t743024 <>1 | t743025<>1
and then merge, maybe with append?
I'm a complete newbie and this is just a rough sketch.
Thanks a lot for the answers!
Related Posts with Generate new variable
Problem with variables names inside loopsHi all, I have a set of variables named "ratio_##########_co_###" (where # are numbers). My proble…
Sample size & power for quantile regressionHello, For a clinical trial using quantile regression to test the null hypothesis, could anyone adv…
DID (Differences-in-difference) regressionDear All, I’m having a problem with DID regression equation. I am using Stata 12. when I ran the re…
replace with the last row in each goup Hi STATALIST, Could you please help me to replace meacstdivol_1 with last row within each study_1?…
Help with merging two datasetsDear all, I am using Stata 16, on mac. I have attached the two excel datasets that I am working wit…
Subscribe to:
Post Comments (Atom)
0 Response to Generate new variable
Post a Comment