Hi everyone! Few variables from my dataset look like as provided below. This is from individual level dataset where in the household level no.of participants are aggregated by total no.of individual participants. But since it is individual-level dataset, the unique Household identifier is repeated multiple times according to the no.of individuals surveyed in each wave (2 period panel data). My issue is I want to combine these to a household dataset where one specific household is only one record per 1 survey, just as in the case of desired dataset specified. How do I create a new variable where I only can record the total no.of participants at the individual level once, so I can merge that to the household-level dataset? Will be happy to provide more details if required. Thanks in advance!
Original dataset
HHBASE2 SURVEY hh_farm_participants05 hh_nonfarm_participants05 hh_farm_participants12 hh_nonfarm_participants12
"10102010100" 1 0 2 0 0
"10102010100" 1 0 2 0 0
"10102010100" 1 0 2 0 0
"10102010100" 2 0 2 0 0
"10102010100" 2 0 2 0 0
"10102010100" 2 0 2 0 0
"10102010200" 1 0 4 0 0
"10102010200" 1 0 4 0 0
"10102010200" 1 0 4 0 0
"10102010200" 1 0 4 0 0
"10102010200" 2 0 3 0 2
"10102010200" 2 0 3 0 2
"10102010200" 2 0 3 0 2
Desired dataset
HHBASE2 SURVEY hh_farm_participants05 hh_nonfarm_participants05 hh_farm_participants12 hh_nonfarm_participants12
"10102010100" 1 0 2 0 0
"10102010100" 2 0 1 0 0
"10102010200" 1 0 2 0 0
"10102010200" 2 0 4 0 0
"10102010300" 1 0 4 0 0
"10102010300" 2 0 4 0 0
Related Posts with How to only record the observations only once for unique identifier in one period ?
ipdmetan - estimation_commandI would like to use ipdmetan to do an IPD meta-analysis for studies with treatment response yes/no a…
Using mca or pca to generate a single variableDear colleagues I know I can use principle component analysis (PCA) on categorical variables by firs…
Create Risk Prediction Variable from 2 Different Heckman Correction ModelsHi everyone, I'm wondering if there's a way to create a risk prediction variable from the results o…
Conducting multinomial regression on multiply imputed variables for subset dataHi Is there a way to conduct multinomial regression for a weighted subsample datasets? For e.g. I us…
Testing dominance between Lorenz curvesHello Stata Experts, I will request information on the Stata code to test for dominance between two…
Subscribe to:
Post Comments (Atom)
0 Response to How to only record the observations only once for unique identifier in one period ?
Post a Comment