#Title: dwv_ps6_ms_1_load.R
#Author: Jack Reilly
#Purpose: Load data
# requires: working directory, libraries
# result: gss_subset

gss<-read_dta("gss7224_r1.dta")

#Select the variables used by Mondak and Sanders, including the Year variable
#Mechanism: some of these show up in the codebook! But others don't.  
#Once you see the pattern, the rest are straightforward; missing ones can be found noted in GSS2024 Release Variables as dropped for the 2024 year
gss_sub <- gss |> select(year, spkath, colath, libath, spkrac, colrac, librac, spkcom, colcom, libcom, spkmil, colmil, libmil, spkhomo, colhomo, libhomo)

gss_sub <- filter(gss_sub, year >= 1976)