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
Remove accents on a string variable in stataDear everyone, I would like to know if someone knows a STATA code that I can use to remove accents …
Student and Subject Fixed effectsHi, I am running a panel data with 3000 observations and each student has two subjects recorded. I…
pert distributionhello i would like to know how to generate a PERT distribution from a low, high, and mean value say …
Restrictions to parametersI can't figure out how i should put restriction to a parameter. I want to measure a group within dif…
Oceania Stata Conference 2019We are pleased to announce that the Scientific Committee for the Oceania Stata Conference 2019 is no…
Subscribe to:
Post Comments (Atom)
0 Response to Generate
Post a Comment