I have datasets for 12 countries containing a multitude of variables e.g. age, sex, tobacco use, alcohol use, diabetes, and HBP. The issue is that certain variables are missing for some countries, which means I have to clean the datasets one by one to keep the necessary variables to be finally able to append them. So I am wondering if there is and special command for appending that will only retain the variables (for each of the subsequent append) that match those on the master dataset, lets say for keeping only Age, sex and HBP.
Thanks in advance for your insights!
Related Posts with Appending several datasets for selected variables in the master dataset
Time dummies to estimate the length of relationshipsI am working with 18 waves of panel data (HILDA) and in each wave, respondents state their marital s…
When I double-click a .dta file, Stata recognizes it as an R file! How to fix it?Today, I went to work on Stata and double clicked a .dta file. The computer presented the message b…
drop duplicates valuesHello, I want to drop duplicates values of a variable if the number of copies are less than five. T…
How to identify and operate characters in a string variable?Hi Statalisters, I am new to Stata and encounter some problems. I have a dataset with some string …
merge two files.Dear All, I find this question here (in Chinese). There are two files. The first one is something li…
Subscribe to:
Post Comments (Atom)
0 Response to Appending several datasets for selected variables in the master dataset
Post a Comment