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
Plotting coeffcients after SuestHi, I would like to plot the coefficients with confidence intervals for coefficients from different…
Generating variable with maximum value 1 by combining twoHello fellow stata-users, Does anyone know how to generate a new variable that solely ranges betwee…
Dropping observations of a string variable that contain numbersHi, I want to analyse a very large dataset for which I want to look into the different categories of…
Fixed Effects Regression with Panel Data N>TI am doing a fixed effects regression with 5465 N and 5 T on Stata. I have used the fixed effects re…
Multiple imputation using endogenous covariatesHallo, my topic is rather of econometric nature than a pure Stata question: When applying regressio…
Subscribe to:
Post Comments (Atom)
0 Response to Merging few observations to copy/add for other observations
Post a Comment