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
How to convert string id variable starting with "00" to numeric without losing the "00"?Hi, could any one help me with the following two issues? First, my id variable values start with 00…
Observations with missing cells in the data - should they be dropped?Hi all. I am organizing a panel data with information on the spending with government advertising by…
xttest0 invalid syntax R(111)Hello, I'm using stata 16 This is my code, Code: xtset com_id date, daily * LM test for penal wise…
Scatterplot with weighted regression line using aaplot and lfitDear Statalist, I'm trying to graph a scatterplot with a regressionline. Instead of a standard OLS …
how to create histogram for sub-samples by year averages?Dear all, I use Stata16 and will appreciate any help with creating comparative histogram by the 5-y…
Subscribe to:
Post Comments (Atom)
0 Response to Generate
Post a Comment