I want to ask a question on merging dataset. My Master dataset looks like an example given below. It has many countries with code year and country and some variables.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte Code int Year str12 Country str1(Var1 Var2) 6 2000 "Afghanistan " "." "." 6 2002 "Afghanistan " "." "." 6 2005 "Afghanistan " "." "." 6 2006 "Afghanistan " "." "." 6 2007 "Afghanistan " "." "." 6 2009 "Afghanistan " "." "." 9 2001 "China" "." "." 9 2008 "China" "." "." 9 2012 "China" "." "." 9 2015 "China" "." "." end
In my second data file (which i want to merge) contains only Code and Country (identicial in both datasets) and some list of variables. The variable against the specific code and country will remain the same through out all the years in master data set. This is how my second data file looks like.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte Code str11 Country str1(Var3 Var4 Var5) 6 "Afghanistan" "." "." "." 9 "China " "." "." "." end
I shall be really thankful.
0 Response to Merging dataset
Post a Comment