I am using a dataset divided into several different files, some of those are at the household level and some at the individual level. I want to work at the individual level but having information from the households too, but I am having problem merging files with two different levels. Households are identified by a code, let's say "hhid", and individual by both households and individual code "indid".
Just to show an example:
hh.dta
hhid
1
2
3
4
ind.dta
hhid indid
1 1
1 2
2 1
3 1
4 1
4 2
4 3
How can I merge the two files, in a way in which the variable of the household is matched to all individuals in that household?
I hope my question is enough clear, thanks!
Related Posts with Merge households and individuals datasets
Aggregate data based on two variablesHello Stata Community, I am new to Stata and have a question regarding the aggregation of a dataset…
Sorting VariablesHi I need to create a certain variable by sorting other variables, but I am not sure how to sort t…
Dynamic binary panel models with endogeneityHi all, I have a question related to dynamic panel analysis. As we know, xtabond2 is suitable to u…
Dataset merging to maximize number of observationsHi, I would like to merge two datasets. Both datasets have the following columns: Year Gvkey Cusip …
Dropping all Observations in a Longitudinal Data Set if Two Conditions are met.Hi Stata users, I am trying to drop entire records of individuals from this set if they had an oppo…
Subscribe to:
Post Comments (Atom)
0 Response to Merge households and individuals datasets
Post a Comment