I am using two data set, one contains data for children and another for woman. Now both data sets have key variables for Household id (HH) and person id (ln). Each id is unique, for example if an id has been provided to a female in a household it won't be assigned to any children in the children data set and vice versa. So, now i have merged these two data set, so now in the merged data set i only have women and children. Now the problem i facing is regarding children's primary caretaker variable. Each child is assigned a primary caretaker from the household child is living in. Now that caretaker can be male or female. How can i tell how many children have female caretaker? Is there any command which i can use to do something
bys HH: gen caretaker="female" if primary caretaker takes any of the value from female person id variable. I mean the number in the caretaker id, equals any number in the female person id variable, bys HH.
Related Posts with Generate
"Missing Imputed Values Produced" Error MessageI am trying to run the following mi impute command to impute infractions (INF_M6a), psychological sy…
Missing F-statistics of regression. regress socialsecurity ageeea ageeea2 eea ageeeaeea ageeea2eea if eeadonutregression==1 [pweight=w…
What is the best test to compare regression coefficients when we use a probit model?Hello, I run two regressions for the same sample when the only difference is that there I include o…
Multiple Ego Network AnalysisI have 3000+ ego networks in one database. I can not seem to figure out the code to run a density an…
How to use a synthetic control group as the control group in difference-in-differences analysis in StataI want to analyze the impact that the introduction of Google Fiber in Kansas City had on hours worke…
Subscribe to:
Post Comments (Atom)
0 Response to Generate
Post a Comment