Dear Statalisters,
I am working with a dataset originating from two different datasets, one with a series of variables regarding the household quality of a number of families, the other certain aspects of the quality of life of its members.
I need to work with both, but, logically, the number of observations is considerably greater in the "individual" dataset.
To fill the gaps in the "household" dataset, I would like to replicate the values of the "household" dataset's variables so that it features the same value each time the same family code is present in the "individual" dataset.
To further make myself clear: if person #1, #2 and #3 are all members of family #1, in which I have a corresponding value of 1000 for variable X, I would like for each member of family #1 to feature the value 1000 in variable X.
I think that some sort of use of the "by/bysort" command is what I need, but I am not sure.
I checked if this question was previously asked, but I don't think so, if that should be the case, please redirect me to the thread.
I thank in advance for any contribution!
Tommaso Bechini
I am working with a dataset originating from two different datasets, one with a series of variables regarding the household quality of a number of families, the other certain aspects of the quality of life of its members.
I need to work with both, but, logically, the number of observations is considerably greater in the "individual" dataset.
To fill the gaps in the "household" dataset, I would like to replicate the values of the "household" dataset's variables so that it features the same value each time the same family code is present in the "individual" dataset.
To further make myself clear: if person #1, #2 and #3 are all members of family #1, in which I have a corresponding value of 1000 for variable X, I would like for each member of family #1 to feature the value 1000 in variable X.
I think that some sort of use of the "by/bysort" command is what I need, but I am not sure.
I checked if this question was previously asked, but I don't think so, if that should be the case, please redirect me to the thread.
I thank in advance for any contribution!
Tommaso Bechini
Comment