******************************************** * Replication dofile * Sandra Walzenbach and Thomas Hinz: "Puzzling Answers to Crosswise Questions" (Survey Research Methods) * Version: 2022-08-24 ******************************************** version 14 set more off global procdta "" global out "" global archive "" set scheme s1mono ***************************************************************************** * CONTENT * 1) prepare data sets from individual waves and merge to one data set (one long format (w*cw), one wide format (w*_exp)) * a) voter turnout W4 * b) blood donation W6 * c) littering W7 * d) keeping change / jaywalking W8 (overall) * e) keeping change / jaywalking W8 (by order) * 2) merge data sets + add indicators for panel conditioning //--> generate stuttgart_cw_resp to evaluate W6 response, experience_cw to evaluate W8 response * 3) results: dot plot with overall rates * 4) analyses on order experiments * a) change * b) jaywalking * 5) prevalence rates by experience (and robustness checks) ************************************************************ ********************************************************************************************************************** * 1) prepare data sets from individual waves and merge to one data set ********************************************************************************************************************** * a) voter turnout W4 *************************** use "$archive\w4.dta", clear fre cw_stuttgart21_1 cw_stuttgart21_2 dq_stuttgart21_1 dq_stuttgart21_2 dq_stuttgart21_3 dq_stuttgart21_4 // 1 Ja 2 Nein mvdecode cw_stuttgart21_1 cw_stuttgart21_2 dq_stuttgart21_1 dq_stuttgart21_2 dq_stuttgart21_3 dq_stuttgart21_4, mv(0) rename dq_stuttgart21_1 voter1 lab var voter1 "eligible to vote (CW1)" rename dq_stuttgart21_2 voter2 lab var voter2 "eligible to vote (CW2)" rename dq_stuttgart21_3 voter3 lab var voter3 "eligible to vote (DQ)" lab var dq_stuttgart21_4 "turnout - direct question" lab var cw_stuttgart21_1 "turnout - CW1" lab var cw_stuttgart21_2 "turnout - CW2" ta voter1 cw_stuttgart21_1, m //exclude if not eligible to vote ta voter2 cw_stuttgart21_2, m ta voter3 dq_stuttgart21_4, m gen vote_cw=. replace vote_cw=cw_stuttgart21_1 if voter1==1 replace vote_cw=cw_stuttgart21_2 if voter2==1 fre vote_cw gen vote_dq=dq_stuttgart21_4 replace vote_dq=. if voter3!=1 fre vote_cw vote_dq recode vote_cw vote_dq (2=0) lab def cw 1 "same" 0 "different", modify lab def dq 0 "no" 1"yes", modify lab val vote_cw cw lab val vote_dq dq drop if vote_dq==. & vote_cw==. gen split = (vote_cw==0 | vote_cw==1) // 1 CW, 0 DQ gen vote_resp = (vote_cw==0 | vote_cw==1) lab var vote_resp "CW experience in W4" *dq (80% yes) sum vote_dq gen phi_dq = r(mean) gen n_dq = r(N) tab1 phi_dq n_dq *cw sum vote_cw gen both = r(mean) gen n_cw = r(N) tab1 both n_cw *prevalence CW di (both+0.25-1)/(2*0.25-1) gen phi_cw=(both+0.25-1)/(2*0.25-1) ta phi_cw *variance di (both*(1-both))/(n_cw*(2*0.25-1)^2) gen var_cw=(both*(1-both))/(n_cw*(2*0.25-1)^2) gen sd_cw = sqrt(var_cw) tab1 phi_cw sd_cw gen var_dq = phi_dq*(1-phi_dq) / n_dq gen sd_dq = sqrt(var_dq) tab1 phi_dq sd_dq gen cw_min95 = phi_cw -1.96 * sd_cw gen cw_max95 = phi_cw +1.96 * sd_cw gen dq_min95 = phi_dq -1.96 * sd_dq gen dq_max95 = phi_dq +1.96 * sd_dq *summary statistics gen min95 = . replace min95 = cw_min95 *100 if vote_cw!=. replace min95 = dq_min95 *100 if vote_dq!=. gen estimate = . replace estimate = phi_cw *100 if vote_cw!=. replace estimate = phi_dq *100 if vote_dq!=. gen max95 = . replace max95 = cw_max95 *100 if vote_cw!=. replace max95 = dq_max95 *100 if vote_dq!=. keep ID vote_cw vote_dq vote_resp estimate min95 max95 split d4 d5 d12 gen alter=2011-d5 egen age_w4 = cut(alter), at(18,31,60,90) recode age_w4 18=1 31=2 60=3 ta alter age_w4, m rename alter alter_w4 lab var alter_w4 "age (continuous)" drop d5 rename d4 d4_w4 rename d12 d12_w4 recode d12_w4 1/6=0 7=1 8/9=2 10=., gen(educ_w4) ta d12_w4 educ_w4, m gen estis=1 lab var estis "estimates" gen wave=4 //warner gen warner=. replace warner=0.25 if split==1 replace warner=1 if split==0 //all gen all=. replace all = vote_dq if split==0 replace all = vote_cw if split==1 lab var all "combined answer variable (DQ and CM)" save "$procdta\w4cw.dta", replace keep ID vote_resp keep if vote_resp==1 save "$procdta\w4_exp.dta", replace assert _N==533 * b) blood donation W6 *************************** use "$archive\w6.dta", clear fre cw_blutspende dq_blutspende rename cw_blutspende blood_cw rename dq_blutspende blood_dq recode blood_dq (2=0) recode blood_cw (2=0) ta blood_cw blood_dq, m drop if (blood_dq==. | blood_dq==.f) & (blood_cw==. | blood_cw==.f) gen split = (blood_cw==0 | blood_cw==1) gen blood_resp = (blood_cw==0 | blood_cw==1) lab var blood_resp "CW experience in W6" *dq fre blood_dq sum blood_dq gen phi_dq = r(mean) gen n_dq = r(N) tab1 phi_dq n_dq *cw fre blood_cw sum blood_cw gen both = r(mean) gen n_cw = r(N) tab1 both n_cw *prevalence CW gen phi_cw=(both+(1/4)-1)/(2*(1/4)-1) ta phi_cw *variance gen var_cw=(both*(1-both))/(n_cw*(2*(1/4)-1)^2) gen sd_cw = sqrt(var_cw) tab1 phi_cw sd_cw gen var_dq = phi_dq*(1-phi_dq) / n_dq gen sd_dq = sqrt(var_dq) tab1 phi_dq sd_dq gen cw_min95 = phi_cw -1.96 * sd_cw gen cw_max95 = phi_cw +1.96 * sd_cw gen dq_min95 = phi_dq -1.96 * sd_dq gen dq_max95 = phi_dq +1.96 * sd_dq *summary statistics gen min95 = . replace min95 = cw_min95 *100 if blood_cw!=.f replace min95 = dq_min95 *100 if blood_dq!=.f gen estimate = . replace estimate = phi_cw *100 if blood_cw!=.f replace estimate = phi_dq *100 if blood_dq!=.f gen max95 = . replace max95 = cw_max95 *100 if blood_cw!=.f replace max95 = dq_max95 *100 if blood_dq!=.f keep ID blood_cw blood_dq blood_resp estimate min95 max95 split d4 d5 altersgr d12 gen alter=2013-d5 rename alter alter_w6 rename altersgr age_w6 drop d5 rename d4 d4_w6 rename d12 d12_w6 recode d12_w6 1/6=0 7=1 8/9=2 10=., gen(educ_w6) ta d12_w6 educ_w6, m gen estis=2 gen wave=6 //warner gen warner=. replace warner=0.25 if split==1 replace warner=1 if split==0 //all gen all=. replace all = blood_dq if split==0 replace all = blood_cw if split==1 lab var all "combined answer variable (DQ and CM)" save "$procdta\w6cw.dta", replace keep ID blood_resp keep if blood_resp==1 save "$procdta\w6_exp.dta", replace assert _N==667 * c) littering W7 *************************** use "$archive\w7.dta", clear fre cw_muell dq_muell rename cw_muell litter_cw rename dq_muell litter_dq drop if (litter_dq==. | litter_dq==.f) & (litter_cw==. | litter_cw==.f) gen split = (litter_cw==0 | litter_cw==1) gen litter_resp = (litter_cw==0 | litter_cw==1) lab var litter_resp "CW experience in W7" *dq fre litter_dq sum litter_dq gen phi_dq = r(mean) gen n_dq = r(N) tab1 phi_dq n_dq *cw fre litter_cw sum litter_cw gen both = r(mean) gen n_cw = r(N) tab1 both n_cw *prevalence CW gen phi_cw=(both+(1/6)-1)/(2*(1/6)-1) ta phi_cw *variance gen var_cw=(both*(1-both))/(n_cw*(2*(1/6)-1)^2) gen sd_cw = sqrt(var_cw) tab1 phi_cw sd_cw gen var_dq = phi_dq*(1-phi_dq) / n_dq gen sd_dq = sqrt(var_dq) tab1 phi_dq sd_dq gen cw_min95 = phi_cw -1.96 * sd_cw gen cw_max95 = phi_cw +1.96 * sd_cw gen dq_min95 = phi_dq -1.96 * sd_dq gen dq_max95 = phi_dq +1.96 * sd_dq *summary statistics gen min95 = . replace min95 = cw_min95 *100 if litter_cw!=.f replace min95 = dq_min95 *100 if litter_dq!=.f gen estimate = . replace estimate = phi_cw *100 if litter_cw!=.f replace estimate = phi_dq *100 if litter_dq!=.f gen max95 = . replace max95 = cw_max95 *100 if litter_cw!=.f replace max95 = dq_max95 *100 if litter_dq!=.f keep ID litter_dq litter_cw litter_resp estimate min95 max95 split d4 d5 altersgr d12 gen alter=2014-d5 ta alter altersgr, m rename alter alter_w7 drop d5 rename altersgr age_w7 rename d4 d4_w7 rename d12 d12_w7 recode d12_w7 1/6=0 7=1 8/9=2 10=., gen(educ_w7) ta d12_w7 educ_w7, m gen estis=3 gen wave=7 //warner gen warner=. replace warner=.16666667 if split==1 replace warner=1 if split==0 //all gen all=. replace all=litter_dq if split==0 replace all=litter_cw if split==1 lab var all "combined answer variable (DQ and CM)" save "$procdta\w7cw.dta", replace keep ID litter_resp keep if litter_resp==1 save "$procdta\w7_exp.dta", replace assert _N==940 * d) keeping change / jaywalking W8 (overall) ****************************************************** use "$archive\w8.dta", clear mvdecode cw_wechselgeld_1 cw_wechselgeld_2 dq_wechselgeld cw_ampel_1 cw_ampel_2 dq_ampel, mv(0) egen miss = rowmiss (cw_wechselgeld_1 cw_wechselgeld_2 dq_wechselgeld cw_ampel_1 cw_ampel_2 dq_ampel) fre miss drop if miss==6 lab var cw_wechselgeld_1 "CW keeping change(1=same/2=diff)" lab var cw_wechselgeld_2 "CW keeping change(1=diff/3=same)" lab var cw_ampel_1 "CW jaywalking(1=same/2=diff)" lab var cw_ampel_2 "CW jaywalking(1=diff/2=same)" *recode consistently //by order recode cw_wechselgeld_1 2=0, gen(change_cw1) recode cw_wechselgeld_2 1=0 3=1, gen(change_cw2) recode cw_ampel_1 2=0, gen(ampel_cw1) recode cw_ampel_2 1=0 2=1, gen(ampel_cw2) lab def cw 0"different" 1"same", modify lab val change_cw1 change_cw2 ampel_cw1 ampel_cw2 cw recode dq_wechselgeld 2=0, gen(change_dq) recode dq_ampel 2=0, gen(ampel_dq) lab def dq 0"no" 1"yes", modify lab val change_dq ampel_dq dq lab var change_cw1 "CW keeping change (order1: same first)" lab var change_cw2 "CW keeping change (order2: diff first)" lab var ampel_cw1 "CW jaywalking (order1: same first)" lab var ampel_cw2 "CW jaywalking (order2: diff first)" ta cw_wechselgeld_1 change_cw1, m ta cw_wechselgeld_2 change_cw2, m ta cw_ampel_1 ampel_cw1, m ta cw_ampel_2 ampel_cw2, m ta dq_wechselgeld change_dq, m ta dq_ampel ampel_dq, m fre change_* ampel_* //overall variables that ignore order variation gen change_cw=. lab var change_cw "CW keeping change (all)" replace change_cw=0 if change_cw1==0 | change_cw2==0 replace change_cw=1 if change_cw1==1 | change_cw2==1 gen ampel_cw=. lab var ampel_cw "CW jaywalking (all)" replace ampel_cw=0 if ampel_cw1==0 | ampel_cw2==0 replace ampel_cw=1 if ampel_cw1==1 | ampel_cw2==1 *crosswise foreach v in change ampel { sum `v'_cw gen `v'_mean = r(mean) gen `v'_n_cw = r(N) tab1 `v'_* *prevalence CW di (`v'_mean+(1/6)-1)/(2*(1/6)-1) gen `v'_phi_cw=(`v'_mean+(1/6)-1)/(2*(1/6)-1) ta `v'_phi_cw *dq sum `v'_dq gen `v'_phi_dq = r(mean) gen `v'_n_dq = r(N) tab1 `v'_phi_dq `v'_n_dq *Varianz CW gen `v'_var_cw=(`v'_mean*(1-`v'_mean))/(`v'_n_cw*(2*(1/6)-1)^2) gen `v'_sd_cw = sqrt(`v'_var_cw) tab1 `v'_phi_cw `v'_sd_cw *Varianz DQ gen `v'_var_dq = `v'_phi_dq*(1-`v'_phi_dq) / `v'_n_dq gen `v'_sd_dq = sqrt(`v'_var_dq) tab1 `v'_phi_dq `v'_sd_dq *KIs gen `v'_cw_min95 = `v'_phi_cw -1.96 * `v'_sd_cw gen `v'_cw_max95 = `v'_phi_cw +1.96 * `v'_sd_cw gen `v'_dq_min95 = `v'_phi_dq -1.96 * `v'_sd_dq gen `v'_dq_max95 = `v'_phi_dq +1.96 * `v'_sd_dq } gen w8_resp = (ampel_cw==0 | ampel_cw==1 | change_cw==0 | change_cw==1) lab var w8_resp "CW experience in W8" fre w8_resp gen split = (ampel_cw==0 | ampel_cw==1 | change_cw==0 | change_cw==1) fre split gen estis=4 if change_cw==0 | change_cw==1 | change_dq==0 | change_dq==1 replace estis=5 if ampel_cw==0 | ampel_cw==1 | ampel_dq==0 | ampel_dq==1 fre estis //summary statistics gen estimate=change_phi_dq if estis==4 & split==0 replace estimate=change_phi_cw if estis==4 & split==1 replace estimate=ampel_phi_dq if estis==5 & split==0 replace estimate=ampel_phi_cw if estis==5 & split==1 replace estimate=100*estimate order estimate split estis ampel_phi_cw ampel_phi_dq change_phi_cw change_phi_dq sort estimate //variances for KIs foreach x in min95 max95 { gen `x'=100*change_dq_`x' if estis==4 & split==0 replace `x'=100*change_cw_`x' if estis==4 & split==1 replace `x'=100*ampel_dq_`x' if estis==5 & split==0 replace `x'=100*ampel_cw_`x' if estis==5 & split==1 } order estis split min95 *min95 max95 *max95 sort min95 keep ID change_dq change_cw ampel_dq ampel_cw change_cw1 change_cw2 ampel_cw1 ampel_cw2 w8_resp split estimate min95 max95 estis split d4 d5 altersgr d12 gen alter=2015-d5 rename alter alter_w8 rename altersgr age_w8 drop d5 rename d4 d4_w8 rename d12 d12_w8 recode d12_w8 1/6=0 7=1 8/9=2 10=., gen(educ_w8) ta d12_w8 educ_w8, m gen wave=8 //warner gen warner=. replace warner=.16666667 if split==1 replace warner=1 if split==0 //all gen all=. replace all = change_dq if estis==4 & split==0 replace all = change_cw if estis==4 & split==1 replace all = ampel_dq if estis==5 & split==0 replace all = ampel_cw if estis==5 & split==1 lab var all "combined answer variable (DQ and CM)" save "$procdta\w8cw.dta", replace * e) keeping change / jaywalking W8 BY ORDER ****************************************************** *Ampel/Wechselgeld (nach Reihenfolge: ticked responses and resulting estimates, only CM) keep ID change_cw1 change_cw2 ampel_cw1 ampel_cw2 split keep if split==1 //only CW *CW foreach v in change_cw1 change_cw2 ampel_cw1 ampel_cw2 { sum `v' gen `v'_mean = r(mean) gen `v'_n = r(N) tab1 `v'_* *geschätzte Prälenzrate CW di (`v'_mean+(1/6)-1)/(2*(1/6)-1) gen `v'_phi=(`v'_mean+(1/6)-1)/(2*(1/6)-1) ta `v'_phi *Varianz CW gen `v'_var=(`v'_mean*(1-`v'_mean))/(`v'_n*(2*(1/6)-1)^2) gen `v'_sd = sqrt(`v'_var) tab1 `v'_phi `v'_sd *KIs gen `v'_min95 = `v'_phi -1.96 * `v'_sd gen `v'_max95 = `v'_phi +1.96 * `v'_sd } save "$procdta\w8cw_order.dta", replace //(change in CWorder1: 324 / CWorder2: 307 --> jetzt 303 / Ampel in CWorder1: 289 --> jetzt 288 / CWorder2: 323) ********************************************************************* *2) merge data sets + add indicators for panel conditioning ********************************************************************* use "$procdta\w4cw.dta", clear drop wave estis merge 1:1 ID using "$procdta\w6cw.dta" drop _merge wave estis merge 1:1 ID using "$procdta\w7cw.dta" drop _merge wave estis merge 1:1 ID using "$procdta\w8cw.dta" drop _merge wave estis assert _N==2527 foreach v in 4 6 7 8 { //sociodemographics reported in Appendix Table A1.2 fre d4_w`v' age_w`v' educ_w`v' } save "$procdta\socdem.dta", replace *add indicators for panel conditioning *stuttgart_cw_resp to evaluate W6 response, experience_cw to evaluate W8 response ********************************************************************************** *to evaluate W6 response use "$procdta\w6cw.dta", clear fre d4_w6 age_w6 d12_w6 merge 1:1 ID using "$procdta\socdem.dta" drop if _merge==2 drop _merge assert _N==1027 merge 1:1 ID using "$procdta\w4_exp.dta" drop wave estis drop if _merge==2 replace vote_resp=0 if _merge==1 drop _merge fre vote_resp save "$procdta\cw6_panelcond.dta", replace *to evaluate W8 response use "$procdta\w8cw.dta", clear fre d4_w8 age_w8 d12_w8 merge 1:1 ID using "$procdta\socdem.dta" drop if _merge==2 drop _merge assert _N==1584 merge 1:1 ID using "$procdta\w4_exp.dta" drop if _merge==2 drop _merge merge 1:1 ID using "$procdta\w6_exp.dta" drop if _merge==2 drop _merge merge 1:1 ID using "$procdta\w7_exp.dta" drop if _merge==2 drop _merge drop wave estis egen experience_cw = rowtotal (vote_resp blood_resp litter_resp) fre experience_cw lab var experience_cw "experience_cw" recode experience_cw (1/3=1), gen(exp_cw) ta experience_cw exp_cw, m save "$procdta\cw8_panelcond.dta", replace *append for overall prevalences ******************************** use "$procdta\w4cw.dta", clear append using "$procdta\w6cw.dta" append using "$procdta\w7cw.dta" append using "$procdta\w8cw.dta" keep ID split estimate min95 max95 estis warner all label def estis 1 "(1)voter turnout" 2 "(2)blood donation" 3 "(3)littering" /// 4 "(4)keeping change" 5 "(5)jaywalking", modify lab val estis estis replace split=3 if estis==2 & split==0 replace split=4 if estis==2 & split==1 replace split=6 if estis==3 & split==0 replace split=7 if estis==3 & split==1 replace split=9 if estis==4 & split==0 replace split=10 if estis==4 & split==1 replace split=12 if estis==5 & split==0 replace split=13 if estis==5 & split==1 save "$procdta\cw_all_appended.dta", replace ta estimate estis, m *significance tests xi: rrreg all split if estis==1, pwarner(warner) xi: rrreg all split if estis==2, pwarner(warner) xi: rrreg all split if estis==3, pwarner(warner) xi: rrreg all split if estis==4, pwarner(warner) xi: rrreg all split if estis==5, pwarner(warner) xi: rrlogit all split if estis==1, pwarner(warner) //robustness checks xi: rrlogit all split if estis==2, pwarner(warner) xi: rrlogit all split if estis==3, pwarner(warner) xi: rrlogit all split if estis==4, pwarner(warner) xi: rrlogit all split if estis==5, pwarner(warner) ********************************************************************* *3) overall results ********************************************************************* *dot plot with overall rates (Figure 2) **************************************** set scheme s2mono eclplot estimate min95 max95 split, horizontal ysize(5) xsize(9) ylabel(0(1)13, angle(0)) yscale(range(-0.5 13.5)) /// ylabel(0 "(1) voter turnout DQ (n=280)" 1 "CM (n=533)" 3 "(2) blood donation DQ (n=360)" 4 "CM (n=667)" 6 "(3) littering DQ (n=351)" 7 "CM (n=940)" 9 "(4) keeping change DQ (n=169)" 10 "CM (n=627)" 12 "(5) jaywalking DQ (n=177)" 13 "CM (n=611)") /// xlabel(0(10)100) xtitle("percent") ytitle("") xline(50, lcolor(gs10) lpattern(dash)) /// estopts (mcolor(gs0)) /// ciopts(lc(gs10)) ciopts(lwidth(mediumthick)) /// graphregion(margin(15 15 5 5)) note(, span) graphregion(color(white)) graph export "$out\all prevalences.pdf", as(pdf) replace graph export "$out\all prevalences.tif", as(tif) replace ********************************************************************* *4) analyses on order experiments (Figure 3) ********************************************************************* *a) change use "$procdta\w8cw_order.dta", clear keep change_* fre change_cw1 change_cw2 drop if change_cw1==.f & change_cw2==.f gen min95 = . replace min95 = change_cw1_min95 *100 if change_cw1!=.f replace min95 = change_cw2_min95 *100 if change_cw2!=.f gen estimate = . replace estimate = change_cw1_phi *100 if change_cw1!=.f replace estimate = change_cw2_phi *100 if change_cw2!=.f gen max95 = . replace max95 = change_cw1_max95 *100 if change_cw1!=.f replace max95 = change_cw2_max95 *100 if change_cw2!=.f ta change_cw1 change_cw2, m gen split = change_cw1==.f //split indicates order lab var split "order of response categories" lab def split 0 "order 1: same first" 1 "order 2: different first", modify lab val split split bysort split: fre change_cw1 change_cw2 *Balkendiagramm gen all=. replace all = change_cw1 if split==0 replace all = change_cw2 if split==1 lab var all "" lab val all cw lab def cw 0 "different" 1 "same", modify *percentages ticked responses + signitests ******************************************* ta all split, col *significant difference? prtest all, by(split) prtest change_cw1==change_cw2 *stacked barchart ****************** set scheme s1mono preserve contract all split, nomiss zero bys split (all) : replace _freq = sum(_freq) bys split (all) : replace _freq = _freq/_freq[_N]*100 twoway bar _freq split if all == 1, barw(.5) lcolor(black) mlabel(split) || /// bar _freq split if all == 0, barw(.5) color(gs12) lcolor(black) /// ytitle(percentage that ticked response category, size(medium)) yscale(range(0 100)) ylab(0 (25)100, angle(0) grid) /// xscale(range(-.5/1.5)) xlab(0 1, val labsize(medlarge)) xtitle("") title("keeping change", size(vlarge)) subtitle("CM responses by order of response categories", size(large)) /// legend(order(1 "same" 2 "different")) /// text(75 0 "54.9" 25 0 "45.1" 75 1 "48.2" 25 1 "51.8", size(mediumsmall)) graph export "$out\keepchange_stacked.pdf", as(pdf) replace graph export "$out\keepchange_stacked.tif", as(tif) replace restore *Predicted Prevalences (eclplot) by order ****************************************** preserve collapse estimate min95 max95, by(split) eclplot estimate min95 max95 split, scale(1.3) ysize(7) xsize(8) ylabel(30(5)65, gmin gmax grid) ylabel(,angle(0)) ytick(30(5)65) /// xtick(0(1)1) xlabel(0 `" "order 1:" "same first" "(n=324)" "' 1 `" "order 2:" "different first" "(n=303)" "') xscale(range(-0.5 (0.5) 1.5)) /// xtitle ("") ytitle ("percentage that kept change") title("") subtitle("CM prevalence estimates" "by order of response categories") /// estopts (mcolor(gs0)) /// ciopts(lc(gs10) lwidth(mediumthick)) /// graphregion(margin(15 15 5 5)) note(, span) graphregion(color(white)) text(42.6 0.2 "42.6" 52.7 1.2 "52.7", size(small)) graph export "$out\keepchange_order.pdf", as(pdf) replace graph export "$out\keepchange_order.tif", as(tif) replace restore rrreg all split, pwarner(0.16666666666666667) rrlogit all split, pwarner(0.16666666666666667) //robustness check *b) Ampel use "$procdta\w8cw_order.dta", clear keep ampel_* fre ampel_cw1 ampel_cw2 drop if ampel_cw1==.f & ampel_cw2==.f gen min95 = . replace min95 = ampel_cw1_min95 *100 if ampel_cw1!=.f replace min95 = ampel_cw2_min95 *100 if ampel_cw2!=.f gen estimate = . replace estimate = ampel_cw1_phi *100 if ampel_cw1!=.f replace estimate = ampel_cw2_phi *100 if ampel_cw2!=.f gen max95 = . replace max95 = ampel_cw1_max95 *100 if ampel_cw1!=.f replace max95 = ampel_cw2_max95 *100 if ampel_cw2!=.f ta ampel_cw1 ampel_cw2, m gen split = ampel_cw1==.f //split indicates order lab var split "order of response categories" lab def split 0 "order 1: same first" 1 "order 2: different first", modify lab val split split bysort split: fre ampel_cw1 ampel_cw2 *Balkendiagramm gen all=. replace all = ampel_cw1 if split==0 replace all = ampel_cw2 if split==1 lab var all "" lab val all cw lab def cw 0 "different" 1 "same", modify *percentages ticked responses + signitests ******************************************* ta all split, col *significance prtest all, by(split) prtest ampel_cw1==ampel_cw2 *stacked barchart ****************** preserve contract all split, nomiss zero bys split (all) : replace _freq = sum(_freq) bys split (all) : replace _freq = _freq/_freq[_N]*100 twoway bar _freq split if all == 1, barw(.5) lcolor(black) mlabel(split) || /// bar _freq split if all == 0, barw(.5) color(gs12) lcolor(black) /// ytitle(percentage that ticked response category, size(medium)) yscale(range(0 100)) ylab(0 (25)100, angle(0) grid) /// xscale(range(-.5/1.5)) xlab(0 1, val labsize(medlarge)) xtitle("") title("jaywalking", size(vlarge)) subtitle("CM responses by order of response categories", size(large)) /// legend(order(1 "same" 2 "different")) /// text(87 0 "21.9" 40 0 "78.1" 87 1 "26.3" 40 1 "73.7", size(mediumsmall)) graph export "$out\jaywalking_stacked.pdf", as(pdf) replace graph export "$out\jaywalking_stacked.tif", as(tif) replace restore *Predicted Prevalences (eclplot) by order ****************************************** preserve collapse estimate min95 max95, by(split) eclplot estimate min95 max95 split, scale(1.3) ysize(7) xsize(8) ylabel(70(5)100, gmin gmax grid) ylabel(,angle(0)) ytick(70(5)100) /// xtick(0(1)1) xlabel(0 `" "order 1:" "same first" "(n=288)" "' 1 `" "order 2:" "different first" "(n=323)" "') xscale(range(-0.5 (0.5) 1.5)) /// xtitle ("") ytitle ("percentage that passed red light") title("") subtitle("CM estimates" "by order of response categories") /// estopts (mcolor(gs0)) /// ciopts(lc(gs10) lwidth(mediumthick)) /// graphregion(margin(15 15 5 5)) note(, span) graphregion(color(white)) text(92.2 0.2 "92.2" 85.5 1.2 "85.5", size(small)) graph export "$out\jaywalking_order.pdf", as(pdf) replace graph export "$out\jaywalking_order.tif", as(tif) replace restore rrreg all split, pwarner(0.16666666666666667) rrlogit all split, pwarner(0.16666666666666667) //robustness check ********************************************************************* *5) prevalence rates by experience (Table 3) ********************************************************************* use "$procdta\cw6_panelcond.dta", clear *prevalence rates (blood) for stuttgart_cw_resp = 0 vs 1 ********************************************************* sum blood_dq //DQ overall sum blood_cw //CW overall di (`r(mean)'+0.25-1)/(2*0.25-1) sum blood_cw if vote_resp==0 //CW without experience di (`r(mean)'+0.25-1)/(2*0.25-1) sum blood_cw if vote_resp==1 //CW with experience di (`r(mean)'+0.25-1)/(2*0.25-1) *Signitest xi: rrreg blood_cw vote_resp, pwarner(0.25) xi: rrlogit blood_cw vote_resp, pwarner(0.25) //robustness check *prevalence rates (jaywalking) for experience_cw = 0 vs 1-3 ************************************************************ use "$procdta\cw8_panelcond.dta", clear sum ampel_dq sum ampel_cw1 di (`r(mean)'+0.1667-1)/(2*0.1667-1) sum ampel_cw2 di (`r(mean)'+0.1667-1)/(2*0.1667-1) sum ampel_cw1 if exp_cw==0 di (`r(mean)'+0.1667-1)/(2*0.1667-1) sum ampel_cw1 if exp_cw==1 di (`r(mean)'+0.1667-1)/(2*0.1667-1) sum ampel_cw2 if exp_cw==0 di (`r(mean)'+0.1667-1)/(2*0.1667-1) sum ampel_cw2 if exp_cw==1 di (`r(mean)'+0.1667-1)/(2*0.1667-1) *Signitest xi: rrreg ampel_cw1 exp_cw, pwarner(0.1667) xi: rrreg ampel_cw2 exp_cw, pwarner(0.1667) xi: rrlogit ampel_cw1 exp_cw, pwarner(0.1667) //robustness check xi: rrlogit ampel_cw2 exp_cw, pwarner(0.1667) *robustness checks including sociodemography ********************************************** use "$procdta\cw6_panelcond.dta", clear ta blood_cw blood_dq, m rrreg blood_cw vote_resp, pwarner(0.25) xi: rrreg blood_cw d4_w6 i.age_w6 i.educ_w6 vote_resp, pwarner(0.25) rrlogit blood_cw vote_resp, pwarner(0.25) // robustness check xi: rrlogit blood_cw d4_w6 i.age_w6 i.educ_w6 vote_resp, pwarner(0.25) use "$procdta\cw8_panelcond.dta", clear dropmiss _all, force xi: rrreg ampel_cw1 exp_cw, pwarner(0.1667) xi: rrreg ampel_cw1 d4_w8 i.age_w8 i.educ_w8 exp_cw, pwarner(0.1667) xi: rrlogit ampel_cw1 exp_cw, pwarner(0.1667) // robustness check xi: rrlogit ampel_cw1 d4_w8 i.age_w8 i.educ_w8 exp_cw, pwarner(0.1667) xi: rrreg ampel_cw2 exp_cw, pwarner(0.1667) xi: rrreg ampel_cw2 d4_w8 i.age_w8 i.educ_w8 exp_cw, pwarner(0.1667) xi: rrlogit ampel_cw2 exp_cw, pwarner(0.1667) // robustness check xi: rrlogit ampel_cw2 d4_w8 i.age_w8 i.educ_w8 exp_cw, pwarner(0.1667) *learning effects for groups of similar sociodemographic background (Appendix A3) ********************************************************************************** ssc inst groups use "$procdta\cw6_panelcond.dta", clear keep if blood_cw!=.f groups d4_w6 age_w6 educ_w6 vote_resp *--> compare groups with more than 10 cases per equal socdem xi: rrreg blood_cw vote_resp if d4_w6==1 & age_w6==2 & educ_w6==0, pwarner(0.25) //male, 31-59, educ 0 xi: rrreg blood_cw vote_resp if d4_w6==1 & age_w6==2 & educ_w6==2, pwarner(0.25) //male, 31-59, educ 2 xi: rrreg blood_cw vote_resp if d4_w6==1 & age_w6==3 & educ_w6==0, pwarner(0.25) //male, 60+, educ 0 xi: rrreg blood_cw vote_resp if d4_w6==1 & age_w6==3 & educ_w6==2, pwarner(0.25) //male, 60+, educ 2 xi: rrreg blood_cw vote_resp if d4_w6==2 & age_w6==2 & educ_w6==0, pwarner(0.25) //female, 30-49, educ 0 xi: rrreg blood_cw vote_resp if d4_w6==2 & age_w6==2 & educ_w6==2, pwarner(0.25) //female, 30-49, educ 2 xi: rrreg blood_cw vote_resp if d4_w6==2 & age_w6==3 & educ_w6==0, pwarner(0.25) //female, 60+, educ 0 *Jaywalking order 1 ******************** use "$procdta\cw8_panelcond.dta", clear keep if ampel_cw1!=.f //only keep CW order1 cases sort d4_w8 age_w8 educ_w8 egen type = group (d4_w8 age_w8 educ_w8) groups type d4_w8 age_w8 educ_w8 exp_cw qui sum type qui foreach num of numlist 1/`r(max)' { di"" di "---------------------------------------------------------------------" di `num' sum type if type==`num' & exp_cw==0 local n`num'_0 = `r(N)' sum type if type==`num' & exp_cw==1 local n`num'_1 = `r(N)' capture xi: rrreg ampel_cw1 exp_cw if type==`num', pwarner(0.1667) local coef_`num' = round(_b[exp_cw], .01) di `coef_`num'' local p`num'=round(2*ttail(e(df_r),abs(_b[exp_cw]/_se[exp_cw])), .01) //t=coeff/se di `p`num'' } quietly sum type foreach num of numlist 1/`r(max)' { display _column(1) "type:"`num' _column(10) `n`num'_0' _column(20) `n`num'_1' /// _column(30) `coef_`num'' _column(40) `p`num'' } *Jaywalking order 2 ******************** use "$procdta\cw8_panelcond.dta", clear keep if ampel_cw2!=.f //only keep CW order2 cases sort d4_w8 age_w8 educ_w8 egen type = group (d4_w8 age_w8 educ_w8) groups type d4_w8 age_w8 educ_w8 exp_cw qui sum type qui foreach num of numlist 1/`r(max)' { di"" di "---------------------------------------------------------------------" di `num' sum type if type==`num' & exp_cw==0 local n`num'_0 = `r(N)' sum type if type==`num' & exp_cw==1 local n`num'_1 = `r(N)' capture xi: rrreg ampel_cw2 exp_cw if type==`num', pwarner(0.1667) local coef_`num' = round(_b[exp_cw], .01) local p`num'=round(2*ttail(e(df_r),abs(_b[exp_cw]/_se[exp_cw])), .01) //t=coeff/se di `p`num'' } sum type foreach num of numlist 1/`r(max)' { display _column(1) "type:"`num' _column(10) `n`num'_0' _column(20) `n`num'_1' /// _column(30) `coef_`num'' _column(40) `p`num'' } *Jaywalking: overall ignoring order ***************************** use "$procdta\cw8_panelcond.dta", clear fre ampel_cw keep if ampel_cw!=. //only keep CW sort d4_w8 age_w8 educ_w8 egen type = group (d4_w8 age_w8 educ_w8) groups type d4_w8 age_w8 educ_w8 exp_cw qui sum type qui foreach num of numlist 1/`r(max)' { di"" di "---------------------------------------------------------------------" di "type="`num' quietly sum type if type==`num' & exp_cw==0 local n`num'_0 = `r(N)' quietly sum type if type==`num' & exp_cw==1 local n`num'_1 = `r(N)' di "n(without/with experience)= " `n`num'_0' " / " `n`num'_1' capture xi: rrreg ampel_cw exp_cw if type==`num', pwarner(0.1667) local coef_`num' = round(_b[exp_cw], .01) di "coef (learning)= " `coef_`num'' local p`num'=round(2*ttail(e(df_r),abs(_b[exp_cw]/_se[exp_cw])), .01) //t=coeff/se di "p-value= " `p`num'' } sum type foreach num of numlist 1/`r(max)' { display _column(1) "type:"`num' _column(10) `n`num'_0' _column(20) `n`num'_1' /// _column(30) `coef_`num'' _column(40) `p`num'' }