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
Generating a new variable that equals the Nth non-missing value in a rowHi All, I am essentially trying to compress a row of variables into just the non-missing entries. M…
endogenous switching regression modelHello, Please I am new in stata so it's quite difficult for me to solve some regression problems. A…
-dstdize- to calculate average age-adjusted death rate by raceGood Morning, I would like to calculate the average age-adjusted death rate by race (separately for…
Can I test country level data and firm level data in one regressionHello everyone, I'm trying to find the effects of culture on the existence of teamwork. My dataset …
Replace if not found within a loopDear all, I am trying to bottom and top coding the household income for each country - wave. I am us…
Subscribe to:
Post Comments (Atom)
0 Response to Merging datasets code issue
Post a Comment