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 ?
multivariate regressionHello, I try to analyze panel data using the following regression model. All variables have been de…
adding a zero in the middle of a string variableDear Statalist users, I have a string variable(patient id) in the form ED6/01/001 ED6/01/002 ED6/01…
Panel data- xtgls vs xtregHello! I am conducting research into the determinants of FDI using panel data. From previous studie…
inverse of odds ratioHi, I am doing a meta-analysis exploring the association between hyperglycemia and neurodevelopmenta…
Interpreting an Unexpected Negative Beta in HMRHello! I'm hoping someone can help me interpret an unexpected negative value for a beta that I obtai…
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