Hello, I am working with a panel data that has household id (h_id) , individual id (h_pid), age, relationship with the householder and etc. I have attached a screenshot of a part of the dataset.
I want to specify whether an individual is a child (i have set the age from 0~10) or not.
So far, I have created a dummy variable to identify the observations with the age 0 or 1 (because some are born in between the survey dates).
What i want to have is a dummy variable, child1, that assigns 1 to each individual id if he/she is a child. Something like below
h_id h_pid year age child child1
693 69352 2015 1 1 1
693 69352 2016 2 0 1
693 69352 2017 3 0 1
693 69352 2018 4 0 1
693 69352 2019 5 0 1
Please help me to code this. Thank you.
I want to specify whether an individual is a child (i have set the age from 0~10) or not.
So far, I have created a dummy variable to identify the observations with the age 0 or 1 (because some are born in between the survey dates).
What i want to have is a dummy variable, child1, that assigns 1 to each individual id if he/she is a child. Something like below
h_id h_pid year age child child1
693 69352 2015 1 1 1
693 69352 2016 2 0 1
693 69352 2017 3 0 1
693 69352 2018 4 0 1
693 69352 2019 5 0 1
Please help me to code this. Thank you.
Comment