I have a dataset in which observations are uniquely identified by FPrimary (household), wave (survey year), hhmid (household member id).
I want to generate a new variable called dowrygiven_husband such that - If person is female, then dowrygiven_husband should equal dowrygiven reported by her spouse.
The idea is to capture in one observation the dowry info reported by the husband and the wife.
eg, for FPrimary = 101001002, wave = 1: dowrygiven_husband[hhmid = 2] should equal dowrygiven[hhmid = 1] since 1 and 2 are spouses.
Notes: It is possible that a woman does not have a spouse reported in the dataset, so dowrygiven_husband can take a missing value.
I am having trouble coding this.
I want to generate a new variable called dowrygiven_husband such that - If person is female, then dowrygiven_husband should equal dowrygiven reported by her spouse.
The idea is to capture in one observation the dowry info reported by the husband and the wife.
eg, for FPrimary = 101001002, wave = 1: dowrygiven_husband[hhmid = 2] should equal dowrygiven[hhmid = 1] since 1 and 2 are spouses.
Notes: It is possible that a woman does not have a spouse reported in the dataset, so dowrygiven_husband can take a missing value.
I am having trouble coding this.
Comment