REPRO-Bench / 35 /replication_package /dofiles /09_AdditionalFigures.do
anonymous-submission-acl2025's picture
add 35
f7e17b7
***********************************************************************************
// Replication Files
**********************************************************************************
/*
HOW DO BELIEFS ABOUT THE GENDER WAGE GAP AFFECT THE DEMAND FOR PUBLIC POLICY?
Sonja Settele
AEJ:pol
*/
**********************************************************************************
***********************************************************************************
**** Generate Appendix Figures
***********************************************************************************
***********************************************************************************
// Figure A.7: Sample balance in terms of prior belief distributions
***********************************************************************************
clear all
use "$path\data\SurveyStageI_AB_final.dta"
// winsorize prior beliefs at 59 and 102
replace prior=59 if prior<59
replace prior=102 if prior>102&prior!=.
* Treatment group T74
sum prior if T1==1, d
hist prior if T1==1, width(1) xaxis(1) ///
xtitle("Prior belief (T74)", axis(1)) xla(60 65 70 75 80 85 90 95 100, axis(1)) frac
graph save "$output\prior_hist_T74.gph", replace
* Treatment group T94
sum prior if T2==1, d
hist prior if T2==1, width(1) xaxis(1) ///
xtitle("Prior belief (T94)", axis(1)) xla(60 65 70 75 80 85 90 95 100, axis(1)) frac
graph save "$output\prior_hist_T94.gph", replace
* Control group
sum prior if rand==0, d
hist prior if rand==0, width(1) xaxis(1) ///
xtitle("Prior belief (Control group)", axis(1)) xla(60 65 70 75 80 85 90 95 100, axis(1)) frac
graph save "$output\prior_hist_cont.gph", replace
graph combine "$output\prior_hist_T74.gph" "$output\prior_hist_T94.gph" "$output\prior_hist_cont.gph", cols(1)
graph export "$output\Priorhist_treatmentgroups.pdf", replace
// Information in Figure notes
* Median prior belief in the three conditions -> See sum commands above
* Mean prior beliefs
mean prior [pweight=pweight] if T1==1
mean prior [pweight=pweight] if T2==1
mean prior [pweight=pweight] if rand==0
* Kolmogorov Smirnov test for similarity of distribution between T74 and T94
ksmirnov prior if rand!=0, by(T1)
***********************************************************************************
// Figure A.8: Distribution of prior beliefs about women’s relative wages
***********************************************************************************
use "$path\data\SurveyStageI_AB_final.dta", clear
* Winsorize prior beliefs at 59 and 102
replace prior=59 if prior<59
replace prior=102 if prior>102&prior!=.
* a) Pooled: All observations
hist prior, width(1) xaxis(1) ///
xtitle("a) Prior beliefs (pooled)", axis(1)) xla(60 65 70 75 80 85 90 95 100, axis(1)) frac
graph save "$output\pooled.gph", replace
* b) Non-incentivized priors only
hist prior if prior1==0, width(1) xaxis(1) ///
xtitle("b) Prior beliefs (non-incentivized)", axis(1)) xla(60 65 70 75 80 85 90 95 100, axis(1)) frac
graph save "$output\noninc.gph", replace
* c) Beliefs incentivized on the ACS only
hist prior if prior1==1&(T1==1|RAND6==1), width(1) xaxis(1) ///
xtitle("c) Prior beliefs (incentivized based on ACS)", axis(1)) xla(60 65 70 75 80 85 90 95 100, axis(1)) frac
graph save "$output\inc_ACS.gph", replace
* d) Beliefs incentivized on the CPS only
hist prior if prior1==1&(T2==1|RAND6==0), width(1) xaxis(1) ///
xtitle("d) Prior beliefs (incentivized based on CPS)", axis(1)) xla(60 65 70 75 80 85 90 95 100, axis(1)) frac
graph save "$output\inc_CPS.gph", replace
graph combine "$output\pooled.gph" "$output\noninc.gph" "$output\inc_ACS.gph" "$output\inc_CPS.gph", cols(2)
graph export "$output\Priorhist_all4.pdf", replace
// Information in Figure notes:
use "$path\data\SurveyStageI_AB_final.dta", clear
*Number of obs. and median
* Panel a)
sum prior,d
*Panel b)
sum prior if prior1==0,d
* Panel c)
sum prior if prior1==1&(T1==1|RAND6==1),d
* Panel d)
sum prior if prior1==1&(T2==1|RAND6==0),d
*Means
mean prior [pweight=pweight]
mean prior [pweight=pweight] if prior1==0
mean prior [pweight=pweight] if prior1==1&(T1==1|RAND6==1)
mean prior [pweight=pweight] if prior1==1&(T2==1|RAND6==0)
***********************************************************************************
// Figure A.9: Behavioral outcomes (pure control group)
***********************************************************************************
clear all
set scheme s2mono
// Panel A: Propensity to sign a petition
/* Number of potential signatures for Petitions I and II per treatment group correspond to the number of
respondents assigned to either treatment group.
The numbers of actual signatures for Petitions I and II are all "manually" retrieved from the White House
Petition Website.
*/
// PETITION I
/* Run prtesti for a two-sided proportion test for Petition I by gender and by pol. orientation
Input gender: Total number of potential signatures among women in control group (544)
Number of actual signatures among women in control group (101)
Total number of potential signatures among men in control group (490)
Number of actual signatures among men in control group (58)
Input pol. : Total number of potential signatures among Democrats in control group (230)
Number of actual signatures among Democrats in control group (50)
Total number of potential signatures among Non-Democrats in control group (268)
Number of actual signatures among Non-Democrats in control group (24)
Output: Proportion of signatures by group (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below
*/
* Women vs. men:
prtesti 544 101 490 58, count
* Democrats vs. Non-Democrats:
prtesti 230 50 268 24, count
// PETITION II
/* Run prtesti for a two-sided proportion test for Petition I by gender and by pol. orientation
Input gender: Total number of potential signatures among women in control group (544)
Number of actual signatures among women in control group (3)
Total number of potential signatures among men in control group (490)
Number of actual signatures among men in control group (17)
Input pol. : Total number of potential signatures among Democrats in control group (230)
Number of actual signatures among Democrats in control group (2)
Total number of potential signatures among Non-Democrats in control group (268)
Number of actual signatures among Non-Democrats in control group (8)
Output: Proportion of signatures by group (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below
*/
* Women vs. men:
prtesti 544 3 490 17, count
* Democrats vs. Non-Democrats:
prtesti 230 2 268 8, count
**** Insert numbers derived from prtesti to generate bar graphs
// Petition I by gender:
/* prtesti 544 101 490 58, count
Two-sample test of proportions x: Number of obs = 544
y: Number of obs = 490
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .1856618 .0166711 .152987 .2183365
y | .1183673 .0145936 .0897645 .1469702
-------------+----------------------------------------------------------------
diff | .0672944 .0221562 .023869 .1107198
| under Ho: .022467 3.00 0.003
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = 2.9953
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.9986 Pr(|Z| < |z|) = 0.0027 Pr(Z > z) = 0.0014 */
mat R=J(2,5,.) // Set up matrix
// Insert values:
local pvalue1 = 0.01
* Means
mat R[1,1] = 0.1857 // women Pet I
mat R[2,1] = 0.1184 // men Pet I
* Lower bounds
mat R[1,2] = 0.1530 // women Pet I
mat R[2,2] = 0.0898 // men Pet I
* Upper bounds
mat R[1,3] = 0.2183 // women Pet I
mat R[2,3] = 0.1470 // men Pet I
// Define some coordinates
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 1
mat R[2,5] = 1
preserve
clear
svmat R
tempfile cat1
save `cat1' // Save matrix as dataset
restore
*************************************
// Petition I by dem-rep:
/* prtesti 230 50 268 24, count
Two-sample test of proportions x: Number of obs = 230
y: Number of obs = 268
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .2173913 .0271975 .1640851 .2706975
y | .0895522 .0174421 .0553664 .1237381
-------------+----------------------------------------------------------------
diff | .1278391 .0323099 .0645128 .1911654
| under Ho: .0319707 4.00 0.000
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = 3.9986
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 1.0000 Pr(|Z| < |z|) = 0.0001 Pr(Z > z) = 0.0000*/
// Insert values:
local pvalue2 = 0.001
* Means
mat R[1,1] = 0.2174 // dem Pet I
mat R[2,1] = 0.0896 // rep Pet I
* Lower bounds
mat R[1,2] = 0.1641 // dem Pet I
mat R[2,2] = 0.0554 // rep Pet I
* Upper bounds
mat R[1,3] = 0.2707 // dem Pet I
mat R[2,3] = 0.1237 // rep Pet I
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 2
mat R[2,5] = 2
preserve
clear
svmat R
tempfile cat2
save `cat2' // Save matrix as dataset
restore
*************************************************
// Petition II by gender
/* prtesti 544 3 490 17, count
Two-sample test of proportions x: Number of obs = 544
y: Number of obs = 490
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .0055147 .0031751 -.0007084 .0117378
y | .0346939 .0082672 .0184904 .0508974
-------------+----------------------------------------------------------------
diff | -.0291792 .008856 -.0465366 -.0118217
| under Ho: .0085778 -3.40 0.001
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = -3.4017
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.0003 Pr(|Z| < |z|) = 0.0007 Pr(Z > z) = 0.9997
*/
// Insert values:
local pvalue3 = 0.001
* Means
mat R[1,1] = 0.0056 // women Pet II
mat R[2,1] = 0.0347 // men Pet II
* Lower bounds
mat R[1,2] = -0.0007 // women Pet II
mat R[2,2] = 0.0185 // men Pet II
* Upper bounds
mat R[1,3] = 0.0117 // women Pet II
mat R[2,3] = 0.0509 // men Pet II
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 3
mat R[2,5] = 3
preserve
clear
svmat R
tempfile cat3
save `cat3'
restore
************************************************'
// Petition II by dem-rep
/*prtesti 230 2 268 8, count
Two-sample test of proportions x: Number of obs = 230
y: Number of obs = 268
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .0086957 .006122 -.0033032 .0206945
y | .0298507 .0103951 .0094767 .0502248
-------------+----------------------------------------------------------------
diff | -.0211551 .0120639 -.0447998 .0024897
| under Ho: .0126085 -1.68 0.093
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = -1.6778
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.0467 Pr(|Z| < |z|) = 0.0934 Pr(Z > z) = 0.9533*/
local pvalue4 = 0.09
* Means
mat R[1,1] = 0.0087 // dem
mat R[2,1] = 0.0299 // rep
* Lower bounds
mat R[1,2] = -0.0033 // dem
mat R[2,2] = 0.0095 // rep
* Upper bounds
mat R[1,3] = 0.0201 // dem
mat R[2,3] = 0.0502 // rep
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 4
mat R[2,5] = 4
preserve
clear
svmat R
tempfile cat4
save `cat4'
restore
// Append 4 datasets
clear
local numcats = "1 2 3 4"
foreach a of local numcats {
append using `cat`a''
}
* For alignment along the x-axis
gen s1 = R5
gen s2 = .
replace s2 = s1 - 0.2 if R5 == 1
replace s2 = s1 - 0.6 if R5 == 2
replace s2 = s1 - 1.0 if R5 == 3
replace s2 = s1 - 1.4 if R5 == 4
gen p1 = (s2 - 0.1) - .6
gen p2 = s2 + 0.1 - .6
* This recovers the group means with which to label each bar.
local i = 0
foreach cat of local numcats {
forval rel = 1/2 {
local ++i
sum R1 if R4 == `rel' & R5 == `cat'
local barval`i' = trim("`: di %9.2f r(mean)'")
}
}
global barlabels `"0.2 "Gender" 0.8 "Pol. orientation" 1.4 "Gender" 2.0 "Pol. orientation""'
global pvalues `"0.29 0.2 "p-value < `pvalue1'" 0.29 0.8 "p-value < `pvalue2'" 0.25 1.4 "p-value < `pvalue3'" 0.25 2.0 "p-value = `pvalue4'""'
global grouplabels `"0.32 0.5 "Petition I (increase reporting)" 0.32 1.7 "Petition II (abolish reporting)""'
global bargroups = `"0.02 0.1 "Women" 0.02 0.3 "Men" 0.02 0.7 "Dem." 0.02 0.9 "Non-Dem." 0.02 1.3 "Women" 0.02 1.5 "Men" 0.02 1.9 "Dem." 0.02 2.1 "Non-Dem.""'
global barvalues = `"0.045 0.1 "`barval1'" 0.045 0.3 "`barval2'" 0.045 0.7 "`barval3'" 0.045 0.9 "`barval4'" 0.061 1.3 "`barval5'" 0.061 1.5 "`barval6'" 0.061 1.9 "`barval7'" 0.061 2.1 "`barval8'""'
twoway (bar R1 p1 if R4 == 1, barw(0.18) fi(inten50) lc(black) lw(medium)) (bar R1 p2 if R4 == 2, barw(0.18) fi(inten20) lc(black) lw(medium)) ///
(rcap R3 R2 p1 if R4 == 1, lc(gs5)) (rcap R3 R2 p2 if R4 == 2, lc(gs5)), legend(off) graphregion(color(white)) ///
yscale(range(0.35)) yla(0(0.05)0.25) xla($barlabels, labsize(2.5)) text($pvalues, size(2.5)) text($grouplabels, size(2.8)) text($bargroups, size(2.5)) text($barvalues, size(2.5)) ///
ytitle("Fraction of respondents who signed", height(5))
graph export "$output\fig_petitions0.pdf", replace
// Panel B: Donations made to an NGO
use "$path\data\SurveyStageI_AB_final.dta", clear
keep rand wave donation democrat republican gender pweight
* Keep only control group
keep if rand==0
gen women=(gender==1)
gen men=(gender==0)
gen donationmen=donation if gender==0
gen donationwoman=donation if gender==1
gen donationrepub=donation if republican==1
gen donationdem =donation if democrat==1
gen donationnondem=donation if democrat==0
lab var donationmen "Men"
lab var donationwoman "Women"
lab var donationrepub "Republican"
lab var donationdem "Democrat"
lab var donationnondem "Non-Democrat"
*drop gender
local outcome = "donation"
**** Calculate numbers for bar graph matrix
* Set up matrix for bars by gender
mat R=J(2,5,.)
* Store means by gender
local row=1
foreach X in women men {
mean `outcome' if `X' == 1 [pweight=pweight]
mat R[`row',1] = e(b)
local ++row
}
* Calculate and store mean belief for women
mean `outcome' if women == 1 [pweight=pweight]
matrix meanwomen=e(b)
* Calculate and store gender coefficient and p-value
reg `outcome' men [pweight=pweight], robust
local pvalue1 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[men]/_se[men]))'")
local row=1
foreach X in women men {
mat R[`row',2]= meanwomen[1,1] + _b[men]-1.96*_se[men]
mat R[`row',3]= meanwomen[1,1] + _b[men]+1.96*_se[men]
mat R[`row',4]=`row'
mat R[`row',5] = 1
local ++row
}
preserve
clear
svmat R
tempfile cat1
save `cat1' // Save matrix with numbers for gender bars as dataset
restore
// Drop independents and those with "other" political orientation
keep if democrat==1|republican==1
* Set up matrix for bars by Dem-Rep
mat R=J(2,5,.)
* Store means by Dem-Rep
local row=1
foreach X in democrat republican {
mean `outcome' if `X' == 1 [pweight=pweight]
mat R[`row',1] = e(b)
local ++row
}
* Calculate and store mean belief for Democrats
mean `outcome' if democrat == 1
matrix meandemocrat=e(b)
* Calculate and store pol coefficient and p-value
reg `outcome' republican [pweight=pweight], robust
local pvalue2 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[republican]/_se[republican]))'")
local row=1
foreach X in women men {
mat R[`row',2]= meandemocrat[1,1] + _b[republican]-1.96*_se[republican]
mat R[`row',3]= meandemocrat[1,1] + _b[republican]+1.96*_se[republican]
mat R[`row',4]=`row'
mat R[`row',5] = 2
local ++row
}
preserve
clear
svmat R
tempfile cat2
save `cat2' // Save matrix with numbers for pol orientation bars as dataset
restore
clear
// Append the two data sets that contain the numbers for all four bars
local numcats = "1 2"
foreach a of local numcats {
append using `cat`a''
}
* For alignment along the x-axis
gen s1 = R5
gen s2 = .
replace s2 = s1 - 0.2 if R5 == 1
replace s2 = s1 - 0.6 if R5 == 2
replace s2 = s1 - 1.0 if R5 == 3
replace s2 = s1 - 1.4 if R5 == 4
gen p1 = (s2 - 0.1) - .6 // Fix position for gender bars
gen p2 = s2 + 0.1 - .6 // Fix position for pol. orientation bars
* This recovers the group means with which to label each bar.
local i = 0
foreach p of local numcats {
forval rel = 1/2 {
local ++i
sum R1 if R4 == `rel' & R5 == `p'
local barval`i' = trim("`: di %9.2f r(mean)'")
}
}
* Bar labels
global barlabels `"0.2 "Gender" 0.8 "Pol. orientation" "'
global pvalues `"108 0.2 "p-value = `pvalue1'" 108 0.8 "p-value < 0.01" "'
global grouplabels `"118 0.5 "Amount donated""'
global bargroups = `"10 0.1 "Women" 10 0.3 "Men" 10 0.7 "Dem." 10 0.9 "Repub." "'
global barvalues = `"20.045 0.1 "`barval1'" 20.045 0.3 "`barval2'" 20.045 0.7 "`barval3'" 20.045 0.9 "`barval4'" "'
twoway (bar R1 p1 if R4 == 1, barw(0.18) fi(inten50) lc(black) lw(medium)) (bar R1 p2 if R4 == 2, barw(0.18) fi(inten20) lc(black) lw(medium)) ///
(rcap R3 R2 p2 if R4 == 2, lc(gs5)), legend(off) graphregion(color(white)) ///
yscale(range(2)) yla(0(20)120) xla($barlabels, labsize(5.5)) text($pvalues, size(5.5)) text($grouplabels, size(6.0)) text($bargroups, size(5.0)) text($barvalues, size(5.5)) ///
ytitle("Amount donated", size(5.5) height(5))
graph export "$output\fig_donation0.pdf", replace
***********************************************************************************
// Figure A.10: Distribution of posterior beliefs in both treatment groups
***********************************************************************************
use "$path\data\SurveyStageI_AB_final.dta", clear
// Drop pure control group
drop if rand==0
// Define a variable indicating which posterior belief the respondent was assigned to
* High wage gap treatment (T74)
gen randnew=0 if wave==1&RAND4==9&rand==1 // Age 25
replace randnew=1 if wave==1&RAND4==10&rand==1 // HS degree
replace randnew=2 if wave==1&RAND4==11&rand==1 // Same occu group
replace randnew=3 if wave==2&RAND4==10&rand==1 // Same job and employer
replace randnew=4 if wave==2&RAND4==11&rand==1 // Parent
* Low wage gap treatment (T94)
replace randnew=5 if wave==1&RAND4==9&rand==2 // Age 25
replace randnew=6 if wave==1&RAND4==10&rand==2 // HS degree
replace randnew=7 if wave==1&RAND4==11&rand==2 // Same occu group
replace randnew=8 if wave==2&RAND4==10&rand==2 // Same job and employer
replace randnew=9 if wave==2&RAND4==11&rand==2 // Parent
* Assign labels
label define randnew 0 "T{sup:74} (Age 25)" 1 "T{sup:74} (HS degree)" 2 "T{sup:74} (Same occu. group)" 3 "T{sup:74} (Same job)" 4 "T{sup:74} (Parent)" 5 "T{sup:94} (age 25)" 6 "T{sup:94} (HS degree)" 7 "T{sup:94} (same occu)" 8 "T{sup:94} (Same job)" 9 "T{sup:94} (Parent)"
label values randnew randnew
//Winsorize posteriors at 49 and 101:
replace posterior=101 if posterior>101&posterior!=.
replace posterior=49 if posterior<49
// Generate individual histograms (top panel)
twoway histogram posterior if randnew==0, width(1) title("T{sup:74} (Age 25)") fraction width(5) xline(74, lcolor(blue)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph1, replace)
twoway histogram posterior if randnew==1, width(1) title("T{sup:74} (HS degree)") fraction width(5) xline(74, lcolor(blue)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph2, replace)
twoway histogram posterior if randnew==2, width(1) title("T{sup:74} (Same occu. group)") fraction width(5) xline(74, lcolor(blue)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph3, replace)
twoway histogram posterior if randnew==3, width(1) title("T{sup:74} (Same job)") fraction width(5) xline(74, lcolor(blue)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph4, replace)
twoway histogram posterior if randnew==4, width(1) title("T{sup:74} (Parent)") fraction width(5) xline(74, lcolor(blue)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph5, replace)
// Combine top panel
graph combine graph1 graph2 graph3 graph4 graph5, rows(1) xsize(6) ysize(1.5) name(coefplot, replace)
graph export "$output\posterior_histog_treat_row1_win1.pdf", replace
// Generate individual histograms (bottom panel)
twoway histogram posterior if randnew==5, width(1) title("T{sup:94} (Age 25)") fraction width(5) xline(94, lcolor(green)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph1, replace)
twoway histogram posterior if randnew==6, width(1) title("T{sup:94} (HS degree)") fraction width(5) xline(94, lcolor(green)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph2, replace)
twoway histogram posterior if randnew==7, width(1) title("T{sup:94} (Same occu. group)") fraction width(5) xline(94, lcolor(green)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph3, replace)
twoway histogram posterior if randnew==8, width(1) title("T{sup:94} (Same job)") fraction width(5) xline(94, lcolor(green)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph4, replace)
twoway histogram posterior if randnew==9, width(1) title("T{sup:94} (Parent)") fraction width(5) xline(94, lcolor(green)) xla(50 75 95 100) yscale(range(0 0.52)) name(graph5, replace)
graph combine graph1 graph2 graph3 graph4 graph5, rows(1) xsize(6) ysize(1.5) name(coefplot, replace)
graph export "$output\posterior_histog_treat_row2_win1.pdf", replace
***********************************************************************************
// Figure A.11: Donation Decision
***********************************************************************************
clear all
set scheme s2mono
global legend = `"label(1 "T{sup:74}") label(2 "T{sup:94}") order(1 2) size(medium)"'
use "$path\data\SurveyStageI_AB_final.dta", clear
keep rand T1 T2 wave donation democrat republican indep otherpol gender pweight prior midwest south west age1 age2 age3 age4 anychildren loghhinc associatemore fulltime parttime selfemp unemp student
*global controls wave gender democrat republican otherpol midwest south west age1 age2 age3 age4 anychildren loghhinc associatemore fulltime parttime selfemp unemp student
* Drop control group, keep only treated respondents
drop if rand==0
gen donationmen=donation if gender==0
gen donationwoman=donation if gender==1
gen donationrepub=donation if republican==1
gen donationdem =donation if democrat==1
gen donationnondem=donation if democrat==0
local out1 = "donation"
local out2 = "donationmen"
local out3 = "donationwoman"
local out4 = "donationdem"
local out5 = "donationnondem"
local numcats = "1 2 3 4 5"
**** Calculate numbers for bar graph matrix
forvalues a=1/5{
* Set up matrix
mat R=J(2,5,.)
* Store mean of outcome by treatment condition
local row=1
foreach X in T1 T2{
mean `out`a'' if `X' == 1 [pweight=pweight]
mat R[`row',1] = e(b)
local ++row
}
* Calculate and store treatment coeficient and p-value
reg `out`a'' T2 $controls [pweight=pweight], robust
local pvalue`a' = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[T2]/_se[T2]))'")
* Fill output of above steps into matrix
local row=1
foreach X in T1 T2 {
mat R[`row',2]= R[1,1] + _b[T2]-1.96*_se[T2] // calculate upper bound for CI
mat R[`row',3]= R[1,1] + _b[T2]+1.96*_se[T2] // calculate lower bound for CI
mat R[`row',4]=`row'
mat R[`row',5] = `a'
local ++row
}
preserve
clear
svmat R
tempfile cat`a'
save `cat`a''
restore
}
* Save bar graph matrix as dataset
clear
foreach a of local numcats {
append using `cat`a''
}
* For alignment along the x-axis
gen s1 = R5
gen s2 = .
replace s2 = s1 - 0.2 if R5 == 1
replace s2 = s1 - 0.6 if R5 == 2
replace s2 = s1 - 1.0 if R5 == 3
replace s2 = s1 - 1.4 if R5 == 4
replace s2 = s1 - 1.8 if R5 == 5
*replace s2 = s1 - 2.2 if R5 == 6
gen pos1 = (s2 - 0.1) - .6
gen pos2 = s2 + 0.1 - .6
* This recovers the group means with which to label each bar.
local i = 0
foreach pos of local numcats {
forval rel = 1/2 {
local ++i
sum R1 if R4 == `rel' & R5 == `pos'
local barval`i' = trim("`: di %9.2f r(mean)'")
}
}
global barlabels `"0.2 "All" 0.8 "Men" 1.4 "Women" 2.0 "Democrats" 2.6 "Non-Democrats" "'
global pvalues `"120 0.2 "p-value = `pvalue1'" 120 0.8 "p-value = `pvalue2'" 120 1.4 "p-value = `pvalue3'" 120 2.0 "p-value = `pvalue4'" 120 2.6 "p-value = `pvalue5'" "'
global barvalues = `"60 0.1 "`barval1'" 60 0.3 "`barval2'" 60 0.7 "`barval3'" 60 0.9 "`barval4'" 60 1.3 "`barval5'" 60 1.5 "`barval6'" 60 1.9 "`barval7'" 60 2.1 "`barval8'" 60 2.5 "`barval9'" 60 2.7 "`barval10'" "'
twoway (bar R1 pos1 if R4 == 1, barw(0.18) fi(inten50) lc(black) lw(medium)) (bar R1 pos2 if R4 == 2, barw(0.18) fi(inten20) lc(black) lw(medium)) ///
(rcap R3 R2 pos2 if R4 == 2, lc(gs5)), legend(${legend}) graphregion(color(white)) ///
yscale(range(103)) yla(50(25)125) xla($barlabels, labsize(2.5)) text($pvalues, size(2.5)) text($barvalues, size(2.5)) ///
ytitle("Amount donated", height(5))
graph export "$output\fig_donation_AB_demnondem.pdf", replace
***********************************************************************************
// Figure A.12: Signatures on real online petitions
***********************************************************************************
// Panel (a): Petition I (Increase reporting)
clear all
/* Number of potential signatures for Petitions I and II per group correspond to the number of respondents assigned to either treatment group
The numbers of actual signatures for Petitions I and II are all "manually" retrieved from the White House Petition Website.
*/
// All: See MainFigures.do -> Figure 2 for numbers of signatures
prtesti 1531 259 1500 220, count
/* Female respondents:
Input: Total number of potential signatures in T74 (798)
Number of actual signatures in T74 (161)
Total number of potential signatures in T94 (766)
Number of actual signatures in T94 (134)
Output: Proportion of signatures in T74 (incl. 95% CI)
Proportion of signatures in T94 (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below */
prtesti 798 161 766 134, count
/* Male respondents:
Input: Total number of potential signatures in T74 (733)
Number of actual signatures in T74 (98)
Total number of potential signatures in T94 (734)
Number of actual signatures in T94 (86)
Output: Proportion of signatures in T74 (incl. 95% CI)
Proportion of signatures in T94 (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below */
prtesti 733 98 734 86, count
/* Democrats:
Input: Total number of potential signatures in T74 (447)
Number of actual signatures in T74 (106)
Total number of potential signatures in T94 (450)
Number of actual signatures in T94 (99)
Output: Proportion of signatures in T74 (incl. 95% CI)
Proportion of signatures in T94 (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below */
prtesti 447 106 450 99, count
/* Non-Democrats:
Input: Total number of potential signatures in T74 (558)
Number of actual signatures in T74 (63)
Total number of potential signatures in T94 (557)
Number of actual signatures in T94 (60)
Output: Proportion of signatures in T74 (incl. 95% CI)
Proportion of signatures in T94 (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below */
prtesti 558 63 557 60, count
set scheme s2mono
global legend = `"label(1 "T{sup:74}") label(2 "T{sup:94}") order(1 2) size(medium)"'
**** Calculate numbers for bar graph matrix
// All:
mat R=J(2,5,.)
local pvalue1 = 0.09 //2-sided test
* Means
mat R[1,1] = 0.16917 // All T74
mat R[2,1] = 0.14667 // All T94
* Lower bounds
mat R[1,2] = 0.1504 // All T74
mat R[2,2] = 0.1288 // All T94
* Upper bounds
mat R[1,3] = 0.1879 // All T74
mat R[2,3] = 0.1646 // All T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 1
mat R[2,5] = 1
preserve
clear
svmat R
tempfile cat1
save `cat1'
restore
**********************************
// Women:
/*prtesti 798 161 766 134, count
Two-sample test of proportions x: Number of obs = 798
y: Number of obs = 766
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .2017544 .0142062 .1739107 .2295981
y | .1749347 .0137268 .1480308 .2018387
-------------+----------------------------------------------------------------
diff | .0268197 .0197545 -.0118984 .0655378
| under Ho: .0197883 1.36 0.175
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = 1.3553
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.9123 Pr(|Z| < |z|) = 0.1753 Pr(Z > z) = 0.0877*/
local pvalue2 = 0.18 //2-sided test
* Means
mat R[1,1] = 0.2018 // Women T74
mat R[2,1] = 0.1749 // Women T94
* Lower bounds
mat R[1,2] = .1739107 // Women T74
mat R[2,2] = .1480308 // Women T94
* Upper bounds
mat R[1,3] = .2295981 // Women T74
mat R[2,3] = .2018387 // Women T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 2
mat R[2,5] = 2
preserve
clear
svmat R
tempfile cat2
save `cat2'
restore
*************************************************
// Men
/* prtesti 733 98 734 86, count
Two-sample test of proportions x: Number of obs = 733
y: Number of obs = 734
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .1336971 .0125703 .1090599 .1583344
y | .1171662 .0118711 .0938992 .1404332
-------------+----------------------------------------------------------------
diff | .0165309 .0172897 -.0173564 .0504182
| under Ho: .0172945 0.96 0.339
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = 0.9559
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.8304 Pr(|Z| < |z|) = 0.3391 Pr(Z > z) = 0.1696*/
local pvalue3 = 0.34 // 2-sided test
* Means
mat R[1,1] = 0.1337 // Men T74
mat R[2,1] = 0.1172 // Men T94
* Lower bounds
mat R[1,2] = 0.1091 // Men T74
mat R[2,2] = 0.0939 // Men T94
* Upper bounds
mat R[1,3] = 0.1583 // Men T74
mat R[2,3] = 0.1404 // Men T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 3
mat R[2,5] = 3
preserve
clear
svmat R
tempfile cat3
save `cat3'
restore
*************************************************
// Democrats
/*prtesti 447 106 450 99, count
Two-sample test of proportions x: Number of obs = 447
y: Number of obs = 450
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .2371365 .0201173 .1977074 .2765656
y | .22 .0195278 .1817263 .2582737
-------------+----------------------------------------------------------------
diff | .0171365 .0280364 -.0378138 .0720867
| under Ho: .0280397 0.61 0.541
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = 0.6111
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.7294 Pr(|Z| < |z|) = 0.5411 Pr(Z > z) = 0.2706*/
local pvalue4 = 0.54 // 2-sided test
* Means
mat R[1,1] = 0.2371 // Democrats T74
mat R[2,1] = 0.22 // Democrats T94
* Lower bounds
mat R[1,2] = .1977074 // Democrats T74
mat R[2,2] = .1817263 // Democrats T94
* Upper bounds
mat R[1,3] = .2765656 // Democrats T74
mat R[2,3] = .2582737 // Democrats T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 4
mat R[2,5] = 4
preserve
clear
svmat R
tempfile cat4
save `cat4'
restore
*************************************************
// Non-Democrats
/* prtesti 558 63 557 60, count
Two-sample test of proportions x: Number of obs = 558
y: Number of obs = 557
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .1129032 .0133974 .0866447 .1391617
y | .1077199 .0131362 .0819734 .1334665
-------------+----------------------------------------------------------------
diff | .0051833 .018763 -.0315916 .0419582
| under Ho: .018764 0.28 0.782
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = 0.2762
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.6088 Pr(|Z| < |z|) = 0.7824 Pr(Z > z) = 0.3912*/
local pvalue5 = 0.78 // 2-sided test
* Means
mat R[1,1] = 0.1129 // Non-Democrats T74
mat R[2,1] = 0.1077 // Non-Democrats T94
* Lower bounds
mat R[1,2] = .0866447 // Democrats T74
mat R[2,2] = .0819734 // Democrats T94
* Upper bounds
mat R[1,3] = .1391617 // Democrats T74
mat R[2,3] = .1334665 // Democrats T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 5
mat R[2,5] = 5
preserve
clear
svmat R
tempfile cat5
save `cat5'
restore
* Save bar graph matrix as dataset
clear
local numcats = "1 2 3 4 5"
foreach a of local numcats {
append using `cat`a''
}
* For alignment along the x-axis
gen s1 = R5
gen s2 = .
replace s2 = s1 - 0.2 if R5 == 1
replace s2 = s1 - 0.6 if R5 == 2
replace s2 = s1 - 1.0 if R5 == 3
replace s2 = s1 - 1.4 if R5 == 4
replace s2 = s1 - 1.8 if R5 == 5
gen pos1 = (s2 - 0.1) - .6
gen pos2 = s2 + 0.1 - .6
* This recovers the group means with which to label each bar.
local i = 0
foreach pos of local numcats {
forval rel = 1/2 {
local ++i
sum R1 if R4 == `rel' & R5 == `pos'
local barval`i' = trim("`: di %9.2f r(mean)'")
}
}
global barlabels `"0.2 "All" 0.8 "Women" 1.4 "Men" 2.0 "Democrats" 2.6 "Non-Democrats" "'
global pvalues `"0.29 0.2 "p-value = `pvalue1'" 0.29 0.8 "p-value = `pvalue2'" 0.29 1.4 "p-value = `pvalue3'" 0.29 2.0 "p-value = `pvalue4'" 0.29 2.6 "p-value = `pvalue5'" "'
global barvalues = `"0.03 0.1 "`barval1'" 0.03 0.3 "`barval2'" 0.03 0.7 "`barval3'" 0.03 0.9 "`barval4'" 0.03 1.3 "`barval5'" 0.03 1.5 "`barval6'" 0.03 1.9 "`barval7'" 0.03 2.1 "`barval8'" 0.03 2.5 "`barval9'" 0.03 2.7 "`barval9'" "'
twoway (bar R1 pos1 if R4 == 1, barw(0.18) fi(inten50) lc(black) lw(medium)) (bar R1 pos2 if R4 == 2, barw(0.18) fi(inten20) lc(black) lw(medium)) ///
(rcap R3 R2 pos1 if R4 == 1, lc(gs5)) (rcap R3 R2 pos2 if R4 == 2, lc(gs5)), legend(${legend}) graphregion(color(white)) ///
yscale(range(0.3)) yla(0(0.05)0.3) xla($barlabels, labsize(2.5)) text($pvalues, size(2.5)) text($barvalues, size(2.5)) ///
ytitle("Fraction of respondents who signed", height(5))
graph export "$output\fig_petitionI_2sided.pdf", replace
// Panel (b): Petition II (Decrease reporting)
clear all
set scheme s2mono
/* Number of potential signatures for Petitions I and II per group correspond to the number of respondents assigned to either treatment group
The numbers of actual signatures for Petitions I and II are all "manually" retrieved from the White House Petition Website.
*/
// All: See MainFigures.do -> Figure 2 for numbers of signatures
prtesti 1531 19 1500 35, count
/* Female respondents:
Input: Total number of potential signatures in T74 (798)
Number of actual signatures in T74 (6)
Total number of potential signatures in T94 (766)
Number of actual signatures in T94 (16)
Output: Proportion of signatures in T74 (incl. 95% CI)
Proportion of signatures in T94 (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below */
prtesti 798 6 766 16, count
/* Male respondents:
Input: Total number of potential signatures in T74 (733)
Number of actual signatures in T74 (13)
Total number of potential signatures in T94 (734)
Number of actual signatures in T94 (19)
Output: Proportion of signatures in T74 (incl. 95% CI)
Proportion of signatures in T94 (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below */
prtesti 733 13 734 19, count
/* Democrats:
Input: Total number of potential signatures in T74 (447)
Number of actual signatures in T74 (3)
Total number of potential signatures in T94 (450)
Number of actual signatures in T94 (2)
Output: Proportion of signatures in T74 (incl. 95% CI)
Proportion of signatures in T94 (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below */
prtesti 447 3 450 2, count
/* Non-Democrats:
Input: Total number of potential signatures in T74 (558)
Number of actual signatures in T74 (10)
Total number of potential signatures in T94 (557)
Number of actual signatures in T94 (18)
Output: Proportion of signatures in T74 (incl. 95% CI)
Proportion of signatures in T94 (incl. 95% CI)
P-value of two-sided proportion test
--> Output entered manually below */
prtesti 558 10 557 18, count
// All:
mat R=J(2,5,.)
local pvalue1 = 0.02 //2-sided test
* Means
mat R[1,1] = 0.01241 // All T74
mat R[2,1] = 0.02333 // All T94
* Lower bounds
mat R[1,2] = 0.0069 // All T74
mat R[2,2] = 0.0157 // All T94
* Upper bounds
mat R[1,3] = 0.01796 // All T74
mat R[2,3] = 0.031 // All T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 1
mat R[2,5] = 1
preserve
clear
svmat R
tempfile cat1
save `cat1'
restore
**********************************
// Women:
/* prtesti 798 6 766 16, count
Two-sample test of proportions x: Number of obs = 798
y: Number of obs = 766
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .0075188 .003058 .0015253 .0135123
y | .0208877 .0051671 .0107604 .0310151
-------------+----------------------------------------------------------------
diff | -.0133689 .0060042 -.0251369 -.001601
| under Ho: .0059569 -2.24 0.025
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = -2.2443
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.0124 Pr(|Z| < |z|) = 0.0248 Pr(Z > z) = 0.9876*/
local pvalue2 = 0.02 //2-sided test
* Means
mat R[1,1] = 0.007519 // Women T74
mat R[2,1] = 0.02089 // Women T94
* Lower bounds
mat R[1,2] = .0015253 // Women T74
mat R[2,2] = .0107604 // Women T94
* Upper bounds
mat R[1,3] = .0135123 // Women T74
mat R[2,3] = .0310151 // Women T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 2
mat R[2,5] = 2
preserve
clear
svmat R
tempfile cat2
save `cat2'
restore
*************************************************
// Men
/*prtesti 733 13 734 19, count
Two-sample test of proportions x: Number of obs = 733
y: Number of obs = 734
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .0177353 .0048751 .0081803 .0272903
y | .0258856 .0058612 .0143978 .0373733
-------------+----------------------------------------------------------------
diff | -.0081502 .0076236 -.0230923 .0067918
| under Ho: .0076276 -1.07 0.285
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = -1.0685
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.1426 Pr(|Z| < |z|) = 0.2853 Pr(Z > z) = 0.8574*/
local pvalue3 = 0.29 // 2-sided test
* Means
mat R[1,1] = 0.017735 // Men T74
mat R[2,1] = 0.02589 // Men T94
* Lower bounds
mat R[1,2] = 0.0081803 // Men T74
mat R[2,2] = .0143978 // Men T94
* Upper bounds
mat R[1,3] = 0.0272903 // Men T74
mat R[2,3] = .0373733 // Men T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 3
mat R[2,5] = 3
preserve
clear
svmat R
tempfile cat3
save `cat3'
restore
*************************************************
// Democrats
/* prtesti 447 3 450 2, count
Two-sample test of proportions x: Number of obs = 447
y: Number of obs = 450
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .0067114 .0038618 -.0008576 .0142804
y | .0044444 .0031357 -.0017014 .0105903
-------------+----------------------------------------------------------------
diff | .002267 .0049746 -.007483 .0120169
| under Ho: .0049718 0.46 0.648
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = 0.4560
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.6758 Pr(|Z| < |z|) = 0.6484 Pr(Z > z) = 0.3242*/
local pvalue4 = 0.65 // 2-sided test
local pvalue4 = trim("`: di %9.2f 0.65'")
* Means
mat R[1,1] = 0.0067 // Democrats T74
mat R[2,1] = 0.00444 // Democrats T94
* Lower bounds
mat R[1,2] = -.0008576 // Democrats T74
mat R[2,2] = -.0017014 // Democrats T94
* Upper bounds
mat R[1,3] = .0142804 // Democrats T74
mat R[2,3] = .0105903 // Democrats T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 4
mat R[2,5] = 4
preserve
clear
svmat R
tempfile cat4
save `cat4'
restore
*************************************************
// Non-Democrats
/*prtesti 558 10 557 18, count
Two-sample test of proportions x: Number of obs = 558
y: Number of obs = 557
------------------------------------------------------------------------------
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .0179211 .0056162 .0069137 .0289286
y | .032316 .0074929 .0176302 .0470017
-------------+----------------------------------------------------------------
diff | -.0143948 .009364 -.0327479 .0039582
| under Ho: .0093716 -1.54 0.125
------------------------------------------------------------------------------
diff = prop(x) - prop(y) z = -1.5360
Ho: diff = 0
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(Z < z) = 0.0623 Pr(|Z| < |z|) = 0.1245 Pr(Z > z) = 0.9377*/
local pvalue5 = 0.12 // 2-sided test
* Means
mat R[1,1] = 0.01792 // Non-Democrats T74
mat R[2,1] = 0.0323 // Non-Democrats T94
* Lower bounds
mat R[1,2] = .0069137 // Democrats T74
mat R[2,2] = .0176302 // Democrats T94
* Upper bounds
mat R[1,3] = .0289286 // Democrats T74
mat R[2,3] = .0470017 // Democrats T94
mat R[1,4]=1
mat R[2,4]=2
mat R[1,5] = 5
mat R[2,5] = 5
preserve
clear
svmat R
tempfile cat5
save `cat5'
restore
// Save bar graph matrix as dataset
clear
local numcats = "1 2 3 4 5"
foreach a of local numcats {
append using `cat`a''
}
* For alignment along the x-axis
gen s1 = R5
gen s2 = .
replace s2 = s1 - 0.2 if R5 == 1
replace s2 = s1 - 0.6 if R5 == 2
replace s2 = s1 - 1.0 if R5 == 3
replace s2 = s1 - 1.4 if R5 == 4
replace s2 = s1 - 1.8 if R5 == 5
gen pos1 = (s2 - 0.1) - .6
gen pos2 = s2 + 0.1 - .6
* This recovers the group means with which to label each bar.
local i = 0
foreach pos of local numcats {
forval rel = 1/2 {
local ++i
sum R1 if R4 == `rel' & R5 == `pos'
local barval`i' = trim("`: di %9.2f r(mean)'")
}
}
global barlabels `"0.2 "All" 0.8 "Women" 1.4 "Men" 2.0 "Democrats" 2.6 "Non-Democrats" "'
global pvalues `"0.08 0.2 "p-value = `pvalue1'" 0.08 0.8 "p-value = `pvalue2'" 0.08 1.4 "p-value = `pvalue3'" 0.08 2.0 "p-value = `pvalue4'" 0.08 2.6 "p-value = `pvalue5'" "'
global barvalues = `"0.05 0.1 "`barval1'" 0.05 0.3 "`barval2'" 0.05 0.7 "`barval3'" 0.05 0.9 "`barval4'" 0.05 1.3 "`barval5'" 0.05 1.5 "`barval6'" 0.05 1.9 "`barval7'" 0.05 2.1 "`barval8'" 0.05 2.5 "`barval9'" 0.05 2.7 "`barval10'" "'
twoway (bar R1 pos1 if R4 == 1, barw(0.18) fi(inten50) lc(black) lw(medium)) (bar R1 pos2 if R4 == 2, barw(0.18) fi(inten20) lc(black) lw(medium)) ///
(rcap R3 R2 pos1 if R4 == 1, lc(gs5)) (rcap R3 R2 pos2 if R4 == 2, lc(gs5)), legend(${legend}) graphregion(color(white)) ///
yscale(range(0.1)) yla(0(0.05)0.1) xla($barlabels, labsize(2.5)) text($pvalues, size(2.5)) text($barvalues, size(2.5)) ///
ytitle("Fraction of respondents who signed", height(5))
graph export "$output\fig_petitionII_2sided.pdf", replace
***********************************************************************************
// Figure A.13: Heterogeneity by gender x age
***********************************************************************************
clear all
use "$path\data\SurveyStageI_AB_final.dta", clear
*global controls wave democrat indep otherpol prior midwest south west anychildren loghhinc associatemore fulltime parttime selfemp unemp student
// Generate two matrices R1 and R2 for male and female,
* columns will contain point estimate of treatment effect, upper and lower bound of CI
* rows will contain 5 age groups
forv s=0/1{
matrix R`s' = J(5, 3, .)
matrix coln R`s' = coef lb95 ub95
matrix rown R`s' = "18-24" "25-34" "35-44" "45-54" "55-65"
}
// Estimate treatment effect by gender x age group, excluding the pure control group (rand=0)
forv s=0/1{
forv i = 1/5 {
reg z_lmpolicy_index T1 $controls if rand!=0&gender==`s' & age==`i'
matrix reg = e(b)
matrix var = e(V)
matrix list reg
matrix list var
local coef=reg[1,1]
local var1=var[1,1]
local se= sqrt(`var1')
local lb=`coef' - 1.645*`se'
local ub=`coef' + 1.645*`se'
matrix R`s'[`i',1] = `coef'
matrix R`s'[`i',2] = `lb'
matrix R`s'[`i',3] = `ub'
}
}
// Generate a set of matrices M1 and M2 for male and female responents
* 5 rows will contain control group means by age group
forv s=0/1{
matrix M`s' = J(5, 1, .)
matrix coln M`s' = mean
matrix rown M`s' = "18-24" "25-34" "35-44" "45-54" "55-65"
}
// calculate control group means by gender x age group
forv s=0/1{
forv i = 1/5 {
mean z_lmpolicy_index if rand==0&gender==`s' & age==`i'
matrix mean = e(b)
matrix list mean
local mean=mean[1,1]
matrix M`s'[`i',1] = `mean'
}
}
// Plot graph containing control group means and treatment effects for male resondents
coefplot (matrix(M0[,1]), weight(25) recast(bar) noci barwidth(0.4) color(ltblue)) ///
(matrix(R0[,1]), ci((2 3)) ciopts(recast(rcap))) ///
, vertical color(blue) nooffsets legend(off) ///
xtitle("Age group", size(4)) ytitle("Mean/Treatment effect T{sup:74}", size(4)) title("Male respondents") name(graph190CI)
// Plot graph containing control group means and treatment effects for female resondents
coefplot (matrix(M1[,1]), weight(25) recast(bar) noci barwidth(0.4) color(erose)) ///
(matrix(R1[,1]), ci((2 3)) ciopts(recast(rcap))) ///
,vertical color(red) nooffsets legend(off) ///
xtitle("Age group", size(4)) ytitle("Mean/Treatment effect T{sup:74}", size(4)) title("Female respondents") name(graph290CI)
graph combine graph190CI graph290CI, xsize(4) ysize(2.5) name(coefplot, replace)
graph export "$output\T1_mean_bygenderbyage_90CI.pdf", replace
***********************************************************************************
// Figure A.14: Willingness to pay for additional information
***********************************************************************************
set scheme s2mono
use "$path\data\SurveyStageI_AB_final.dta", clear
keep if rand==0 // Keep only pure control group
keep infopaysupport infopayoppose T1 T2 democrat republican gender pweight
gen women=(gender==1)
gen men=(gender==0)
local outcome1 = "infopaysupport"
local outcome2 = "infopayoppose"
**** Calculate numbers for bar graph matrix
* Note: pweights can be ignored for this graph because it is based on Wave A only, i.e. all pweights equal 1.
mat R=J(2,6,.)
*1) Supportive info, by gender
reg `outcome1' men, robust
local pvalue1 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[men]/_se[men]))'")
local row=1
foreach X in women men {
sum `outcome1' if `X' == 1
mat R[`row',1] = r(mean)
mat R[`row',2]=_b[_cons] + _b[men]-1.96*_se[men]
mat R[`row',3]=_b[_cons] + _b[men]+1.96*_se[men]
mat R[`row',4]=`row'
mat R[`row',5] = 1 // category
local ++row
}
preserve
clear
svmat R
tempfile cat1
save `cat1'
restore
*2) Supportive info, by pol. orientation
reg `outcome1' republican if democrat==1|republican==1, robust
local pvalue2 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[republican]/_se[republican]))'")
local row=1
foreach X in democrat republican {
sum `outcome1' if `X' == 1
mat R[`row',1] = r(mean)
mat R[`row',2]=_b[_cons] + _b[republican]-1.96*_se[republican]
mat R[`row',3]=_b[_cons] + _b[republican]+1.96*_se[republican]
mat R[`row',4]=`row'
mat R[`row',5] = 2 // category
local ++row
}
preserve
clear
svmat R
tempfile cat2
save `cat2'
restore
*************************************************
*3) Traditional info, by gender
reg `outcome2' men, robust
local pvalue3 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[men]/_se[men]))'")
local row=1
foreach X in women men{
sum `outcome2' if `X' == 1
mat R[`row',1] = r(mean)
mat R[`row',2]=_b[_cons] + _b[men]-1.96*_se[men]
mat R[`row',3]=_b[_cons] + _b[men]+1.96*_se[men]
mat R[`row',4]=`row'
mat R[`row',5] = 3 // category
local ++row
}
preserve
clear
svmat R
tempfile cat3
save `cat3'
restore
************************************************
*4) Traditional info, by pol. orientation
reg `outcome2' republican if democrat==1|republican==1, robust
local pvalue4 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[republican]/_se[republican]))'")
local row=1
foreach X in democrat republican {
sum `outcome2' if `X' == 1
mat R[`row',1] = r(mean)
mat R[`row',2]=_b[_cons] + _b[republican]-1.96*_se[republican]
mat R[`row',3]=_b[_cons] + _b[republican]+1.96*_se[republican]
mat R[`row',4]=`row'
mat R[`row',5] = 4 // category
local ++row
}
preserve
clear
svmat R
tempfile cat4
save `cat4'
restore
* Save bar graph matrix as dataset
clear
local numcats = "1 2 3 4"
foreach a of local numcats {
append using `cat`a''
}
* For alignment along the x-axis
gen s1 = R5
gen s2 = .
replace s2 = s1 - 0.2 if R5 == 1
replace s2 = s1 - 0.6 if R5 == 2
replace s2 = s1 - 1.0 if R5 == 3
replace s2 = s1 - 1.4 if R5 == 4
gen pos1 = (s2 - 0.1) - .6
gen pos2 = s2 + 0.1 - .6
* This recovers the group means with which to label each bar.
local i = 0
foreach cat of local numcats {
forval rel = 1/2 {
local ++i
sum R1 if R4 == `rel' & R5 == `cat'
local barval`i' = trim("`: di %9.2f r(mean)'")
}
}
global barlabels `"0.2 "Gender" 0.8 "Pol. orientation" 1.4 "Gender" 2.0 "Pol. orientation""'
global pvalues `"1.8 0.2 "p-value = `pvalue1'" 1.8 0.8 "p-value = `pvalue2'" 1.8 1.4 "p-value = `pvalue3'" 1.8 2.0 "p-value = `pvalue4'""'
global grouplabels `"2.0 0.5 "Supportive Information" 2.0 1.7 "Traditional Information""'
global bargroups = `"0.3 0.1 "Women" 0.3 0.3 "Men" 0.3 0.7 "Dem." 0.3 0.9 "Repub." 0.3 1.3 "Women" 0.3 1.5 "Men" 0.3 1.9 "Dem." 0.3 2.1 "Rep.""'
global barvalues = `"0.1 0.1 "`barval1'" 0.1 0.3 "`barval2'" 0.1 0.7 "`barval3'" 0.1 0.9 "`barval4'" 0.1 1.3 "`barval5'" 0.1 1.5 "`barval6'" 0.1 1.9 "`barval7'" 0.1 2.1 "`barval8'""'
twoway (bar R1 pos1 if R4 == 1, barw(0.18) fi(inten50) lc(black) lw(medium)) (bar R1 pos2 if R4 == 2, barw(0.18) fi(inten20) lc(black) lw(medium)) ///
(rcap R3 R2 pos2 if R4 == 2, lc(gs5)), legend(off) graphregion(color(white)) ///
yscale(range(2)) yla(0(0.5)2.1) xla($barlabels, labsize(3.5)) text($pvalues, size(3.5)) text($grouplabels, size(4.0)) text($bargroups, size(3.0)) text($barvalues, size(3.5)) ///
ytitle("Willingness to pay for additional info", size(4.5) height(5))
graph export "$output\fig_infopay0.pdf", replace
***********************************************************************************
// Figure A.15: Non-linearity in correlation between beliefs about the gender wage gap and outcomes
***********************************************************************************
use "$path\data\SurveyStageI_AB_final.dta", clear
binscatter large prior if rand==0 [aweight=pweight], nquantiles(15) rd(50, 116) xtitle("Prior belief") ytitle("Gender diff. in wages are large")
graph export "$output\large_binscatter_discontinuity.pdf", replace
binscatter problem prior if rand==0 [aweight=pweight], nquantiles(15) rd(50, 116) xtitle("Prior belief") ytitle("Gender diff. in wages are a problem")
graph export "$output\problem_binscatter_discontinuity.pdf", replace
binscatter govmore prior if rand==0 [aweight=pweight], nquantiles(15) rd(50, 116) xtitle("Prior belief") ytitle("Gov. should promote gender wage equality")
graph export "$output\govmore_binscatter_discontinuity.pdf", replace
binscatter quotaanchor prior if rand==0 [aweight=pweight], nquantiles(15) rd(50, 116) xtitle("Prior belief") ytitle("Introduce gender quotas")
graph export "$output\quota_binscatter_discontinuity.pdf", replace
binscatter AAanchor prior if rand==0 [aweight=pweight], nquantiles(15) rd(50, 116) xtitle("Prior belief") ytitle("Statutory affirmative action")
graph export "$output\AA_binscatter_discontinuity.pdf", replace
binscatter legislationanchor prior if rand==0 [aweight=pweight], nquantiles(25) rd(50, 116) xtitle("Prior belief") ytitle("Stricter equal pay legislation")
graph export "$output\legis_binscatter_discontinuity.pdf", replace
binscatter transparencyanchor prior if rand==0 [aweight=pweight], nquantiles(15) rd(50, 116) xtitle("Prior belief") ytitle("Wage transparency within companies")
graph export "$output\transp_binscatter_discontinuity.pdf", replace
binscatter UKtool prior if rand==0 [aweight=pweight], nquantiles(15) rd(50, 116) xtitle("Prior belief") ytitle("Introduce reporting website")
graph export "$output\UKtool_binscatter_discontinuity.pdf", replace
binscatter childcare prior if rand==0 [aweight=pweight], nquantiles(15) rd(50, 116) xtitle("Prior belief") ytitle("Increase subsidies to child care")
graph export "$output\childcare_binscatter_discontinuity.pdf", replace