Hi all!
I can't figure out a certain line of code. I'd like to merge two data sets. The master dataset looks as follows:
Array
And I'm trying to merge it with a dataset that looks like this:
Array
I know the specification "merge m:m country year using X.dta" works, however, it only merges the data if the year is available in the master dataset. The dataset I add has data starting from 2008 instead of 2012. How do I add empty year observations 2008, 2009, 2010, 2011 for each b_id in the master so that no data gets lost? Note that not all entries of b_id in the set start at 2012.
Kind regards,
Philippe
Related Posts with Merging datasets code issue
Multicollinearity in regression analysisI need to test multicollinearity for my data set. I made the correlation matrix and I notice a corre…
Change in a variable's value, for the same individual, across years of dataHi Apologies if this query is very simplistic. I am using UKHLS data on individuals to look at chan…
Converting Date or birth to AgeHello, It's first time I am using this forum. I have previously converted successfully date of birth…
Matching subjects across multiple variables and within variableI have a dataset where there are several variables that I'm being asked to match and come up with so…
Regrouping variablesHello everyone ! We are working on a project on Stata where we have to work on this regression : ln…
Subscribe to:
Post Comments (Atom)
0 Response to Merging datasets code issue
Post a Comment