Hello,
I’m working with a time use database with information at the individual and household level. I have a couple of variables about who in the household the individual is doing domestic work for. For example, there is a question “Do you cook for someone in the household” if the individual responds affirmative, then they have to report the order of the member of the household they cook for. I want to create an indicator that takes the value of 1 if the person being cooked is younger than 6 and the value of 2 if its older than 65. I'm not sure how to loop through the observations in this case.
The data I have looks like this:
idhogar order age cookfor ord_cookfor
1 4 1 0 .
1 3 7 0 .
1 2 57 0 .
1 1 42 1 4
2 5 67 0 .
3 7 48 0 .
3 6 57 0 .
3 8 21 0 .
4 11 65 1 9
4 10 67 0 .
4 9 30 0 .
5 14 59 0 .
Thank you,
Tessa
Related Posts with How to create variables recording characteristics of the other members in the household
Are factor variable values important in regressionI am using data that has negative factor variable values and no value = 0. I am removing the negativ…
GsemHi all, I am attempting to run a cross-lagged panel model. I have two continuous variables (depress…
Sensitivity analysis: sign testGood night, I want to perform an additional analysis on my data to obtain evidence on whether the t…
Analyzing a trend over timeI have two questions: 1. What tool/model would you recommend to analyze the rate of change/trend of…
dis inrange(-1,0,1) gives 0 but should give 1I am working with dates of birth of children before the mothers are diagnosed with a disease. In a w…
Subscribe to:
Post Comments (Atom)
0 Response to How to create variables recording characteristics of the other members in the household
Post a Comment