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
Estimating shape and scale parameters of Weibull distribution, with right censoringI have a continuous variable to which I want to fit a Weibull distribution. The variable is right ce…
Difference in SE and CI using svyset v. pweight - reason for difference?I am working on analyzing survey data which was collected using a stratified random sample, with dis…
Difference gmm vs system gmm, fd vs fodIs there any criteria to decide which estimation of difference gmm vs system gmm, first difference v…
Cumulative Totals in Unbalanced Time Series DataI have not been able to figure out how to leverage time-series data (tsset) and its efficiencies to …
Unable to use command BSPLINE in STATA version 15.1Hi, I am using STATA version 15.1. I am trying to run the following command: bspline, xvar(tmean05…
Subscribe to:
Post Comments (Atom)
0 Response to Merging few observations to copy/add for other observations
Post a Comment