**************************************** ***********Emergent Numeracy************ **********Emanuel Deutschmann*********** *****published in Acta Sociologica****** **************************************** ***Load ALLBUS dataset, available at https://www.gesis.org/allbus/download clear use "C:\Users\HP\Dropbox\Data\Allbus 1980-2016\ZA4586_v1-0-0.dta" ***Use probability weight wghtpew (Personenbezogenes Ost-West-Gewicht) to account for oversampling of East Germans in robustness check svyset [pweight = wghtpew] ***Keep only waves with the estimation task keep if year==1996 | year==2006 | year==2016 ************************ ***VARIABLE RECODINGS*** ************************ *Estimated share of foreigners West Germany tab mp13 tab mp13, nol *Estimated share of foreigners East Germany tab mp14 tab mp14, nol *Keep originals gen mp13_original = mp13 gen mp14_original = mp14 *Drop "don't knows" replace mp13=. if mp13==-9 | mp13==-8 replace mp14=. if mp14==-9 | mp14==-8 *Calculate the official share of foreigners over the three years under study weighting for the number of respondents in each year *West 10.915817 tab year if mp13!=. display (2298*0.10399739 + 2802*0.098907174 + 3151*0.122037501)/(2298+2802+3151) *East 5.347788 tab year if mp14!=. display (2141*0.037918016 + 2687*0.047405092 + 3121*0.069380239)/(2141+2687+3121) *Using only east and west german samples leads to same values when only one digit after the . is considered: *West 10.915826 tab year if mp13!=. & east==0 display (1640*0.10399739 + 1814*0.098907174 + 2101*0.122037501)/(1640+1814+2101) *East 5.36969 tab year if mp14!=. & east==1 display (659*0.037918016 + 1007*0.047405092 + 1067*0.069380239)/(659+1007+1067) *Generate overestimation variable for West German estimation task (Überschätzung) gen ueberschaetzung_west = mp13 - 10.399739 if year==1996 replace ueberschaetzung_west = mp13 - 9.8907174 if year==2006 replace ueberschaetzung_west = mp13 - 12.2037501 if year==2016 *Generate overestimation variable for East German estimation task (Überschätzung) gen ueberschaetzung_ost = mp14 - 3.7918016 if year==1996 replace ueberschaetzung_ost = mp14 - 4.7405092 if year==2006 replace ueberschaetzung_ost = mp14 - 6.9380239 if year==2016 ***Generate subgroups of strong rounders, weak rounders, all rounders and non-rounders gen strong_rounders_west = mp13 replace strong_rounders_west = . if mod(strong_rounders_west, 10) != 0 tab strong_rounders_west gen weak_rounders_west = mp13 replace weak_rounders_west = . if mod(weak_rounders_west, 5) != 0 replace weak_rounders_west = . if mod(weak_rounders_west, 10) == 0 tab weak_rounders_west gen all_rounders_west = mp13 replace all_rounders_west = . if mod(all_rounders_west, 5) != 0 tab all_rounders_west gen non_rounders_west = mp13 replace non_rounders_west = . if mod(non_rounders_west, 5) == 0 tab non_rounders_west gen strong_rounders_east = mp14 replace strong_rounders_east = . if mod(strong_rounders_east, 10) != 0 tab strong_rounders_east gen weak_rounders_east = mp14 replace weak_rounders_east = . if mod(weak_rounders_east, 5) != 0 replace weak_rounders_east = . if mod(weak_rounders_east, 10) == 0 tab weak_rounders_east gen all_rounders_east = mp14 replace all_rounders_east = . if mod(all_rounders_east, 5) != 0 tab all_rounders_east gen non_rounders_east = mp14 replace non_rounders_east = . if mod(non_rounders_east, 5) == 0 tab non_rounders_east ***Regression model dependent variables *version non-rounders against rounders and non-responders tab non_rounders_west gen nichtrund_west = non_rounders_west replace nichtrund_west=0 if non_rounders_west == . replace nichtrund_west=1 if nichtrund_west != 0 tab nichtrund_west tab non_rounders_east gen nichtrund_ost = non_rounders_east replace nichtrund_ost=0 if non_rounders_east == . replace nichtrund_ost=1 if nichtrund_ost != 0 tab nichtrund_ost *version non-rounders against rounders (USE!) gen nichtrund_west2 = non_rounders_west replace nichtrund_west2=1 if non_rounders_west != 0 & non_rounders_west !=. replace nichtrund_west2=0 if all_rounders_west != . tab nichtrund_west2 gen nichtrund_ost2 = non_rounders_east replace nichtrund_ost2=1 if non_rounders_east != 0 & non_rounders_east !=. replace nichtrund_ost2=0 if all_rounders_east != . tab nichtrund_ost2 ***Regression model independent variables *Age tab age tab age, nol replace age=. if age==-32 gen age2 = age^2 *Gender tab sex tab sex, nol gen female = 1 if sex==2 replace female = 0 if sex==1 tab female *Social class tab id02 tab id02, nol replace id02=. if id02==-50 | id02==-9 | id02==-8 | id02==-7 gen schicht = id02 *Respondent from Eastern Germany tab eastwest tab eastwest, nol gen east = 1 if eastwest==2 replace east = 0 if eastwest==1 tab east *Share of foreigners in the district tab gr01 tab gr01, nol gen auslaenderanteil_kreis = gr01 *Political orientation tab pa01 tab pa01, nol replace pa01=. if pa01==-9 gen politischeorientierung = 1 if pa01==1 | pa01==2 | pa01==3 | pa01==4 replace politischeorientierung = 2 if pa01==5 | pa01==6 replace politischeorientierung = 3 if pa01==7 | pa01==8 | pa01==9 | pa01==10 tab politischeorientierung label var politischeorientierung "Political orientation" label define politischeorientierung_lbl 1 "left" 2 "center" 3 "right", modify label values politischeorientierung politischeorientierung_lbl tab politischeorientierung, gen(po) gen left = politischeorientierung==1 gen center = politischeorientierung==2 gen right = politischeorientierung==3 *Political interest tab pa02a tab pa02a, nol replace pa02a=. if pa02a==-9 gen polinterest = pa02a tab polinterest ta polinterest, gen(pi) *Education *education 2 primary or lower 3 secondary 5 tertiary (incl. Fachhochschulreife) tab educ tab educ, nol replace educ=. if educ==-41 replace educ=. if educ==-9 replace educ=. if educ==6 replace educ=. if educ==7 replace educ=2 if educ==1 replace educ=5 if educ==4 tab educ, gen(educ) gen edu1 = educ==2 gen edu2 = educ==3 gen edu3 = educ==5 *Urban-rural tab gs01 tab gs01, nol *Respondent has German citizenship tab german tab german, nol replace german=. if german==-32 replace german=1 if german==2 replace german=0 if german==3 tab german *Year gen year1996 = year==1996 gen year2006 = year==2006 gen year2016 = year==2016 ta year, gen(year) ***Xenophobia replace mp01=. if mp01==-9 replace mp02=. if mp02==-9 replace mp03=. if mp03==-9 replace mp04=. if mp04==-9 replace mp05=. if mp05==-9 replace mp06=. if mp06==-9 replace mp07=. if mp07==-9 vreverse mp03, gen(mp03_reverse) vreverse mp05, gen(mp05_reverse) tab mp01 year tab mp02 year tab mp03 year tab mp04 year tab mp05 year tab mp06 year tab mp07 year **don't use because not available in 1996 **tab mp08 year tab ma01 year, nol tab ma02 year tab ma03 year tab ma04 year tab ma05 year tab ma06 year tab ma07 year *tab ma08 year tab ma09 year tab md06 *use factor mp02 mp03 mp04 mp05 mp06 mp07, pcf rotate predict xenophobia *histogram xenophobia **Contact with foreigners tab mc01 year tab mc02 year tab mc03 year tab mc04 year tab mc01 year, nol tab mc02 year, nol tab mc03 year, nol tab mc04 year, nol replace mc01=. if mc01==-9 | mc01==-10 replace mc02=. if mc02==-9 | mc02==-10 replace mc03=. if mc03==-9 | mc03==-10 replace mc04=. if mc04==-9 | mc04==-10 vreverse mc01, gen(mc01_reverse) vreverse mc02, gen(mc02_reverse) vreverse mc03, gen(mc03_reverse) vreverse mc04, gen(mc04_reverse) tab mc01_reverse year tab mc02_reverse year tab mc03_reverse year tab mc04_reverse year factor mc01_reverse mc02_reverse mc03_reverse mc04_reverse, pcf rotate predict contact_with_foreigners pwcorr auslaenderanteil_kreis contact_with_foreigners *don't use because a lot of people are lost in 2016 due to split tab mp15a year ***Media exposure *not available tab lm01 year *save "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica 2 (minor revisions)\ALLBUS_readytouse.dta" ************************** ***DESCRIPTIVE ANALYSES*** ************************** sum mp13 *-->Average estimatimated share of foreigners in West Germany: 19.95 sum mp14 *-->Average estimatimated share of foreigners in East Germany: 13.45 *share of don't knows/refuse to answer in West/question on West is 20.9 tab mp13_original if east==0 *share of don't knows/refuse to answer in East/question on East is 19.7 tab mp14_original if east==1 *non-rounders as a share of the whole sample, including "don't knows"/nonsponse: *unweighted: tab nichtrund_west tab nichtrund_ost *use: tab nichtrund_west if east==0 tab nichtrund_ost if east==1 tab mp13 tab mp14 tab mp13 if east==0 tab mp14 if east==1 sum mp13 if east==0 *-->Average estimatimated share of foreigners in West Germany, WEST GERMAN GUESSES ONLY: 19.68065 display 10.91581713 - 19.68065 *->Overestimation West if West German Guessers only: + 8.7648329 percentage points display 19.68065 / 10.91581713 *-> 1.8029479 -> +80.3 percent sum mp14 if east==1 *-->Average estimatimated share of foreigners in East Germany, EAST GERMAN GUESSES ONLY: 12.33516 display 5.3477882 - 12.33516 *Overeastimation East if East German Guessers only: + 6.9873718 percentage points display 12.33516 / 5.3477882 *->2.306591 -> + 130.7 percent *Supplementary material calculation of combined estimate for 2006 and 2016 bys year: sum mp13 if east==0 bys year: sum mp14 if east==1 display (20.74972 * 0.84) + (13.14101 * 0.16) display (20.80723 * 0.85) + (13.17619 * 0.15) tab ueberschaetzung_west if east==0 display 100 - 31.61 *->68.39 percent of West German respondents who give an estimate overestimate the share of foreigners in West Germany tab ueberschaetzung_ost if east==1 display 100 - 28.28 *71.72 percent of East German respondents who give an estimate overestimate the share of foreigners in East Germany ***rounders as a share of all respondents who make an estimate tab nichtrund_west2 if east==0 tab nichtrund_ost2 if east==1 ***Means (and standard deviations) if only those living in the region guess (main paper) sum non_rounders_west if east==0 *-> 11.28725 sum strong_rounders_west if east==0 *-> 23.91734 sum weak_rounders_west if east==0 *-> 18.93108 sum non_rounders_east if east==1 *-> 5.375479 sum strong_rounders_east if east==1 *-> 20.011 sum weak_rounders_east if east==1 *-> 12.70513 ***Deviations if only those living in the region guess (main paper) ***deviation non-rounders west: display 10.91581713 - 11.28725 *.37143287 ***deviation strong rounders west: display 10.91581713 - 23.91734 *13.001523 ***deviation weak rounders west: display 10.91581713 - 18.93108 *8.0152629 ***deviation non-rounders east: display 5.347788155 - 5.375479 *.02769085 ***deviation strong rounders east: display 5.347788155 - 20.011 *14.663212 ***deviation weak rounders east: display 5.347788155 - 12.70513 *7.3573418 ***Mean estimates of the different groups WITHOUT WEIGHTS (Supplementary Material, Figure S2) sum non_rounders_west bys year: sum non_rounders_west sum all_rounders_west bys year: sum all_rounders_west sum non_rounders_east bys year: sum non_rounders_east sum all_rounders_east bys year: sum all_rounders_east *share nonrounders in west german guess/sample display 1302/(1302+2831+1422) *.23438344 *share strong rounders in west german guess/sample display 2831/(1302+2831+1422) *.50963096 *share weak rounders in west german guess/sample display 1422/(1302+2831+1422) *.2559856 ***Mean estimates of the different groups WITH WEIGHTS (for Supplementary Material Figure S2) svy: mean non_rounders_west ***deviation nonrounders west: 10.9 - 11.19273 = 0.29 percent svy: mean strong_rounders_west ***deviation strong rounders west: 10.9 - 24.13506 = 13.24 percent svy: mean weak_rounders_west ***deviation weak rounders west: 10.9 - 18.88227 = 7.98 percent svy: mean non_rounders_east ***deviation nonrounders east: display 5.347788155-6.552161 *1.2043728 percent svy: mean strong_rounders_east ***deviation strong rounders east: display 5.347788155 - 20.99137 *15.643582 percent svy: mean weak_rounders_east ***deviation weak rounders east: display 5.347788155 - 13.4359 * 8.0881118 percent *Calculating the Whipple index separately for the two samples sum all_rounders_west if east==0 sum mp13 if east==0 display (4253/5555)*5 *3.8280828 *West: 383 sum all_rounders_east if east==1 sum mp14 if east==1 display (1689/2733)*5 *3.090011 *East: 309 *Figure 1A West Germany R&R GUESSES BY WEST GERMANS ONLY set scheme s1mono graph twoway kdensity mp13 if east==0, bwidth(6) legend(off) xline(19.68065, lpattern(solid) lcolor(black)) text(.04 100 "A") /// xline(10.915817, lcolor(sand) lwidth(2.5)) xline(10.915817, lcolor(sand*1.25)) lpattern(solid) color(black) /// ytitle("Kernel density") xtitle("") name(g1, replace) nodraw xtick(10(10)100) xmtick(5(10)95) /// text(0.004 8.6 "official value", orientation(vertical) size(vsmall)) /// text(0.008 18.4 "mean estimated value", orientation(vertical) size(vsmall)) /// text(0.039 16 "8.8%", size(vsmall)) graph twoway histogram strong_rounders_west if east==0, frequ discrete width(1) bcolor(dkgreen%90) || /// histogram weak_rounders_west if east==0, frequ discrete width(1) bcolor(midgreen*1.25) || /// histogram non_rounders_west if east==0, frequ discrete bcolor(navy%90) /// color(navy) xlabel(0(20)100) name(g2, replace) text(1000 100 "B") xtitle("") nodraw xtick(10(10)100) xmtick(5(10)95) /// legend(ring(0) position(1) col(1) region(color(none)) /// order(1 2 3) subtitle("Last digit:", size(small)) label(3 "non-round") label(1 "0") label(2 "5") size(small)) graph twoway kdensity strong_rounders_west if east==0, bwidth(10) xline(23.91734, /// lcolor(dkgreen) lpattern(--)) color(dkgreen) lpattern(--) text(.03 100 "C") /// xline(10.915817, lcolor(sand) lwidth(2.5)) xline(10.915817, lcolor(sand*1.25)) || /// kdensity weak_rounders_west if east==0, bwidth(10) xline(18.93108, lcolor(midgreen*1.25) lpattern(dash)) color(midgreen*1.25) lpattern(dash) || /// kdensity non_rounders_west if east==0, bwidth(10) lwidth(0.5) xline(11.28725, lcolor(dknavy) lwidth(0.5)) color(dknavy) lpattern(solid) /// ytitle("Kernel density") xtitle("Estimated share of foreigners in West Germany (in %)") name(g3, replace) nodraw /// xtick(10(10)100) xmtick(5(10)95) /// legend(ring(0) position(1) col(1) region(color(none)) order(1 2 3) subtitle("Last digit:", size(small)) /// label(3 "non-round") label(1 "0") label(2 "5") size(small)) graph combine g1 g2 g3, col(1) ysize(8.5) xsize(6) *Figure 1B East Germany GUESSES BY EAST GERMANS ONLY graph twoway kdensity mp14 if east==1, bwidth(6) legend(off) xline(12.33516, lpattern(solid) lcolor(black)) text(.04 100 "A") /// xline(5.347788, lcolor(sand) lwidth(2.5)) xline(5.347788, lcolor(sand*1.25)) lpattern(solid) color(black) /// ytitle("Kernel density") xtitle("") name(g1, replace) nodraw xtick(10(10)100) xmtick(5(10)95) /// text(0.004 3.2 "official value", orientation(vertical) size(vsmall)) /// text(0.008 11 "mean estimated value", orientation(vertical) size(vsmall)) /// text(0.026 9.5 "7.0%", size(vsmall)) graph twoway histogram strong_rounders_east if east==1, frequ discrete width(1) bcolor(dkgreen%90) || /// histogram weak_rounders_east if east==1, frequ discrete width(1) bcolor(midgreen*1.25) || /// histogram non_rounders_east if east==1, frequ discrete bcolor(navy%90) /// color(navy) xlabel(0(20)100) name(g2, replace) text(420 100 "B") xtitle("") nodraw xtick(10(10)100) xmtick(5(10)95) /// legend(ring(0) position(1) col(1) region(color(none)) /// order(1 2 3) subtitle("Last digit:", size(small)) label(3 "non-round") label(1 "0") label(2 "5") size(small)) graph twoway kdensity strong_rounders_east if east==1, bwidth(10) xline(20.011, lcolor(dkgreen) lpattern(--)) color(dkgreen) lpattern(--) text(.031 100 "C") /// xline(5.347788, lcolor(sand) lwidth(2.5)) xline(5.347788, lcolor(sand*1.25)) || /// kdensity weak_rounders_east if east==1, bwidth(10) xline(12.70513, lcolor(midgreen*1.25) lpattern(dash)) color(midgreen*1.25) lpattern(dash) || /// kdensity non_rounders_east if east==1, bwidth(10) lwidth(0.5) xline(5.375479, lcolor(dknavy) lwidth(0.5)) color(dknavy) lpattern(solid) /// ytitle("Kernel density") xtitle("Estimated share of foreigners in East Germany (in %)") name(g3, replace) nodraw /// xtick(10(10)100) xmtick(5(10)95) /// legend(ring(0) position(1) col(1) region(color(none)) order(1 2 3) subtitle("Last digit:", size(small)) /// label(3 "non-round") label(1 "0") label(2 "5") size(small)) graph combine g1 g2 g3, col(1) ysize(8.5) xsize(6) ***Supplementary Material Figure S2: Different official values graph twoway kdensity strong_rounders_west if strong_rounders_west<50, bwidth(10) /// xline(24.2837, lcolor(dkgreen) lwidth(0.2) lpattern(--)) lcolor(none) /// strong rounders non-weighted xline(24.13506, lcolor(dkgreen) lwidth(0.2) lpattern(--)) lcolor(none) /// strong rounders weighted xline(23.91734, lcolor(dkgreen) lwidth(0.2) lpattern(--)) lcolor(none) /// strong rounders non-weighted, only Western Germans xline(5.92, lcolor(sand*1.25) lwidth(0.2) lpattern(shortdash)) /// lowest value -5 percent xline(9.92, lcolor(sand*1.25) lwidth(0.2) lpattern(shortdash)) /// lowest value - 1 percent xline(10.99, lcolor(sand%40) lwidth(4.8)) /// 1 percent background range xline(10.99, lcolor(sand%40) lwidth(20.5)) /// 5 percent background range xline(10.92, lcolor(sand*1.25) lwidth(0.2)) /// Destatis 2007, 2018 Bevölkerungsfortschreibung xline(11.06, lcolor(sand*1.25) lwidth(0.2)) /// Destatis 2007, 2018 Bevölkerungsfortschreibung+AZR xline(10.97, lcolor(sand*1.25) lwidth(0.2)) /// Destatis 2024 xline(12.06, lcolor(sand*1.25) lwidth(0.2) lpattern(shortdash)) /// highest value + 1 percent xline(16.06, lcolor(sand*1.25) lwidth(0.2) lpattern(shortdash)) /// highest value + 5 percent xline(18.85076, lcolor(midgreen*1.25) lpattern(dash) lwidth(0.2)) /// weak rounders non-weighted xline(18.88227, lcolor(midgreen*1.25) lpattern(dash) lwidth(0.2)) /// weak rounders weighted xline(18.93108, lcolor(midgreen*1.25) lpattern(dash) lwidth(0.2)) /// weak rounders non-weighted, only Western Germans xline(11.10028, lcolor(dknavy) lwidth(0.2)) /// non-rounders non-weighted xline(11.19273, lcolor(dknavy) lwidth(0.2)) /// non-rounders weighted xline(11.28725, lcolor(dknavy) lwidth(0.2)) /// non-rounders non-weighted, only Western Germans ytitle("") xtitle("Estimated share of foreigners in West Germany (in %)") name(g1, replace) /// xtick(10(10)50) xmtick(5(10)45) xlabel(-5(5)50) nodraw /// legend(ring(0) position(1) col(1) region(color(none)) order(1 2 3) subtitle("Last digit:", size(small)) /// label(3 "non-round") label(1 "0") label(2 "5") size(small)) graph twoway kdensity strong_rounders_east if strong_rounders_east<50, bwidth(10) /// xline(20.8225, lcolor(dkgreen) lwidth(0.2) lpattern(--)) color(none) /// strong rounders non-weighted xline(20.99137, lcolor(dkgreen) lwidth(0.2) lpattern(--)) color(none) /// strong rounders weighted xline(20.011, lcolor(dkgreen) lwidth(0.2) lpattern(--)) color(none) /// strong rounders non-weighted, only East Germans xline(10.347788, lcolor(sand*1.25) lpattern(shortdash) lwidth(0.2)) /// highest value + 5 percent xline(6.347788, lcolor(sand*1.25) lpattern(shortdash) lwidth(0.2)) /// highest value + 1 percent xline(5.347788, lcolor(sand*1.25) lwidth(0.2)) /// Destatis 2007, 2018 Bevölkerungsfortschreibung xline(5.13, lcolor(sand*1.25) lwidth(0.2)) /// Destatis 2007, 2018 Bevölkerungsfortschreibung+AZR xline(4.00, lcolor(sand*1.25) lwidth(0.2)) /// Mix (2016 incl Berlin, before without) xline(2.91, lcolor(sand*1.25) lwidth(0.2)) /// Destatis 2007, 2018 Bevölkerungsfortschreibung WITHOUT Berlin xline(2.81, lcolor(sand*1.25) lwidth(0.2)) /// Destatis 2007, 2018 Bevölkerungsfortschreibung+AZR WITHOUT Berlin xline(3.05, lcolor(sand*1.25) lwidth(0.2)) /// Destatis 2024 xline(1.81, lcolor(sand*1.25) lwidth(0.2) lpattern(shortdash)) /// lowest value - 1 percent xline(-2.19, lcolor(sand*1.25) lwidth(0.2) lpattern(shortdash)) /// lowest value - 5 percent xline(13.30385, lcolor(midgreen*1.25) lpattern(dash) lwidth(0.2)) /// weak rounders non-weighted xline(13.4359, lcolor(midgreen*1.25) lpattern(dash) lwidth(0.2)) /// weak rounders weighted xline(12.70513, lcolor(midgreen*1.25) lpattern(dash) lwidth(0.2)) /// weak rounders non-weighted, only East Germans xline(4.078894, lcolor(sand%40) lwidth(9.5)) /// 1 percent background range xline(4.078894, lcolor(sand%40) lwidth(24.9)) /// 5 percent background range xline(6.32425, lcolor(dknavy) lwidth(0.2)) /// non-rounders non-weighted xline(6.552161, lcolor(dknavy) lwidth(0.2)) /// non-rounders weighted xline(5.375479, lcolor(dknavy) lwidth(0.2)) /// non-rounders non-weighted, only East Germans ytitle("") xtitle("Estimated share of foreigners in East Germany (in %)") name(g2, replace) /// xtick(10(10)50) xmtick(5(10)45) /// legend(ring(0) position(1) col(1) region(color(none)) order(1 2 3) subtitle("Last digit:", size(small)) /// label(3 "non-round") label(1 "0") label(2 "5") size(small)) nodraw /// xlabel(-5(5)50) graph combine g1 g2, row(2) ysize(8.5) xsize(6) *--> add labels manually in Graph editor *********************** ***REGRESSION MODELS*** *********************** ***Table 1 char year[omit] 2006 char schicht[omit] 4 char educ[omit] 2 char polinterest[omit] 5 char politischeorientierung[omit] 3 quietly: xi: logit nichtrund_west2 i.educ i.politischeorientierung i.polinterest age female german i.year if east==0 estimates store west1 quietly: xi: logit nichtrund_west2 i.educ i.politischeorientierung i.polinterest age female xenophobia contact_with_foreigners auslaenderanteil_kreis i.year if east==0 estimates store west2 quietly: xi: logit nichtrund_ost2 i.educ i.politischeorientierung i.polinterest age female german i.year if east==1 estimates store east1 quietly: xi: logit nichtrund_ost2 i.educ i.politischeorientierung i.polinterest age female xenophobia contact_with_foreigners auslaenderanteil_kreis i.year if east==1 estimates store east2 estout west1 west2 east1 east2, cells(b(star fmt(%9.3f))) /// stats(chi2 bic r2_p N, labels(Chi² BIC Pseudo-R² N)) unstack *Predicted probabilities based on model 2 (West Germany) quietly: *drop b1-b16 xi: estsimp logit nichtrund_west2 educ2 educ3 po1 po2 pi1 pi2 pi3 pi4 age female xenophobia contact_with_foreigners auslaenderanteil_kreis year1 year3 if east==0 *Hypothetical respondent Holger setx educ2 0 educ3 1 po1 1 po2 0 pi1 1 pi2 0 pi3 0 pi4 0 age 60 female 0 xenophobia p5 contact_with_foreigners mean auslaenderanteil_kreis mean year1 0 year3 0 simqi *Hypothetical respondent Jennifer setx educ2 1 educ3 0 po1 0 po2 0 pi1 0 pi2 0 pi3 0 pi4 0 age 25 female 1 xenophobia p95 contact_with_foreigners mean auslaenderanteil_kreis mean year1 0 year3 0 simqi ***Supplementary Material Table S9 char year[omit] 2006 char schicht[omit] 4 char educ[omit] 2 char polinterest[omit] 5 char politischeorientierung[omit] 3 quietly: xi: logit nichtrund_west2 i.educ i.politischeorientierung i.polinterest age female east german i.year estimates store west1 quietly: xi: logit nichtrund_west2 i.educ i.politischeorientierung i.polinterest age female east xenophobia contact_with_foreigners auslaenderanteil_kreis i.year estimates store west2 quietly: xi: logit nichtrund_ost2 i.educ i.politischeorientierung i.polinterest age female east german i.year estimates store east1 quietly: xi: logit nichtrund_ost2 i.educ i.politischeorientierung i.polinterest age female east xenophobia contact_with_foreigners auslaenderanteil_kreis i.year estimates store east2 estout west1 west2 east1 east2, cells(b(star fmt(%9.3f))) /// stats(chi2 bic r2_p N, labels(Chi² BIC Pseudo-R² N)) unstack ***Supplementary Material, Table S3: by year, entire ALLBUS sample, non-weighted dtable nichtrund_west2 nichtrund_ost2 i.educ i.politischeorientierung i.polinterest age female east german xenophobia contact_with_foreigners auslaenderanteil_kreis, by(year, tests) sample(, place(seplabels)) sformat("(N=%s)" frequency) nformat(%7.2f mean sd) export(descriptives_totalbyyear.docx, replace) ***Supplementary Material, Table S4: by year, WEST only; those who guess in the West only dtable nichtrund_west2 nichtrund_ost2 i.educ i.politischeorientierung i.polinterest age female east german xenophobia contact_with_foreigners auslaenderanteil_kreis if east==0 & mp13!=., by(year, tests) sample(, place(seplabels)) sformat("(N=%s)" frequency) nformat(%7.2f mean sd) export(descriptives_WESTbyyear.docx, replace) ***Supplementary Material, Table S5: by year EAST only; those who guess in the East only dtable nichtrund_west2 nichtrund_ost2 i.educ i.politischeorientierung i.polinterest age female east german xenophobia contact_with_foreigners auslaenderanteil_kreis if east==1 & mp14!=., by(year, tests) sample(, place(seplabels)) sformat("(N=%s)" frequency) nformat(%7.2f mean sd) export(descriptives_EASTbyyear.docx, replace) ***Supplementary Material, Table S6: by rounder-non-rounder, West German sample with an estimate only dtable i.educ i.politischeorientierung i.polinterest age female east german i.year xenophobia contact_with_foreigners auslaenderanteil_kreis if east==0 & mp13!=., by(nichtrund_west2, tests nototal) sample(, place(seplabels)) sformat("(N=%s)" frequency) nformat(%7.2f mean sd) export(descriptives_roundernonrounderWEST.docx, replace) ***Supplementary Material, Table S7: by rounder-non-rounder, East German sample with an estimate only dtable i.educ i.politischeorientierung i.polinterest age female east german i.year xenophobia contact_with_foreigners auslaenderanteil_kreis if east==1 & mp14!=., by(nichtrund_ost2, tests nototal) sample(, place(seplabels)) sformat("(N=%s)" frequency) nformat(%7.2f mean sd) export(descriptives_roundernonrounderOST.docx, replace) ***Supplementary Material, Figure S3 graph twoway kdensity non_rounders_west if east==0, bwidth(4) yaxis(1) ytitle("Density") ylabel(0(.05).25) || /// histogram non_rounders_west if east==0, bcolor(%50) yaxis(1) /// discrete color(navy) xlabel(0(20)100) name(g1, replace) /// xtitle("Estimated share of foreigners (in %)") /// title(A. West Germany) legend(off) graph twoway kdensity non_rounders_east if east==1, bwidth(4) ytitle("Density") ylabel(0(.05).25) || /// histogram non_rounders_east if east==1, bcolor(%50) /// discrete color(navy) xlabel(0(20)100) name(g2, replace) /// xtitle("Estimated share of foreigners (in %)") /// title(B. East Germany) legend(off) graph combine g1 g2, row(2) ysize(16) xsize(12) altshrink ***Supplementary Material, Figure S4 graph twoway kdensity non_rounders_west if east==0, bwidth(4) area(1302) ytitle("Frequency") || /// histogram all_rounders_west if east==0, frequ discrete width(1) bcolor(green%70) || /// histogram non_rounders_west if east==0, frequ discrete bcolor(%20) legend(off) /// color(navy) xlabel(0(20)100) name(g3, replace) /// xtitle("Estimated share of foreigners (in %)") /// title(A. West Germany) legend(off) graph twoway kdensity non_rounders_east if east==1, bwidth(4) area(1044) ytitle("Frequency") || /// histogram all_rounders_east if east==1, frequ discrete width(1) bcolor(green%70) || /// histogram non_rounders_east if east==1, frequ discrete bcolor(%20) legend(off) /// color(navy) xlabel(0(20)100) name(g4, replace) /// xtitle("Estimated share of foreigners (in %)") /// title(B. East Germany) legend(off) graph combine g3 g4, row(2) ysize(16) xsize(12) altshrink *use total number of non-rounders to fill area: sum non_rounders_west sum non_rounders_east sum non_rounders_west if east==0 sum non_rounders_east if east==1 ***Supplementary Material Figure S1: *Mean estimates by year of the different groups separately for East West bys year: sum non_rounders_west if east==0 sum non_rounders_west if east==0 bys year: sum all_rounders_west if east==0 sum all_rounders_west if east==0 bys year: sum non_rounders_east if east==1 sum non_rounders_east if east==1 bys year: sum all_rounders_east if east==1 sum all_rounders_east if east==1 *->transmit manually to "summarystats_acrosswaves.xlsx" *Create figure clear set scheme s1mono import excel "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\summarystats_acrosswaves.xlsx", sheet("Tabelle1") firstrow graph hbar deviation_rounders if eastwest_separate=="yes", over(yearplace, sort(order)) bar(1, color(navy8)) /// title("A. Rounders", box bexpand) ytitle("Deviation from official statistic (%)") name(g1, replace) nodraw /// yline(0, lcolor(sand*0.4) lwidth(12)) yline(0, lcolor(sand) lwidth(2.5)) yline(0, lcolor(sand*1.25)) /// yline(-10, lcolor(white)) yline(10, lcolor(white)) yline(20, lcolor(white)) ylabel(-10(10)30) graph hbar deviation_nonrounders if eastwest_separate=="yes", over(yearplace, sort(order)) bar(1, color(navy8)) /// title("B. Non-rounders", box bexpand) ytitle("Deviation from official statistic (%)") name(g2, replace) nodraw /// yline(0, lcolor(sand*0.4) lwidth(12)) yline(0, lcolor(sand) lwidth(2.5)) yline(0, lcolor(sand*1.25)) /// yline(-10, lcolor(white)) yline(10, lcolor(white)) yline(20, lcolor(white)) ylabel(-10(10)30) graph combine g1 g2, xcommon **************** ***SIMULATION*** **************** *SD 5 clear set scheme s1mono // Create a temporary dataset to store results tempfile results save `results', emptyok // Loop from mean 0 to mean 100 forvalues i = 0(1)100 { drawnorm A, n(10000) means(`i') sds(5) // Processing weak_rounders gen weak_rounders = round(A) drop if weak_rounders <= 0 | weak_rounders >= 100 replace weak_rounders = . if mod(weak_rounders, 5) != 0 replace weak_rounders = . if mod(weak_rounders, 10) == 0 // Calculate mean for weak_rounders sum weak_rounders local mean_weak = r(mean) // Processing all_rounders gen all_rounders = round(A) drop if all_rounders <= 0 | all_rounders >= 100 replace all_rounders = . if mod(all_rounders, 5) != 0 // Calculate mean for all_rounders sum all_rounders local mean_all = r(mean) // Processing strong_rounders gen strong_rounders = round(A) drop if strong_rounders <= 0 | strong_rounders >= 100 replace strong_rounders = . if mod(strong_rounders, 10) != 0 // Calculate mean for strong_rounders sum strong_rounders local mean_strong = r(mean) // Processing nonrounders gen nonrounders = round(A) drop if nonrounders <= 0 | nonrounders >= 100 replace nonrounders = . if mod(nonrounders, 5) == 0 // Calculate mean for nonrounders sum nonrounders local mean_non = r(mean) // Processing full sample group gen full_sample = A // Calculate mean for full_sample sum full_sample local mean_full = r(mean) // Create a biased sample with 25% non_rounders, 25% weak_rounders, and 50% strong_rounders gen combined_sample = . replace combined_sample = nonrounders if _n <= 0.25 * _N replace combined_sample = weak_rounders if _n > 0.25 * _N & _n <= 0.5 * _N replace combined_sample = strong_rounders if _n > 0.5 * _N // Calculate mean for combined_sample sum combined_sample local mean_combined = r(mean) // Create a dataset with the current results clear set obs 1 gen mean_shift = `i' gen mean_weak_rounders = `mean_weak' gen mean_strong_rounders = `mean_strong' gen mean_all_rounders = `mean_all' gen mean_nonrounders = `mean_non' gen mean_full_sample = `mean_full' gen mean_combined_sample = `mean_combined' // Append the current results to the temporary results dataset append using `results' save `results', replace } // Load the final results dataset and save it permanently clear use `results' save "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd5_fixed.dta", replace *Supplementary Material, Figure S9: Simulation graph weak rounders *SD 5 clear use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd5_fixed.dta" gen deviation_strong_rounders = abs(mean_shift - mean_strong_rounders) gen deviation_weak_rounders = abs(mean_shift - mean_weak_rounders) gen deviation_all_rounders = abs(mean_shift - mean_all_rounders) gen deviation_non_rounders = abs(mean_shift - mean_nonrounders) gen deviation_full_sample = abs(mean_shift - mean_full_sample) gen deviation_combined_sample = abs(mean_shift - mean_combined_sample) label variable deviation_strong_rounders "strong rounders" label variable deviation_weak_rounders "weak rounders" label variable deviation_all_rounders "all rounders" label variable deviation_non_rounders "non-rounders" label variable deviation_full_sample "full sample" label variable deviation_combined_sample "biased sample" graph twoway line deviation_strong_rounders mean_shift, lcolor(dkgreen%30) || /// line deviation_weak_rounders mean_shift, lpattern(dash) lcolor(dkgreen%80) || /// line deviation_all_rounders mean_shift, lpattern(dash) lcolor(dkgreen%30) || /// line deviation_non_rounders mean_shift, lpattern(longdash) lcolor(dk_navy%30) || /// line deviation_combined_sample mean_shift, lpattern(dot) lcolor(black%30) || /// line deviation_full_sample mean_shift, lpattern(shortdash) lcolor(cranberry%30) legend(off) xlabel(0(10)100) /// ytitle("deviation of the mean from the center") xtitle(center of the normal distribution) /// text(7 82 "weak rounders", color(dkgreen%80)) /// xline(5 10 90 95, lpattern(dot)) name(g1, replace) nodraw ciplot deviation_strong_rounders deviation_all_rounders deviation_weak_rounders deviation_combined_sample deviation_full_sample deviation_non_rounders if mean_shift>14 & mean_shift<86, title("Average deviation in the 15 to 85 range") name(g2, replace) nodraw ciplot deviation_strong_rounders deviation_all_rounders deviation_weak_rounders deviation_combined_sample deviation_full_sample deviation_non_rounders if mean_shift>89 & mean_shift<96 | mean_shift>4 & mean_shift<11, title("Average deviation in the 5 to 10 and 90 to 95 range") name(g3, replace) nodraw graph combine g2 g3, col(1) name(g23, replace) nodraw graph combine g1 g23, col(1) ysize(12) xsize(8.5) sum deviation_strong_rounders deviation_weak_rounders deviation_non_rounders if mean_shift>14 & mean_shift<86 *Figure 3: Simulation graph *SD 5 clear use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd5_fixed.dta" gen deviation_strong_rounders = abs(mean_shift - mean_strong_rounders) gen deviation_weak_rounders = abs(mean_shift - mean_weak_rounders) gen deviation_all_rounders = abs(mean_shift - mean_all_rounders) gen deviation_non_rounders = abs(mean_shift - mean_nonrounders) gen deviation_full_sample = abs(mean_shift - mean_full_sample) gen deviation_combined_sample = abs(mean_shift - mean_combined_sample) label variable deviation_strong_rounders "strong rounders" label variable deviation_weak_rounders "weak rounders" label variable deviation_all_rounders "all rounders" label variable deviation_non_rounders "non-rounders" label variable deviation_full_sample "full sample" label variable deviation_combined_sample "biased sample" *main plot graph twoway line deviation_strong_rounders mean_shift, lcolor(dkgreen) || /// line deviation_all_rounders mean_shift, lpattern(dash) lcolor(dkgreen%80) || /// line deviation_non_rounders mean_shift, lpattern(longdash) lcolor(dk_navy) || /// line deviation_combined_sample mean_shift, lpattern(dot) lcolor(black) || /// line deviation_full_sample mean_shift, lpattern(shortdash) lcolor(cranberry) legend(off) xlabel(0(10)100) /// ytitle("deviation of the mean from the center") xtitle(center of the normal distribution) /// text(9 85 "strong rounders", color(dkgreen)) /// text(7 85 "all rounders", color(dkgreen%80)) /// text(5 80 "biased sample", color(black)) /// text(3 80 "full sample", color(cranberry)) /// text(2 75 "non-rounders", color(dknavy)) *inset ciplot deviation_strong_rounders deviation_all_rounders deviation_combined_sample deviation_non_rounders deviation_full_sample if mean_shift>14 & mean_shift<86, title("Average deviation in the 15 to 85 range") xlabel(, angle(45)) *inset for supplementary graph ciplot deviation_strong_rounders deviation_all_rounders deviation_combined_sample deviation_non_rounders deviation_full_sample if mean_shift>14 & mean_shift<86, title("Average deviation in the 15 to 85 range") graph save "Graph" "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd5.gph", replace sum deviation_strong_rounders deviation_weak_rounders deviation_non_rounders if mean_shift>14 & mean_shift<86 *SD 10 clear set scheme s1mono // Create a temporary dataset to store results tempfile results save `results', emptyok // Loop from mean 0 to mean 100 forvalues i = 0(1)100 { drawnorm A, n(10000) means(`i') sds(10) // Processing weak_rounders gen weak_rounders = round(A) drop if weak_rounders <= 0 | weak_rounders >= 100 replace weak_rounders = . if mod(weak_rounders, 5) != 0 replace weak_rounders = . if mod(weak_rounders, 10) == 0 // Calculate mean for weak_rounders sum weak_rounders local mean_weak = r(mean) // Processing all_rounders gen all_rounders = round(A) drop if all_rounders <= 0 | all_rounders >= 100 replace all_rounders = . if mod(all_rounders, 5) != 0 // Calculate mean for all_rounders sum all_rounders local mean_all = r(mean) // Processing strong_rounders gen strong_rounders = round(A) drop if strong_rounders <= 0 | strong_rounders >= 100 replace strong_rounders = . if mod(strong_rounders, 10) != 0 // Calculate mean for strong_rounders sum strong_rounders local mean_strong = r(mean) // Processing nonrounders gen nonrounders = round(A) drop if nonrounders <= 0 | nonrounders >= 100 replace nonrounders = . if mod(nonrounders, 5) == 0 // Calculate mean for nonrounders sum nonrounders local mean_non = r(mean) // Processing full sample group gen full_sample = A // Calculate mean for full_sample sum full_sample local mean_full = r(mean) // Create a biased sample with 25% non_rounders, 25% weak_rounders, and 50% strong_rounders gen combined_sample = . replace combined_sample = nonrounders if _n <= 0.25 * _N replace combined_sample = weak_rounders if _n > 0.25 * _N & _n <= 0.5 * _N replace combined_sample = strong_rounders if _n > 0.5 * _N // Calculate mean for combined_sample sum combined_sample local mean_combined = r(mean) // Create a dataset with the current results clear set obs 1 gen mean_shift = `i' gen mean_weak_rounders = `mean_weak' gen mean_strong_rounders = `mean_strong' gen mean_all_rounders = `mean_all' gen mean_nonrounders = `mean_non' gen mean_full_sample = `mean_full' gen mean_combined_sample = `mean_combined' // Append the current results to the temporary results dataset append using `results' save `results', replace } // Load the final results dataset and save it permanently clear use `results' save "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd10.dta", replace *SD 15 clear set scheme s1mono // Create a temporary dataset to store results tempfile results save `results', emptyok // Loop from mean 0 to mean 100 forvalues i = 0(1)100 { drawnorm A, n(10000) means(`i') sds(15) // Processing weak_rounders gen weak_rounders = round(A) drop if weak_rounders <= 0 | weak_rounders >= 100 replace weak_rounders = . if mod(weak_rounders, 5) != 0 replace weak_rounders = . if mod(weak_rounders, 10) == 0 // Calculate mean for weak_rounders sum weak_rounders local mean_weak = r(mean) // Processing all_rounders gen all_rounders = round(A) drop if all_rounders <= 0 | all_rounders >= 100 replace all_rounders = . if mod(all_rounders, 5) != 0 // Calculate mean for all_rounders sum all_rounders local mean_all = r(mean) // Processing strong_rounders gen strong_rounders = round(A) drop if strong_rounders <= 0 | strong_rounders >= 100 replace strong_rounders = . if mod(strong_rounders, 10) != 0 // Calculate mean for strong_rounders sum strong_rounders local mean_strong = r(mean) // Processing nonrounders gen nonrounders = round(A) drop if nonrounders <= 0 | nonrounders >= 100 replace nonrounders = . if mod(nonrounders, 5) == 0 // Calculate mean for nonrounders sum nonrounders local mean_non = r(mean) // Processing full sample group gen full_sample = A // Calculate mean for full_sample sum full_sample local mean_full = r(mean) // Create a biased sample with 25% non_rounders, 25% weak_rounders, and 50% strong_rounders gen combined_sample = . replace combined_sample = nonrounders if _n <= 0.25 * _N replace combined_sample = weak_rounders if _n > 0.25 * _N & _n <= 0.5 * _N replace combined_sample = strong_rounders if _n > 0.5 * _N // Calculate mean for combined_sample sum combined_sample local mean_combined = r(mean) // Create a dataset with the current results clear set obs 1 gen mean_shift = `i' gen mean_weak_rounders = `mean_weak' gen mean_strong_rounders = `mean_strong' gen mean_all_rounders = `mean_all' gen mean_nonrounders = `mean_non' gen mean_full_sample = `mean_full' gen mean_combined_sample = `mean_combined' // Append the current results to the temporary results dataset append using `results' save `results', replace } // Load the final results dataset and save it permanently clear use `results' save "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd15.dta", replace *SD 2.5 clear set scheme s1mono // Create a temporary dataset to store results tempfile results save `results', emptyok // Loop from mean 0 to mean 100 forvalues i = 0(1)100 { drawnorm A, n(10000) means(`i') sds(2.5) // Processing weak_rounders gen weak_rounders = round(A) drop if weak_rounders <= 0 | weak_rounders >= 100 replace weak_rounders = . if mod(weak_rounders, 5) != 0 replace weak_rounders = . if mod(weak_rounders, 10) == 0 // Calculate mean for weak_rounders sum weak_rounders local mean_weak = r(mean) // Processing all_rounders gen all_rounders = round(A) drop if all_rounders <= 0 | all_rounders >= 100 replace all_rounders = . if mod(all_rounders, 5) != 0 // Calculate mean for all_rounders sum all_rounders local mean_all = r(mean) // Processing strong_rounders gen strong_rounders = round(A) drop if strong_rounders <= 0 | strong_rounders >= 100 replace strong_rounders = . if mod(strong_rounders, 10) != 0 // Calculate mean for strong_rounders sum strong_rounders local mean_strong = r(mean) // Processing nonrounders gen nonrounders = round(A) drop if nonrounders <= 0 | nonrounders >= 100 replace nonrounders = . if mod(nonrounders, 5) == 0 // Calculate mean for nonrounders sum nonrounders local mean_non = r(mean) // Processing full sample group gen full_sample = A // Calculate mean for full_sample sum full_sample local mean_full = r(mean) // Create a biased sample with 25% non_rounders, 25% weak_rounders, and 50% strong_rounders gen combined_sample = . replace combined_sample = nonrounders if _n <= 0.25 * _N replace combined_sample = weak_rounders if _n > 0.25 * _N & _n <= 0.5 * _N replace combined_sample = strong_rounders if _n > 0.5 * _N // Calculate mean for combined_sample sum combined_sample local mean_combined = r(mean) // Create a dataset with the current results clear set obs 1 gen mean_shift = `i' gen mean_weak_rounders = `mean_weak' gen mean_strong_rounders = `mean_strong' gen mean_all_rounders = `mean_all' gen mean_nonrounders = `mean_non' gen mean_full_sample = `mean_full' gen mean_combined_sample = `mean_combined' // Append the current results to the temporary results dataset append using `results' save `results', replace } // Load the final results dataset and save it permanently clear use `results' save "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd2.5.dta", replace *SD 20 clear set scheme s1mono // Create a temporary dataset to store results tempfile results save `results', emptyok // Loop from mean 0 to mean 100 forvalues i = 0(1)100 { drawnorm A, n(10000) means(`i') sds(20) // Processing weak_rounders gen weak_rounders = round(A) drop if weak_rounders <= 0 | weak_rounders >= 100 replace weak_rounders = . if mod(weak_rounders, 5) != 0 replace weak_rounders = . if mod(weak_rounders, 10) == 0 // Calculate mean for weak_rounders sum weak_rounders local mean_weak = r(mean) // Processing all_rounders gen all_rounders = round(A) drop if all_rounders <= 0 | all_rounders >= 100 replace all_rounders = . if mod(all_rounders, 5) != 0 // Calculate mean for all_rounders sum all_rounders local mean_all = r(mean) // Processing strong_rounders gen strong_rounders = round(A) drop if strong_rounders <= 0 | strong_rounders >= 100 replace strong_rounders = . if mod(strong_rounders, 10) != 0 // Calculate mean for strong_rounders sum strong_rounders local mean_strong = r(mean) // Processing nonrounders gen nonrounders = round(A) drop if nonrounders <= 0 | nonrounders >= 100 replace nonrounders = . if mod(nonrounders, 5) == 0 // Calculate mean for nonrounders sum nonrounders local mean_non = r(mean) // Processing full sample group gen full_sample = A // Calculate mean for full_sample sum full_sample local mean_full = r(mean) // Create a biased sample with 25% non_rounders, 25% weak_rounders, and 50% strong_rounders gen combined_sample = . replace combined_sample = nonrounders if _n <= 0.25 * _N replace combined_sample = weak_rounders if _n > 0.25 * _N & _n <= 0.5 * _N replace combined_sample = strong_rounders if _n > 0.5 * _N // Calculate mean for combined_sample sum combined_sample local mean_combined = r(mean) // Create a dataset with the current results clear set obs 1 gen mean_shift = `i' gen mean_weak_rounders = `mean_weak' gen mean_strong_rounders = `mean_strong' gen mean_all_rounders = `mean_all' gen mean_nonrounders = `mean_non' gen mean_full_sample = `mean_full' gen mean_combined_sample = `mean_combined' // Append the current results to the temporary results dataset append using `results' save `results', replace } // Load the final results dataset and save it permanently clear use `results' save "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd20.dta", replace *SD 10 clear use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd10.dta" gen deviation_strong_rounders = abs(mean_shift - mean_strong_rounders) gen deviation_weak_rounders = abs(mean_shift - mean_weak_rounders) gen deviation_all_rounders = abs(mean_shift - mean_all_rounders) gen deviation_non_rounders = abs(mean_shift - mean_nonrounders) gen deviation_full_sample = abs(mean_shift - mean_full_sample) gen deviation_combined_sample = abs(mean_shift - mean_combined_sample) label variable deviation_strong_rounders "strong rounders" label variable deviation_weak_rounders "weak rounders" label variable deviation_all_rounders "all rounders" label variable deviation_non_rounders "non-rounders" label variable deviation_full_sample "full sample" label variable deviation_combined_sample "biased sample" *main plot graph twoway line deviation_strong_rounders mean_shift, lcolor(dkgreen) || /// line deviation_all_rounders mean_shift, lpattern(dash) lcolor(dkgreen%80) || /// line deviation_non_rounders mean_shift, lpattern(longdash) lcolor(dk_navy) || /// line deviation_combined_sample mean_shift, lpattern(dot) lcolor(black) || /// line deviation_full_sample mean_shift, lpattern(shortdash) lcolor(cranberry) legend(off) xlabel(0(10)100) /// ytitle("deviation of the mean from the center") xtitle(center of the normal distribution) graph save "Graph" "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_sd10.gph", replace *inset ciplot deviation_strong_rounders deviation_all_rounders deviation_combined_sample deviation_non_rounders deviation_full_sample if mean_shift>14 & mean_shift<86, title("Average deviation in the 15 to 85 range") graph save "Graph" "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd10.gph", replace *SD 15 clear use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd15.dta" gen deviation_strong_rounders = abs(mean_shift - mean_strong_rounders) gen deviation_weak_rounders = abs(mean_shift - mean_weak_rounders) gen deviation_all_rounders = abs(mean_shift - mean_all_rounders) gen deviation_non_rounders = abs(mean_shift - mean_nonrounders) gen deviation_full_sample = abs(mean_shift - mean_full_sample) gen deviation_combined_sample = abs(mean_shift - mean_combined_sample) label variable deviation_strong_rounders "strong rounders" label variable deviation_weak_rounders "weak rounders" label variable deviation_all_rounders "all rounders" label variable deviation_non_rounders "non-rounders" label variable deviation_full_sample "full sample" label variable deviation_combined_sample "biased sample" *main plot graph twoway line deviation_strong_rounders mean_shift, lcolor(dkgreen) || /// line deviation_all_rounders mean_shift, lpattern(dash) lcolor(dkgreen%80) || /// line deviation_non_rounders mean_shift, lpattern(longdash) lcolor(dk_navy) || /// line deviation_combined_sample mean_shift, lpattern(dot) lcolor(black) || /// line deviation_full_sample mean_shift, lpattern(shortdash) lcolor(cranberry) legend(off) xlabel(0(10)100) /// ytitle("deviation of the mean from the center") xtitle(center of the normal distribution) graph save "Graph" "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_sd15.gph", replace *inset ciplot deviation_strong_rounders deviation_all_rounders deviation_combined_sample deviation_non_rounders deviation_full_sample if mean_shift>14 & mean_shift<86, title("Average deviation in the 15 to 85 range") graph save "Graph" "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd15.gph", replace *SD 2.5 clear use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd2.5.dta" gen deviation_strong_rounders = abs(mean_shift - mean_strong_rounders) gen deviation_weak_rounders = abs(mean_shift - mean_weak_rounders) gen deviation_all_rounders = abs(mean_shift - mean_all_rounders) gen deviation_non_rounders = abs(mean_shift - mean_nonrounders) gen deviation_full_sample = abs(mean_shift - mean_full_sample) gen deviation_combined_sample = abs(mean_shift - mean_combined_sample) label variable deviation_strong_rounders "strong rounders" label variable deviation_weak_rounders "weak rounders" label variable deviation_all_rounders "all rounders" label variable deviation_non_rounders "non-rounders" label variable deviation_full_sample "full sample" label variable deviation_combined_sample "biased sample" *main plot graph twoway line deviation_strong_rounders mean_shift, lcolor(dkgreen) || /// line deviation_all_rounders mean_shift, lpattern(dash) lcolor(dkgreen%80) || /// line deviation_non_rounders mean_shift, lpattern(longdash) lcolor(dk_navy) || /// line deviation_combined_sample mean_shift, lpattern(dot) lcolor(black) || /// line deviation_full_sample mean_shift, lpattern(shortdash) lcolor(cranberry) legend(off) xlabel(0(10)100) /// ytitle("deviation of the mean from the center") xtitle(center of the normal distribution) graph save "Graph" "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_sd2.5.gph", replace *inset ciplot deviation_strong_rounders deviation_all_rounders deviation_combined_sample deviation_non_rounders deviation_full_sample if mean_shift>14 & mean_shift<86, title("Average deviation in the 15 to 85 range") graph save "Graph" "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd2.5.gph", replace *SD 20 clear use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\simulation_sd20.dta" gen deviation_strong_rounders = abs(mean_shift - mean_strong_rounders) gen deviation_weak_rounders = abs(mean_shift - mean_weak_rounders) gen deviation_all_rounders = abs(mean_shift - mean_all_rounders) gen deviation_non_rounders = abs(mean_shift - mean_nonrounders) gen deviation_full_sample = abs(mean_shift - mean_full_sample) gen deviation_combined_sample = abs(mean_shift - mean_combined_sample) label variable deviation_strong_rounders "strong rounders" label variable deviation_weak_rounders "weak rounders" label variable deviation_all_rounders "all rounders" label variable deviation_non_rounders "non-rounders" label variable deviation_full_sample "full sample" label variable deviation_combined_sample "biased sample" *main plot graph twoway line deviation_strong_rounders mean_shift, lcolor(dkgreen) || /// line deviation_all_rounders mean_shift, lpattern(dash) lcolor(dkgreen%80) || /// line deviation_non_rounders mean_shift, lpattern(longdash) lcolor(dk_navy) || /// line deviation_combined_sample mean_shift, lpattern(dot) lcolor(black) || /// line deviation_full_sample mean_shift, lpattern(shortdash) lcolor(cranberry) legend(off) xlabel(0(10)100) /// ytitle("deviation of the mean from the center") xtitle(center of the normal distribution) graph save "Graph" "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_sd20.gph", replace *inset ciplot deviation_strong_rounders deviation_all_rounders deviation_combined_sample deviation_non_rounders deviation_full_sample if mean_shift>14 & mean_shift<86, title("Average deviation in the 15 to 85 range") graph save "Graph" "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd20.gph", replace **Supplementary Material, Figure S8 comparison of SDs in simulation graph combine "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_sd2.5.gph" /// "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd2.5.gph" /// "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_sd5.gph" /// "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd5.gph" /// "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_sd10.gph" /// "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd10.gph" /// "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_sd15.gph" /// "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd15.gph" /// "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_sd20.gph" /// "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica\Figures\simulation_inset_sd20.gph", /// col(2) ysize(12) xsize(8.5) altshrink ***Supplementary Material section 5, calculations based on appoximate intersections visible in Figure S4 ***WEST GERMANY, 10000 iterations clear all set more off * Load dataset use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica 2 (minor revisions)\ALLBUS_readytouse.dta", clear * Step 1: Prepare a new results dataset to store the results of the loop tempname results_mem postfile `results_mem' iteration num_obs_rounders mean_mp13_rounders num_obs_legitimate mean_mp13_legitimate using results_data, replace * Step 2: Run the loop for 10000 iterations forval i = 1/10000 { di "Running iteration `i'..." * Reload the dataset for each iteration use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica 2 (minor revisions)\ALLBUS_readytouse.dta", clear * Step 3: Create the 'legitimate_rounders' variable and initialize to 0 gen legitimate_rounders = 0 * Random sampling process: * Randomly sample 24% of cases where mp13 == 5 and east == 0 gen random_24_mp13_5 = runiform() if mp13 == 5 & east == 0 replace legitimate_rounders = 1 if random_24_mp13_5 <= 0.24 * Randomly sample 8% of cases where mp13 == 10 and east == 0 gen random_8_mp13_10 = runiform() if mp13 == 10 & east == 0 replace legitimate_rounders = 1 if random_8_mp13_10 <= 0.08 * Randomly sample 7% of cases where mp13 == 15 and east == 0 gen random_7_mp13_15 = runiform() if mp13 == 15 & east == 0 replace legitimate_rounders = 1 if random_7_mp13_15 <= 0.07 * Randomly sample 3% of cases where mp13 == 20 and east == 0 gen random_3_mp13_20 = runiform() if mp13 == 20 & east == 0 replace legitimate_rounders = 1 if random_3_mp13_20 <= 0.03 * Drop temporary random variables drop random_* * Step 4: Create the 'legitimate' variable gen legitimate = legitimate_rounders replace legitimate = 1 if non_rounders_west != . & east == 0 * Step 5: Summarize mp13 for legitimate_rounders == 1 summarize mp13 if legitimate_rounders == 1 local mean_mp13_rounders = r(mean) local num_obs_rounders = r(N) * Step 6: Summarize mp13 for legitimate == 1 summarize mp13 if legitimate == 1 local mean_mp13_legitimate = r(mean) local num_obs_legitimate = r(N) * Step 7: Post the results of this iteration to the results memory post `results_mem' (`i') (`num_obs_rounders') (`mean_mp13_rounders') (`num_obs_legitimate') (`mean_mp13_legitimate') } * Step 8: Close the postfile and create the final results dataset postclose `results_mem' * Step 9: Load the final dataset and display results use results_data, clear list iteration num_obs_rounders mean_mp13_rounders num_obs_legitimate mean_mp13_legitimate sum num_obs_rounders mean_mp13_rounders num_obs_legitimate mean_mp13_legitimate ***EAST GERMANY, 10000 iterations clear all set more off * Load dataset use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica 2 (minor revisions)\ALLBUS_readytouse.dta", clear * Step 1: Prepare a new results dataset to store the results of the loop tempname results_mem postfile `results_mem' iteration num_obs_rounders mean_mp14_rounders num_obs_legitimate mean_mp14_legitimate using results_data, replace * Step 2: Run the loop for 10000 iterations forval i = 1/10000 { di "Running iteration `i'..." * Reload the dataset for each iteration use "C:\Users\HP\Dropbox\Article Projects\Ausländerschätzung ALLBUS\Paper 1 - Wisdom of Crowds\Acta Sociologica Submission 2024\R&R Acta Sociologica 2 (minor revisions)\ALLBUS_readytouse.dta", clear * Step 3: Create the 'legitimate_rounders' variable and initialize to 0 gen legitimate_rounders = 0 * Random sampling process: * Randomly sample 18% of cases where mp14 == 5 and east == 1 gen random_18_mp14_5 = runiform() if mp14 == 5 & east == 1 replace legitimate_rounders = 1 if random_18_mp14_5 <= 0.18 * Randomly sample 10% of cases where mp14 == 10 and east == 1 gen random_10_mp14_10 = runiform() if mp14 == 10 & east == 1 replace legitimate_rounders = 1 if random_10_mp14_10 <= 0.10 * Randomly sample 4% of cases where mp14 == 15 and east == 1 gen random_4_mp14_15 = runiform() if mp14 == 15 & east == 1 replace legitimate_rounders = 1 if random_4_mp14_15 <= 0.04 * Randomly sample 1% of cases where mp14 == 20 and east == 1 gen random_1_mp14_20 = runiform() if mp14 == 20 & east == 1 replace legitimate_rounders = 1 if random_1_mp14_20 <= 0.01 * Drop temporary random variables drop random_* * Step 4: Create the 'legitimate' variable gen legitimate = legitimate_rounders replace legitimate = 1 if non_rounders_east != . & east == 1 * Step 5: Summarize mp14 for legitimate_rounders == 1 summarize mp14 if legitimate_rounders == 1 local mean_mp14_rounders = r(mean) local num_obs_rounders = r(N) * Step 6: Summarize mp14 for legitimate == 1 summarize mp14 if legitimate == 1 local mean_mp14_legitimate = r(mean) local num_obs_legitimate = r(N) * Step 7: Post the results of this iteration to the results memory post `results_mem' (`i') (`num_obs_rounders') (`mean_mp14_rounders') (`num_obs_legitimate') (`mean_mp14_legitimate') } * Step 8: Close the postfile and create the final results dataset postclose `results_mem' * Step 9: Load the final dataset and display results use results_data, clear list iteration num_obs_rounders mean_mp14_rounders num_obs_legitimate mean_mp14_legitimate sum num_obs_rounders mean_mp14_rounders num_obs_legitimate mean_mp14_legitimate *increase in sample due to adding "legitimate rounders" to non-rounders in WEST display 1511/1302 *increase in sample due to adding "legitimate rounders" to non-rounders in EAST display 1172/1044