Hello, I am relative to Stata and I just cannot figure out how to solve the following problem.
My master data set contains household information and my using data contains numbers of events per province per year
(Master data)
year hhid province
2008 1097 province A
2008 2097 province A
2008 3524 province A
2008 2015 province B
2009 7020 province B
2009 7020 province B
2008 5214 province C
(Using dataset)
year province #events
2008 province A 245
2008 province B 458
2008 province C 344
2009 province A 312
2009 province B 765
I want to add the using dataset into the master data so that for every year province the number of events is added to those observations. My attempts with merge and joinby have so far not been successful, because it requires uniquely identified observations. How can I merge the using data into the masterdata and add the number of events to every matching year province observation? I am certain there is an easy solution to it, but I have not found it yet.
Thanks
Related Posts with Merging few observations to copy/add for other observations
Draw Random Sample Based on Iterative AlgorithmDear Statalisters, I have a panel data set with roughly 700 observations. Participants were require…
eregress / etregress and margins + interpretationHello everyone, I have insurance claims data (health insurance) from which I'm trying to figure out…
Using random instead of fixed effects in ordered probit model, and dummy variablesDear all, I am reaching out because I would need some clarifications for my regression model for my…
Hold the Time for Fix Effect (monthly)Hello everyone, I am currently sitting on an understanding issue. I want to hold my regression for …
Probability weights in random effects modelsHello, I am trying to estimate the effects of several time invariant variables on my outcome using …
Subscribe to:
Post Comments (Atom)
0 Response to Merging few observations to copy/add for other observations
Post a Comment