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
About clogit in interventional studyHello. I would like to ask your help about clogit. Interventional study was conducted, the data was …
Regress in fixed time periodI have a dataset from 2004-2022 and want to form a regression every rolling 6 months so jan 2004-jun…
Create new variable using coefficient from a variable containing time dummyHello everyone, I'm using Stata version 14.0. I'm actually trying to estimate the natural rate of un…
Looping identify autosomal monosomies | regexmHello all: I am trying through loop through a string of karyotype to identify occurrence of "-1" th…
Multiply obverations of a variable with a vector to creat a new data setHi experts! I am a beginner of Stata and looking for your help. I have data set 1 or matrix 1 (63x1)…
Subscribe to:
Post Comments (Atom)
0 Response to Merging datasets code issue
Post a Comment