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
Wooldrige Test for serial correlation.Hello guys! I was running the Wooldrige Test for serial correlation of the error terms and the H0 is…
change in volume between the same months in different yearsI have a hospital dataset declared as a time series with panel data with monthly observations. Volum…
Replacing observations appearing multiple times on the same variable on the same participant. Longitudinal study.Hi again. I have a new problem, and I'll try to explain it the best can. First, som background info…
Quickly merging chunks of variables within the same datasetHello, I have a dataset with different groups of variables that actually represent the same questio…
Heckman selection modelHi there! I'd like to learn more about the Heckman selection model to control for selection bias. He…
Subscribe to:
Post Comments (Atom)
0 Response to How to create variables recording characteristics of the other members in the household
Post a Comment