******************************************************************************************************************************* ******************************************************************************************************************************* * Documentation for * Monkey Cage post: Southern white support for the Confederate flag reflects Southern heritage, not just racial hate * Hutchings and Walton TESS dataset. See here: http://www.tessexperiments.org/data/hutchings307.html * L.J Zigerell * Stata version 11 ******************************************************************************************************************************* ******************************************************************************************************************************* * open the dataset use "tess25_hutchings_final_data.dta", clear set more off ******************************************************************************************************************************* ******************************************************************************************************************************* * check for missing data tab1 Q4 Q5 Q6 Q7 Q8A Q8B Q9_1 Q9_2 Q9_3 Q12 Q13 Q14 Q15, mi tab1 Q4 Q5 Q6 Q7 Q8A Q8B Q9_1 Q9_2 Q9_3 Q12 Q13 Q14 Q15, nol recode Q4 Q5 Q6 Q7 Q8A Q8B Q9_1 Q9_2 Q9_3 Q12 Q13 Q14 Q15 (-1=.) ******************************************************************************************************************************* ******************************************************************************************************************************* * code racial groups tab pprace gen white = pprace recode white (2 5=0) gen black = pprace recode black (1 5=0) (2=1) tab pprace white tab pprace black keep if white==1 // keep only white respondents so that standardized scales will be based on white respondents tab pprace black ******************************************************************************************************************************* ******************************************************************************************************************************* * code experimental conditions tab ARTICLE tab ARTICLE, gen(cond) tab ARTICLE cond1 tab ARTICLE cond2 tab ARTICLE cond3 tab ARTICLE cond4 ******************************************************************************************************************************* ******************************************************************************************************************************* * code variables * support for the flag with the confederate battle emblem tab Q5, mi gen flag = Q5 recode flag (1 2 4=0) (3=1) tab Q5 flag, mi tab flag tab Q6 gen heritage = Q6 tab Q6 heritage, mi gen lean2heritageDI = heritage recode lean2heritageDI (1 2 3=0) (5 6 7=1) (4=.) tab Q6 lean2heritageDI, mi tab flag if lean2heritageDI==1 tab flag if lean2heritageDI==0 tab Q7 gen pride = Q7 recode pride (3=-1) (2=0) tab Q7 pride, mi gen prideDI = Q7 recode prideDI (3=0) (2=.) tab Q7 prideDI, mi tab flag if prideDI==1 tab flag if prideDI==0 tab Q8A tab Q8A, mi tab Q8A, nol gen southerners = . replace southerners = -1 if Q8A==4 replace southerners = 0 if Q8A==2 replace southerners = 1 if Q8A==1 replace southerners = -1 if Q8A==3 tab Q8A southerners, mi tab Q8A gen southernersDI = Q8A recode southernersDI (1=1) (3=0) (2 4=.) tab Q8A southernersDI, mi tab flag if southernersDI==1 tab flag if southernersDI==0 tab Q12 tab Q13 alpha Q12 Q13, item min(1) std gen(discr) sum discr gen discrDI = discr replace discrDI = 0 if discr > -10 & discr <= 0 replace discrDI = 1 if discr > 0 & discr <= 10 tab discr discrDI, mi tab flag if discrDI==1 tab flag if discrDI==0 tab Q14 gen lessable = . replace lessable = 2 if Q14==1 replace lessable = 1 if Q14==2 replace lessable = 0 if Q14==5 // "Depends" responses replace lessable = -1 if Q14==3 replace lessable = -2 if Q14==4 tab Q14 lessable, mi gen lessableDI = lessable recode lessableDI (-2 -1 = 0) (1 2 = 1) (0=.) tab Q14 lessableDI, mi tab flag if lessableDI==1 tab flag if lessableDI==0 tab Q15 tab Q15, nol gen nomar = . replace nomar = 1 if Q15==2 replace nomar = 0 if Q15==3 // "Depends" responses replace nomar = -1 if Q15==1 tab Q15 nomar, mi gen nomarDI = nomar recode nomarDI (0=.) (-1=0) tab Q15 nomarDI, mi tab flag if nomarDI==1 tab flag if nomarDI==0 ******************************************************************************************************************************* ******************************************************************************************************************************* * place variables on a 0-to-1 scale sum heritage gen heritage01 = (heritage-1)/6 sum heritage01 sum pride gen pride01 = (pride+1)/2 sum pride01 sum southerners gen southerners01 = (southerners+1)/2 sum southerners01 sum discr gen discr01 = (discr+2.253002)/(2.253002+1.147978) sum discr01 sum lessable gen lessable01 = (lessable+2)/4 sum lessable01 sum nomar gen nomar01 = (nomar+1)/2 sum nomar01 sum heritage01 pride01 southerners01 discr01 lessable01 nomar01 ******************************************************************************************************************************* ******************************************************************************************************************************* * ttests for comparison to the flag item tab flag white ttest heritage01, by(flag) ttest pride01, by(flag) ttest southerners01, by(flag) ttest nomar01, by(flag) ttest discr01, by(flag) ttest lessable01, by(flag) ******************************************************************************************************************************* ******************************************************************************************************************************* * factor analysis factor heritage01 pride01 southerners01 discr01 lessable01 nomar01, pcf rotate ******************************************************************************************************************************* ******************************************************************************************************************************* * regressions svyset [pw=WEIGHT] * check all for heritage svy, subpop(white): logit flag heritage01 discr01 cond1 cond2 cond3 svy, subpop(white): logit flag heritage01 lessable01 cond1 cond2 cond3 svy, subpop(white): logit flag heritage01 nomar01 cond1 cond2 cond3 svy, subpop(white): logit flag heritage01 discr01 lessable01 nomar01 cond1 cond2 cond3 // without controls for experimental condition svy, subpop(white): logit flag heritage01 discr01 svy, subpop(white): logit flag heritage01 lessable01 svy, subpop(white): logit flag heritage01 nomar01 svy, subpop(white): logit flag heritage01 discr01 lessable01 nomar01 // only for the control condition svy, subpop(white): logit flag heritage01 discr01 if cond4==1 svy, subpop(white): logit flag heritage01 lessable01 if cond4==1 svy, subpop(white): logit flag heritage01 nomar01 if cond4==1 svy, subpop(white): logit flag heritage01 discr01 lessable01 nomar01 if cond4==1 * check all for pride svy, subpop(white): logit flag pride01 discr01 cond1 cond2 cond3 svy, subpop(white): logit flag pride01 lessable01 cond1 cond2 cond3 svy, subpop(white): logit flag pride01 nomar01 cond1 cond2 cond3 svy, subpop(white): logit flag pride01 discr01 lessable01 nomar01 cond1 cond2 cond3 // without controls for experimental condition svy, subpop(white): logit flag pride01 discr01 svy, subpop(white): logit flag pride01 lessable01 svy, subpop(white): logit flag pride01 nomar01 svy, subpop(white): logit flag pride01 discr01 lessable01 nomar01 // only for the control condition svy, subpop(white): logit flag pride01 discr01 if cond4==1 svy, subpop(white): logit flag pride01 lessable01 if cond4==1 svy, subpop(white): logit flag pride01 nomar01 if cond4==1 svy, subpop(white): logit flag pride01 discr01 lessable01 nomar01 if cond4==1 * check all for heritage svy, subpop(white): logit flag southerners01 discr01 cond1 cond2 cond3 svy, subpop(white): logit flag southerners01 lessable01 cond1 cond2 cond3 svy, subpop(white): logit flag southerners01 nomar01 cond1 cond2 cond3 svy, subpop(white): logit flag southerners01 discr01 lessable01 nomar01 cond1 cond2 cond3 // without controls for experimental condition svy, subpop(white): logit flag southerners01 discr01 svy, subpop(white): logit flag southerners01 lessable01 svy, subpop(white): logit flag southerners01 nomar01 svy, subpop(white): logit flag southerners01 discr01 lessable01 // only for the control condition svy, subpop(white): logit flag southerners01 discr01 if cond4==1 svy, subpop(white): logit flag southerners01 lessable01 if cond4==1 svy, subpop(white): logit flag southerners01 nomar01 if cond4==1 svy, subpop(white): logit flag southerners01 discr01 lessable01 nomar01 if cond4==1 * predicting the heritage variables svy, subpop(white): reg heritage01 pride01 southerners01 discr01 lessable01 nomar01 cond2 cond3 cond1 svy, subpop(white): reg pride01 heritage01 southerners01 discr01 lessable01 nomar01 cond2 cond3 cond1 svy, subpop(white): reg southerners01 pride01 heritage01 discr01 lessable01 nomar01 cond2 cond3 cond1