show code
dcOpinion_study4 = merge(read.csv('study 4/dataCenterOpinions_study4.csv'), read.csv('study 4/prolificDemographics_DCopinion_study4.csv'), by='PROLIFIC_PID') |>
filter(Status!='RETURNED' & consent==1) |>
mutate(condition= factor(condition, levels=c('dataCenter','landfill','nuclearPowerPlant','warehouse')),
supporter_bin = factor(ifelse(sentiment > 0, "Supporter", "Non-supporter")))
nice_table(dcOpinion_study4 %>% group_by(condition) %>% count(), title = 'N per condition')N per condition | |
|---|---|
condition | n |
dataCenter | 206 |
landfill | 203 |
nuclearPowerPlant | 203 |
warehouse | 200 |
show code
ggerrorplot(data=dcOpinion_study4, color='condition', x = 'condition', y = 'sentiment', title='Support for local facility. Full scale -2 to 2')show code
benefits_long = dcOpinion_study4 |> select(condition, benefit_self, benefit_neighborhood, benefit_town, benefit_state, benefit_country) |>
pivot_longer(
cols = c(benefit_self, benefit_neighborhood, benefit_town, benefit_state, benefit_country),
names_to = "benefit_type",
names_prefix = "benefit_",
values_to = "benefit")
ggerrorplot(data=benefits_long, color='benefit_type', x ='condition', y = 'benefit', position=position_dodge(0), title='Perceived benefits of facility. Full scale 0 - 3')show code
nice_table(dcOpinion_study4 %>% filter(!is.na(priceOnSupport_1)) |> group_by(condition) %>% summarise(median=median(priceOnSupport_1)/1000, min = min(priceOnSupport_1), max = max(priceOnSupport_1)/1000), title = "Payment required for support, in thousands. (minimum reported in raw)")Payment required for support, in thousands. (minimum reported in raw) | |||
|---|---|---|---|
condition | median | min | max |
dataCenter | 15.00 | 0.00 | 10,000,000,000,000,017,583,607,936,365,707,443,642,779,759,642,417,653,467,751,731,161,425,031,252,187,748,907,155,351,519,777,830,721,715,057,328,371,269,632.00 |
landfill | 10.00 | 0.00 | 10,000,000.00 |
nuclearPowerPlant | 100.00 | 0.00 | 90,000,000,000,000,006,360,851,714,686,920,526,135,296.00 |
warehouse | 2.85 | 0.00 | 5,000.00 |
show code
ggerrorplot(data=subset(dcOpinion_study4, priceOnSupport_1 < 1000000000), color='condition', x ='condition', y = 'priceOnSupport_1', title='Payment required for support. Cutoff: $1 billion')show code
ggplot(subset(dcOpinion_study4, priceOnSupport_1 < 1000000) , aes(x=priceOnSupport_1/1000, color=condition, fill=condition))+
geom_density( alpha=0.4)+
geom_vline(aes(xintercept=mean(priceOnSupport_1)/1000),linetype="dashed", linewidth=0.5)+
labs(x="Payment required for support, in thousands.", title="Cutoff: $1 million")+
theme_classic()