Good day everybody,
Could anybody help me? I carry out a research on migration and I need data on spouse, children and parents, left at home. I have only ID's and Relation data. Relation means parent, head, sister, child and so on.
I have different variables,
hhid pid Relation MaritalStatus SpouseID Stay SpouseLeft
2010 1 Head 1 2 0
2010 2 Wife 1 1 1
I need to generate new variable with condition for spouse. So I have a person, he has a wife, if this wife stay at home, for this person I need to create variable SpouseLeft with value 1, otherwise 0.
I did it manually in fact, but I could make mistakes.
So if anybody could help me I will be very grateful. Thank you in advance.
Could anybody help me? I carry out a research on migration and I need data on spouse, children and parents, left at home. I have only ID's and Relation data. Relation means parent, head, sister, child and so on.
I have different variables,
hhid pid Relation MaritalStatus SpouseID Stay SpouseLeft
2010 1 Head 1 2 0
2010 2 Wife 1 1 1
I need to generate new variable with condition for spouse. So I have a person, he has a wife, if this wife stay at home, for this person I need to create variable SpouseLeft with value 1, otherwise 0.
I did it manually in fact, but I could make mistakes.
So if anybody could help me I will be very grateful. Thank you in advance.
Comment