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
What is wrong with inlist2 in my code?Hi all, Yesterday, as documented from this post (https://www.statalist.org/forums/for...p-of-countr…
Test constraint droppedDear Statalist: *First, I run the following Modified Pearson Regression with interactions glm k6ca…
Dates from Excel/CSV not correctly displaying in StataI imported several csv files with "birthdate" as one of the variables into Stata and then I appended…
How to see the frequency of a veriables in each country in a dataset ?By the helps from others, I see that I can list the unique countries from a sample by using\ tab GE…
Why the number of observation decrease when I increase the sample size?Hi all, Today I face a strange situation that the number of observations shrinking when I expand th…
Subscribe to:
Post Comments (Atom)
0 Response to Generate new variable
Post a Comment