Project

General

Profile

Support #1004 ยป appendingfiles.do

Alita Nandi, 07/19/2018 03:30 PM

 

// for appending the wave specific individual level files into long format we need to
// (i) create a variable called wave which is 1 for wave 1, 2 for wave 2,...
// (ii) drop the wave prefix from all variables that had one
// (iii) save each wave specific file
// (iv) append these files
global dir "Folder path where the data files are stored"
foreach w in a b c d e f g {
use "$dir/`w'_indresp", clear
gen wave = strpos("abcdefg","`w'")
rename `w'_* *
save `w', replace
}
use a, clear
foreach w in b c d e f g {
append using `w'
}
save longfile, replace
    (1-1/1)