|
|
|
|
|
|
|
|
| |
| |
| |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
| |
|
|
|
|
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
| prtesti 1531 259 1500 220, count
|
|
|
| clear all
|
| set scheme s2mono
|
|
|
| global legend = `"label(1 "T{sup:74}") label(2 "T{sup:94}") order(1 2) size(large)"'
|
|
|
|
|
|
|
|
|
|
|
|
|
| mat R=J(2,6,.)
|
|
|
| local pvalue1 = 0.09
|
|
|
|
|
| mat R[1,1] = 0.16917
|
| mat R[2,1] = 0.14667
|
|
|
|
|
| mat R[1,2] = 0.1504
|
| mat R[2,2] = 0.1288
|
|
|
|
|
| mat R[1,3] = 0.1879
|
| mat R[2,3] = 0.1646
|
|
|
| mat R[1,4]=1
|
| mat R[2,4]=2
|
|
|
| mat R[1,5] = 1
|
| mat R[2,5] = 1
|
|
|
| mat R[1,6] = 1
|
| mat R[2,6] = 1
|
|
|
| preserve
|
| clear
|
| svmat R
|
| tempfile Pet1
|
| save `Pet1'
|
| restore
|
|
|
|
|
|
|
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
| prtesti 1531 19 1500 35, count
|
|
|
|
|
|
|
|
|
|
|
|
|
| local pvalue2 = 0.02
|
|
|
|
|
| mat R[1,1] = 0.01241
|
| mat R[2,1] = 0.02333
|
|
|
|
|
| mat R[1,2] = 0.0069
|
| mat R[2,2] = 0.0157
|
|
|
|
|
| mat R[1,3] = 0.01796
|
| mat R[2,3] = 0.031
|
|
|
| mat R[1,4]=1
|
| mat R[2,4]=2
|
|
|
| mat R[1,5] = 1
|
| mat R[2,5] = 1
|
|
|
| mat R[1,6] = 2
|
| mat R[2,6] = 2
|
|
|
| preserve
|
| clear
|
| svmat R
|
| tempfile Pet2
|
| save `Pet2'
|
| restore
|
|
|
|
|
|
|
| clear
|
|
|
| local numcats = "1 2 "
|
| foreach a of local numcats {
|
| append using `Pet`a''
|
| }
|
|
|
|
|
|
|
| gen s1 = R6
|
| gen s2 = .
|
| replace s2 = s1 - 0.2 if R6 == 1
|
| replace s2 = s1 - 0.6 if R6 == 2
|
| replace s2 = s1 - 1.0 if R6 == 3
|
| replace s2 = s1 - 1.4 if R6 == 4
|
| replace s2 = s1 - 1.8 if R6 == 5
|
| gen p1 = (s2 - 0.1) - .6
|
| gen p2 = s2 + 0.1 - .6
|
|
|
|
|
|
|
| local i = 0
|
| foreach pgrade of local numcats {
|
| forval rel = 1/2 {
|
| local ++i
|
| sum R1 if R4 == `rel' & R6 == `pgrade'
|
| local barval`i' = trim("`: di %9.2f r(mean)'")
|
| }
|
| }
|
|
|
|
|
|
|
| global barlabels `" " 0.8 " " "'
|
| global pvalues `"0.22 0.2 "p-value = `pvalue1'" 0.22 0.8 "p-value = `pvalue2'" "'
|
| global grouplabels `"0.27 0.2 "Petition I:" 0.27 0.8 "Petition II:""'
|
| global grouplabels2 `"0.258 0.2 "Increase rep. requirements" 0.258 0.8 "Decrease rep. requirements""'
|
| global barvalues = `"0.04 0.1 "`barval1'" 0.04 0.3 "`barval2'" 0.04 0.7 "`barval3'" 0.04 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 p1 if R4 == 1, lc(gs5)) (rcap R3 R2 p2 if R4 == 2, lc(gs5)), legend(${legend}) graphregion(color(white))
|
| yscale(range(0.3)) yla(0(0.05)0.3) xla(none) text($pvalues, size(4.0)) text($grouplabels, size(4.0)) text($grouplabels2, size(4.0)) text($barvalues, size(4.0))
|
| ytitle("Fraction of respondents who signed", height(5) size(4.2))
|
| graph export "$output\fig_petitions_combined.pdf", replace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| set scheme s2mono
|
|
|
| use "$path\data\SurveyStageI_AB_final.dta", clear
|
|
|
| keep prior prior1 pweight wave democrat republican indep otherpol gender midwest south west age1 age2 age3 age4 anychildren loghhinc associatemore fulltime parttime selfemp unemp student
|
|
|
| gen priormen=prior if gender==0
|
| gen priorwoman=prior if gender==1
|
| gen priorrepub=prior if republican==1
|
| gen priordem = prior if democrat==1
|
|
|
| lab var priormen "Men"
|
| lab var priorwoman "Women"
|
| lab var priorrepub "Republican"
|
| lab var priordem "Democrat"
|
|
|
| rename prior1 incentive
|
|
|
| global legend = `"label(1 "No incentive") label(2 "Incentive") order(1 2) size(small)"'
|
|
|
| gen notincentive = 1-incentive
|
|
|
| local gender = "$gender"
|
| if "$gender" == "male" local genval = 0
|
| if "$gender" == "female" local genval = 1
|
|
|
| local group1 = "priormen"
|
| local group2 = "priorwoman"
|
| local group3 = "priorrepub"
|
| local group4 = "priordem"
|
| local numcats = "1 2 3 4"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| mat R=J(2,5,.)
|
|
|
|
|
| local row=1
|
| foreach X in notincentive incentive{
|
| mean `group1' if `X' == 1 [pweight=pweight]
|
| mat R[`row',1] = e(b)
|
| local ++row
|
| }
|
|
|
|
|
|
|
| mean `group1' if notincentive == 1 [pweight=pweight]
|
| matrix meannoin=e(b)
|
|
|
|
|
| reg `group1' incentive [pweight=pweight], robust
|
| local pvalue1 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[incentive]/_se[incentive]))'")
|
|
|
|
|
| local row=1
|
| foreach X in notincentive incentive {
|
| mat R[`row',2]= meannoin[1,1] + _b[incentive]-1.96*_se[incentive]
|
| mat R[`row',3]= meannoin[1,1] + _b[incentive]+1.96*_se[incentive]
|
| mat R[`row',4]=`row'
|
| mat R[`row',5] = 1
|
| local ++row
|
| }
|
|
|
|
|
|
|
| preserve
|
| clear
|
| svmat R
|
| tempfile cat1
|
| save `cat1'
|
| restore
|
|
|
|
|
|
|
|
|
| mat R=J(2,5,.)
|
|
|
|
|
| local row=1
|
| foreach X in notincentive incentive{
|
| mean `group2' if `X' == 1 [pweight=pweight]
|
| mat R[`row',1] = e(b)
|
| local ++row
|
| }
|
|
|
|
|
| mean `group2' if notincentive == 1 [pweight=pweight]
|
| matrix meannoin=e(b)
|
|
|
|
|
| reg `group2' incentive [pweight=pweight], robust
|
| local pvalue2 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[incentive]/_se[incentive]))'")
|
|
|
|
|
| local row=1
|
| foreach X in notincentive incentive {
|
| mat R[`row',2]= meannoin[1,1] + _b[incentive]-1.96*_se[incentive]
|
| mat R[`row',3]= meannoin[1,1] + _b[incentive]+1.96*_se[incentive]
|
| mat R[`row',4]=`row'
|
| mat R[`row',5] = 2
|
| local ++row
|
| }
|
|
|
|
|
| preserve
|
| clear
|
| svmat R
|
| tempfile cat2
|
| save `cat2'
|
| restore
|
|
|
|
|
|
|
|
|
| mat R=J(2,5,.)
|
|
|
|
|
| local row=1
|
| foreach X in notincentive incentive{
|
| mean `group3' if `X' == 1 [pweight=pweight]
|
| mat R[`row',1] = e(b)
|
| local ++row
|
| }
|
|
|
|
|
|
|
| mean `group3' if notincentive == 1 [pweight=pweight]
|
| matrix meannoin=e(b)
|
|
|
|
|
| reg `group3' incentive [pweight=pweight], robust
|
| local pvalue3 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[incentive]/_se[incentive]))'")
|
|
|
| local row=1
|
| foreach X in notincentive incentive {
|
| mat R[`row',2]= meannoin[1,1] + _b[incentive]-1.96*_se[incentive]
|
| mat R[`row',3]= meannoin[1,1] + _b[incentive]+1.96*_se[incentive]
|
| mat R[`row',4]=`row'
|
| mat R[`row',5] = 3
|
| local ++row
|
| }
|
|
|
|
|
|
|
| preserve
|
| clear
|
| svmat R
|
| tempfile cat3
|
| save `cat3'
|
| restore
|
|
|
|
|
|
|
|
|
| mat R=J(2,5,.)
|
|
|
|
|
| local row=1
|
| foreach X in notincentive incentive{
|
| mean `group4' if `X' == 1 [pweight=pweight]
|
| mat R[`row',1] = e(b)
|
| local ++row
|
| }
|
|
|
|
|
|
|
| mean `group4' if notincentive == 1 [pweight=pweight]
|
| matrix meannoin=e(b)
|
|
|
|
|
| reg `group4' incentive [pweight=pweight], robust
|
| local pvalue4 = trim("`: di %9.3f 2*ttail(e(df_r), abs(_b[incentive]/_se[incentive]))'")
|
|
|
| local row=1
|
| foreach X in notincentive incentive {
|
| mat R[`row',2]= meannoin[1,1] + _b[incentive]-1.96*_se[incentive]
|
| mat R[`row',3]= meannoin[1,1] + _b[incentive]+1.96*_se[incentive]
|
| mat R[`row',4]=`row'
|
| mat R[`row',5] = 4
|
| local ++row
|
| }
|
|
|
|
|
| preserve
|
| clear
|
| svmat R
|
| tempfile cat4
|
| save `cat4'
|
| restore
|
|
|
|
|
|
|
| clear
|
| foreach a of local numcats {
|
| append using `cat`a''
|
| }
|
|
|
|
|
|
|
| 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 pgrade1 = (s2 - 0.1) - .6
|
| gen pgrade2 = s2 + 0.1 - .6
|
|
|
|
|
| local i = 0
|
| foreach pgroup of local numcats {
|
| forval rel = 1/2 {
|
| local ++i
|
| sum R1 if R4 == `rel' & R5 == `pgroup'
|
| local barval`i' = trim("`: di %9.2f r(mean)'")
|
| }
|
| }
|
|
|
| global barlabels `"0.2 "Men" 0.8 "Women" 1.4 "Republicans" 2.0 "Democrats""'
|
| global pvalues `"95 0.2 "p-value = `pvalue1'" 95 0.8 "p-value = `pvalue2'" 95 1.4 "p-value = `pvalue3'" 95 2.0 "p-value = `pvalue4'""'
|
| global barvalues = `"65 0.1 "`barval1'" 65 0.3 "`barval2'" 65 0.7 "`barval3'" 65 0.9 "`barval4'" 65 1.3 "`barval5'" 65 1.5 "`barval6'" 65 1.9 "`barval7'" 65 2.1 "`barval8'""'
|
|
|
|
|
| twoway (bar R1 pgrade1 if R4 == 1, barw(0.18) fi(inten50) lc(black) lw(medium)) (bar R1 pgrade2 if R4 == 2, barw(0.18) fi(inten20) lc(black) lw(medium))
|
| (rcap R3 R2 pgrade2 if R4 == 2, lc(gs5)), legend(${legend}) graphregion(color(white))
|
| yscale(range(98)) yla(60(20)100) xla($barlabels, labsize(3.5)) text($pvalues, size(3.5)) text($barvalues, size(3.5))
|
| ytitle("Prior belief", size (4) height(5))
|
| graph export "$output\fig_motbeliefs1_truncABcont.pdf", replace
|
|
|
|
|
|
|
|
|
|
|
|
|