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
Summing observations with similar nameHi everyone, at the moment, I'm doing some data preparation on institutional ownership and the situ…
Help with dynamic panels (xtabond)Hi all! First time posting here. I am writing research on digitalization in EU28 and its economic …
Storing values to a list and expand the list in each iterationI would like store certain values to a list and drop if certain variable's value is equivalent to th…
Maximum likelihood estimation with by(sort) commandDear, I hope you are all in good health. I'm estimating the amount of sorting across schools by est…
Display "Robust" at the top of Std.Err. column using -ereturn display-Dear Statalist, I have a rather technical question regarding displaying estimation commands. I am 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