************************************ ************************************ ***SOCI 420: ADVANCED METHODS OF SOCIAL RESEARCH ***APPEND DIFFERENT YEARS OF GENERAL SOCIAL SURVEY ************************************ ************************************ ************************************ ***CLEAR MEMORY ************************************ clear all ************************************ ***CREATE SHORTCUTS AND LOG FILE ************************************ ***Shortcut for folders global codes = "H:\course\codes" global data = "H:\course\data" global output = "H:\course\output" ***Start saving results window log using "$codes\Stata_append.log", replace text ************************************ ***OPENING COMMANDS ************************************ ***Tell Stata to not pause for "more" messages set more off ***Change directory cd "$data" ************************************ ***APPEND DIFFERENT YEARS ************************************ ***Open 2018 GSS use "GSS2018.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