Hi,
I have a question that I think is related to merging datasets.
I have one dataset with many observations about various topics. Then, I have a second dataset with a few observations about owning a business. The respondents are the same, although not all of them are in the business dataset, as this only includes the respondents that own a business. Some respondents own multiple businesses, and in this case, the business dataset has them registered as a separate observation. Hence, there may be multiple observations per respondent in this dataset.
I know that I can merge these with a one to many merge. However, I do not want multiple observation lines for the same respondent. I would like to have one observation line per respondent, including all there businesses and questions about those as variables.
Thus: E.g.:
Dataset 1:
Respondent
1
2
3
4
Dataset 2:
Respondent
2
2
3
Etc.
I would like:
Merged Data:
Etc.
Would anyone know how to get this done in Stata?
I hope my question was clear.
Many thanks in advance!
Best regards,
Gin
I have a question that I think is related to merging datasets.
I have one dataset with many observations about various topics. Then, I have a second dataset with a few observations about owning a business. The respondents are the same, although not all of them are in the business dataset, as this only includes the respondents that own a business. Some respondents own multiple businesses, and in this case, the business dataset has them registered as a separate observation. Hence, there may be multiple observations per respondent in this dataset.
I know that I can merge these with a one to many merge. However, I do not want multiple observation lines for the same respondent. I would like to have one observation line per respondent, including all there businesses and questions about those as variables.
Thus: E.g.:
Dataset 1:
Respondent
1
2
3
4
Dataset 2:
Respondent
2
2
3
Etc.
I would like:
Merged Data:
Respondent | Business 1 | Question about Business 1 | Business 2 |
1 | No | ... | No |
2 | Yes | ... | Yes |
3 | Yes | ... | No |
4 | No | ... | No |
Would anyone know how to get this done in Stata?
I hope my question was clear.
Many thanks in advance!
Best regards,
Gin
Comment