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
getting predicted probability larger than 1 using margins after xtologitDear statalist: I have an individual-year panel, and I am estimating a fixed effect ordered logit m…
At which value of IV is DV equal to a certain value?Hello Stata community, I have been struggling recently with finding the correct command in Stata th…
DistributionHi, Is there someone to help me with a code to create two distributions like those I have attached?…
Design Weights with Large Nationally Representative DatasetStata Experts: I am extracting 15 variables from a nationally representative dataset (ECLSK). I need…
mixlogit with clustered standard errors: missing values in estimates tableHi All, I am using Stata IC 16 to estimate a discrete choice model using the user written command m…
Subscribe to:
Post Comments (Atom)
0 Response to Merging datasets code issue
Post a Comment