************************************ ************************************ ***APPEND DIFFERENT YEARS OF GENERAL SOCIAL SURVEY ************************************ ************************************ ************************************ ***CLEAR MEMORY ************************************ clear all ************************************ ***WINDOWS ************************************ ***Start saving results window log using "C:\course\progs\Stata_append.log", replace text ***Shortcut for folders global data = "C:\course\data" ************************************ ***MACINTOSH ************************************ ***Start saving results window log using "/course/progs/Stata_append.log", replace text ***Shortcut for folders global data = "/course/data" ************************************ ***OPENING COMMANDS ************************************ ***Tell Stata to not pause for "more" messages set more off ***Change directory cd "$data" ************************************ ***APPEND DIFFERENT YEARS ************************************ ***Open 2016 GSS use "GSS2016.dta", clear ***Append 2010 GSS append using "GSS2010.dta" ***Append 2004 GSS append using "GSS2004.dta" ************************************ ***FOR EVERYBODY ************************************ tab year, missing tab year, m ************************************ ***CLOSING COMMANDS ************************************ ***Save data save "Stata_append.dta", replace ***Save log log close