Repository for replication files for "Deep canvassing with automated conversational agents: personalized messaging to change attitudes".
Ensure /data/df_for_analysis_final.rds exists, then run:
cd code
Rscript pre_processing_senderdb.ROutputs:
/data/df_for_analysis_processed.rds(5,115 observations, 31 variables)/tables/attrition_summary.tex- Summary of pre-survey, control, and treatment group sizes and completion rates
Run the main analysis script (automatically sources utils.R):
Rscript main_analysis.ROutputs:
/tables/main_results.tex- Main treatment effects (all respondents)/tables/dem_results.tex- Subgroup analysis (Democrats)/tables/rep_results.tex- Subgroup analysis (Republicans)/tables/ind_results.tex- Subgroup analysis (Independents)
Run robustness analysis:
Rscript robustness.ROutputs:
/tables/balance_table_all.tex- Covariate balance (all respondents)/tables/balance_table_completers.tex- Covariate balance (completers)/tables/placebo_leave_one_out.tex- Leave-one-out covariate placebo test/tables/placebo_outcomes.tex- Placebo outcomes test
Generate Manski bounds with bootstrapped confidence intervals:
Rscript bootstrapping_manski.R # Bootstrap confidence intervalsNote: If boot_UB.rds and boot_LB.rds already exist in /data/, the script will use them by default to quickly generate the table. To force regeneration of bootstrap results (e.g., after changing parameters), set USE_EXISTING_BOOTSTRAP <- FALSE at the top of the script.
Outputs:
/data/boot_UB.rds,/data/boot_LB.rds- Bootstrap results (if generated)/tables/manski_bounds_ci.tex- Manski bounds with 95% confidence intervals
Run the figures script to create visualizations:
mkdir -p ../figures # Create figures directory if it doesn't exist
Rscript figures.ROutputs:
/figures/Figure1_treatment_effects.png/.tiff- Treatment effects plot for all respondents (3 outcomes × 3 models)/figures/FigureSI2_treatment_effects_by_subgroup.png/.tiff- Treatment effects by party affiliation (Overall, Democrats, Republicans, Independents)
Rscript datamaid_codebook.ROutput: /test-data-codebook.Rmd - Data dictionary for all variables