├── thinkCausal ├── tests │ ├── testthat │ │ ├── test-fct_create.R │ │ ├── test-fct_detect.R │ │ ├── test-fct_reproduce.R │ │ ├── test-fct_learn_estimands.R │ │ ├── test-fct_model.R │ │ └── test-utils_utils.R │ ├── spelling.R │ ├── testthat.R │ └── loadtests │ │ └── README.md ├── .gitignore ├── inst │ ├── app │ │ └── www │ │ │ ├── learn │ │ │ ├── ignorability │ │ │ │ ├── img │ │ │ │ │ ├── .here │ │ │ │ │ ├── p1.png │ │ │ │ │ └── p2.rds │ │ │ │ └── markdowns │ │ │ │ │ ├── section1.md │ │ │ │ │ └── section2.md │ │ │ ├── post-treatment │ │ │ │ ├── learn-post-treatment.css │ │ │ │ ├── p1.png │ │ │ │ ├── p2.png │ │ │ │ ├── p3.png │ │ │ │ ├── p4.png │ │ │ │ ├── p5.png │ │ │ │ └── markdowns │ │ │ │ │ ├── post_treatment_learn_more.md │ │ │ │ │ ├── post_treatment_5.md │ │ │ │ │ ├── post_treatment_citations.md │ │ │ │ │ ├── post_treatment_8.md │ │ │ │ │ ├── post_treatment_3.md │ │ │ │ │ ├── post_treatment_4.md │ │ │ │ │ ├── post_treatment_2.md │ │ │ │ │ └── post_treatment_6.md │ │ │ ├── estimands │ │ │ │ ├── section3.md │ │ │ │ ├── js │ │ │ │ │ ├── 1-namespace.js │ │ │ │ │ └── 6-init.js │ │ │ │ ├── data │ │ │ │ │ ├── line-data.csv │ │ │ │ │ └── point-data.csv │ │ │ │ └── markdowns │ │ │ │ │ ├── estimands_related.md │ │ │ │ │ ├── estimands_citations.md │ │ │ │ │ └── estimands_2.md │ │ │ ├── fundemental │ │ │ │ ├── equations │ │ │ │ │ └── equation1.md │ │ │ │ ├── markdowns │ │ │ │ │ ├── section11.md │ │ │ │ │ ├── section7.md │ │ │ │ │ ├── section10.md │ │ │ │ │ ├── section9.md │ │ │ │ │ ├── section19.md │ │ │ │ │ ├── section12.md │ │ │ │ │ ├── section14.md │ │ │ │ │ ├── section15.md │ │ │ │ │ ├── section16.md │ │ │ │ │ ├── section6.md │ │ │ │ │ ├── section13.md │ │ │ │ │ ├── section8.md │ │ │ │ │ ├── section4.md │ │ │ │ │ ├── section2.md │ │ │ │ │ ├── section3.md │ │ │ │ │ ├── section5.md │ │ │ │ │ ├── section17.md │ │ │ │ │ ├── section18.md │ │ │ │ │ └── section1.md │ │ │ │ └── plots │ │ │ │ │ ├── cf1.png │ │ │ │ │ ├── cf2.png │ │ │ │ │ ├── p1.png │ │ │ │ │ ├── p2.png │ │ │ │ │ ├── p3.png │ │ │ │ │ ├── p4.png │ │ │ │ │ ├── p5.png │ │ │ │ │ ├── p6.png │ │ │ │ │ ├── p6.rds │ │ │ │ │ ├── p7.png │ │ │ │ │ ├── p7.rds │ │ │ │ │ ├── p_pre4.png │ │ │ │ │ ├── factual1.png │ │ │ │ │ └── factual2.png │ │ │ ├── confounder │ │ │ │ ├── ihdp_obs.rds │ │ │ │ ├── markdowns │ │ │ │ │ ├── section29.md │ │ │ │ │ ├── section33.md │ │ │ │ │ ├── section34.md │ │ │ │ │ ├── section24.md │ │ │ │ │ ├── section3.md │ │ │ │ │ ├── section36.md │ │ │ │ │ ├── section48.md │ │ │ │ │ ├── section2.md │ │ │ │ │ ├── section44.md │ │ │ │ │ ├── section13.md │ │ │ │ │ ├── section21.md │ │ │ │ │ ├── section1.md │ │ │ │ │ ├── section4.md │ │ │ │ │ ├── section22.md │ │ │ │ │ ├── section23.md │ │ │ │ │ ├── section40.md │ │ │ │ │ ├── section42.md │ │ │ │ │ ├── section14.md │ │ │ │ │ ├── section6.md │ │ │ │ │ ├── section25.md │ │ │ │ │ ├── section26.md │ │ │ │ │ ├── section7.md │ │ │ │ │ ├── section31.md │ │ │ │ │ ├── section27.md │ │ │ │ │ ├── section52.md │ │ │ │ │ ├── section12.md │ │ │ │ │ ├── section18.md │ │ │ │ │ ├── section5.md │ │ │ │ │ ├── section16.md │ │ │ │ │ ├── section45.md │ │ │ │ │ ├── section28.md │ │ │ │ │ ├── section43.md │ │ │ │ │ ├── section39.md │ │ │ │ │ ├── section37.md │ │ │ │ │ ├── section30.md │ │ │ │ │ ├── section47.md │ │ │ │ │ ├── section19.md │ │ │ │ │ ├── section35.md │ │ │ │ │ ├── section11.md │ │ │ │ │ ├── section20.md │ │ │ │ │ ├── section41.md │ │ │ │ │ ├── section49.md │ │ │ │ │ ├── section9.md │ │ │ │ │ ├── section38.md │ │ │ │ │ ├── section50.md │ │ │ │ │ ├── section10.md │ │ │ │ │ ├── section17.md │ │ │ │ │ ├── section8.md │ │ │ │ │ ├── section15.md │ │ │ │ │ └── scratch.md │ │ │ │ └── plots │ │ │ │ │ ├── p1.png │ │ │ │ │ ├── p2.rds │ │ │ │ │ ├── p3.png │ │ │ │ │ ├── p4.rds │ │ │ │ │ ├── p5.rds │ │ │ │ │ ├── p6.rds │ │ │ │ │ ├── p7.rds │ │ │ │ │ ├── p8.png │ │ │ │ │ ├── p9.rds │ │ │ │ │ ├── p10.png │ │ │ │ │ ├── p11.png │ │ │ │ │ ├── p12.png │ │ │ │ │ ├── p13.png │ │ │ │ │ ├── p14.png │ │ │ │ │ ├── p15.png │ │ │ │ │ ├── p16.png │ │ │ │ │ ├── p17.rds │ │ │ │ │ ├── p18.png │ │ │ │ │ ├── p19.rds │ │ │ │ │ ├── p20.rds │ │ │ │ │ ├── p21.rds │ │ │ │ │ ├── p22.rds │ │ │ │ │ ├── p23.rds │ │ │ │ │ ├── p24.rds │ │ │ │ │ ├── p25.rds │ │ │ │ │ ├── p26.rds │ │ │ │ │ ├── p27.rds │ │ │ │ │ ├── p28.rds │ │ │ │ │ ├── p29.rds │ │ │ │ │ ├── p30.png │ │ │ │ │ ├── p31.rds │ │ │ │ │ ├── p32.png │ │ │ │ │ ├── p33.png │ │ │ │ │ ├── p34.png │ │ │ │ │ ├── p35.png │ │ │ │ │ ├── p36.png │ │ │ │ │ ├── p37.png │ │ │ │ │ ├── p37.rds │ │ │ │ │ ├── p38.rds │ │ │ │ │ ├── p39.png │ │ │ │ │ ├── p39.rds │ │ │ │ │ ├── p40.rds │ │ │ │ │ ├── p41.png │ │ │ │ │ ├── p41.rds │ │ │ │ │ ├── p42.rds │ │ │ │ │ ├── p43.png │ │ │ │ │ ├── p43.rds │ │ │ │ │ ├── p44.rds │ │ │ │ │ ├── p45.rds │ │ │ │ │ ├── p46.png │ │ │ │ │ ├── p46.rds │ │ │ │ │ ├── p47.png │ │ │ │ │ ├── p47.rds │ │ │ │ │ ├── p48.rds │ │ │ │ │ ├── p49.rds │ │ │ │ │ └── p50.rds │ │ │ ├── estimands2 │ │ │ │ ├── plots │ │ │ │ │ ├── p1.png │ │ │ │ │ ├── p2.png │ │ │ │ │ ├── p3.png │ │ │ │ │ ├── p4.png │ │ │ │ │ ├── p5.png │ │ │ │ │ ├── p6.png │ │ │ │ │ ├── p7.png │ │ │ │ │ ├── p8.png │ │ │ │ │ ├── p9.png │ │ │ │ │ ├── p10.png │ │ │ │ │ ├── p11.png │ │ │ │ │ ├── p12.png │ │ │ │ │ ├── p13.png │ │ │ │ │ ├── p14.png │ │ │ │ │ ├── p15.png │ │ │ │ │ ├── p16.png │ │ │ │ │ ├── p17.png │ │ │ │ │ ├── p18.png │ │ │ │ │ ├── p19.png │ │ │ │ │ ├── p20.png │ │ │ │ │ ├── p21.png │ │ │ │ │ ├── p22.png │ │ │ │ │ ├── p23.png │ │ │ │ │ ├── p24.png │ │ │ │ │ ├── p25.png │ │ │ │ │ ├── p26.png │ │ │ │ │ ├── p16.2.png │ │ │ │ │ ├── quiz1.png │ │ │ │ │ ├── quiz2.png │ │ │ │ │ ├── quiz3.png │ │ │ │ │ ├── no_overlap.png │ │ │ │ │ └── partial_overlap.png │ │ │ │ └── markdowns │ │ │ │ │ ├── section11.md │ │ │ │ │ ├── section19.md │ │ │ │ │ ├── section12.md │ │ │ │ │ ├── section18.md │ │ │ │ │ ├── section7.md │ │ │ │ │ ├── section10.md │ │ │ │ │ ├── section4.md │ │ │ │ │ ├── section17.md │ │ │ │ │ ├── section2.md │ │ │ │ │ ├── section23.md │ │ │ │ │ ├── section16.md │ │ │ │ │ ├── section5.md │ │ │ │ │ ├── section14.md │ │ │ │ │ ├── section13.md │ │ │ │ │ ├── section3.md │ │ │ │ │ ├── section15.md │ │ │ │ │ ├── section8.md │ │ │ │ │ ├── section9.md │ │ │ │ │ ├── section21.md │ │ │ │ │ ├── section1.md │ │ │ │ │ ├── section6.md │ │ │ │ │ ├── section20.md │ │ │ │ │ ├── section22.md │ │ │ │ │ └── intro.md │ │ │ ├── colinearity │ │ │ │ ├── plots │ │ │ │ │ └── p1.png │ │ │ │ └── markdowns │ │ │ │ │ ├── section1.md │ │ │ │ │ ├── section2.md │ │ │ │ │ ├── section3.md │ │ │ │ │ └── intro.md │ │ │ ├── potential-outcomes │ │ │ │ ├── markdowns │ │ │ │ │ ├── potential_outcomes_related.md │ │ │ │ │ ├── potential_outcomes_citations.md │ │ │ │ │ ├── potential_outcomes2_treated.md │ │ │ │ │ ├── potential_outcomes2_control.md │ │ │ │ │ ├── potential_outcomes5.md │ │ │ │ │ ├── potential_outcomes3_control.md │ │ │ │ │ ├── potential_outcomes3_treated.md │ │ │ │ │ └── potential_outcomes1.md │ │ │ │ ├── illustrations │ │ │ │ │ ├── PO_control.png │ │ │ │ │ ├── PO_treated.png │ │ │ │ │ ├── hist_control.png │ │ │ │ │ ├── hist_treated.png │ │ │ │ │ ├── eight_runners_2.png │ │ │ │ │ ├── eight_runners_1_hyper.png │ │ │ │ │ ├── eight_runners_1_normal.png │ │ │ │ │ ├── Factual_conterfactual_control.png │ │ │ │ │ └── Factual_conterfactual_treated.png │ │ │ │ └── learn-potential-outcomes.css │ │ │ ├── observational-analysis │ │ │ │ ├── plots │ │ │ │ │ ├── p1.png │ │ │ │ │ ├── p2.png │ │ │ │ │ ├── p3.png │ │ │ │ │ ├── p4.png │ │ │ │ │ ├── p5.png │ │ │ │ │ ├── p6.png │ │ │ │ │ ├── p7.png │ │ │ │ │ ├── p8.png │ │ │ │ │ ├── p9.png │ │ │ │ │ ├── p10.png │ │ │ │ │ ├── p11.png │ │ │ │ │ ├── p12.png │ │ │ │ │ ├── p13.png │ │ │ │ │ ├── p14.png │ │ │ │ │ ├── p15.png │ │ │ │ │ └── p16.png │ │ │ │ └── markdowns │ │ │ │ │ ├── observational_learn_more.md │ │ │ │ │ ├── observational_citations.md │ │ │ │ │ ├── observational-analysis5.md │ │ │ │ │ ├── observational-analysis12.md │ │ │ │ │ ├── observational-analysis8.md │ │ │ │ │ ├── observational-analysis2.md │ │ │ │ │ ├── observational-analysis13.md │ │ │ │ │ ├── observational-analysis3.md │ │ │ │ │ ├── observational-analysis11.md │ │ │ │ │ ├── observational-analysis10.md │ │ │ │ │ ├── observational-analysis9.md │ │ │ │ │ ├── observational-analysis6.md │ │ │ │ │ └── observational-analysis7.md │ │ │ ├── randomized-analysis │ │ │ │ └── markdowns │ │ │ │ │ ├── rct_analysis4.md │ │ │ │ │ ├── rct_analysis2.md │ │ │ │ │ ├── rct_analysis10.md │ │ │ │ │ ├── rct_analysis15.md │ │ │ │ │ ├── rct_analysis3.md │ │ │ │ │ ├── rct_analysis8.md │ │ │ │ │ ├── rct_analysis12.md │ │ │ │ │ ├── rct_analysis14.md │ │ │ │ │ ├── rct_analysis6.md │ │ │ │ │ ├── rct_analysis5.md │ │ │ │ │ ├── rct_analysis9.md │ │ │ │ │ ├── rct_analysis13.md │ │ │ │ │ ├── rct_analysis7.md │ │ │ │ │ └── rct_analysis11.md │ │ │ ├── variable_selection │ │ │ │ └── markdowns │ │ │ │ │ └── intro.md │ │ │ └── balance │ │ │ │ └── markdowns │ │ │ │ └── balance1.md │ │ │ ├── css │ │ │ ├── reactable.css │ │ │ ├── home.css │ │ │ ├── analysis-select-input.css │ │ │ ├── analysis-verify.css │ │ │ ├── analysis-subgroup.css │ │ │ ├── info-icon.css │ │ │ ├── analysis-upload.css │ │ │ ├── sortable.css │ │ │ ├── scrollytell.css │ │ │ └── slider.css │ │ │ ├── favicon.ico │ │ │ ├── img │ │ │ ├── error.png │ │ │ ├── shrug.png │ │ │ ├── tree.gif │ │ │ ├── placeholder.png │ │ │ ├── example_trace.png │ │ │ ├── thumbnails │ │ │ │ ├── PA.png │ │ │ │ ├── PO.png │ │ │ │ ├── balance.png │ │ │ │ ├── estimands.png │ │ │ │ ├── propensity.png │ │ │ │ ├── regression.png │ │ │ │ ├── assumptions.png │ │ │ │ ├── decision_tree.png │ │ │ │ ├── estimands-cloud.png │ │ │ │ ├── observational.png │ │ │ │ ├── post-treatment.png │ │ │ │ ├── practice_test.png │ │ │ │ ├── randomization.png │ │ │ │ ├── fundamental_problem.png │ │ │ │ ├── potential-outcomes.png │ │ │ │ └── regression_discontinuity.png │ │ │ ├── example_balance.png │ │ │ ├── thinkCausal_logo.png │ │ │ ├── tree_pixelated.gif │ │ │ ├── thinkCausal_logo_wide.png │ │ │ ├── example_common_support.png │ │ │ └── post-treatment-timeline.png │ │ │ └── md │ │ │ └── about.md │ ├── WORDLIST │ ├── reproduce │ │ ├── .Rprofile │ │ ├── renv │ │ │ ├── .gitignore │ │ │ └── settings.dcf │ │ ├── inputs │ │ │ └── README.txt │ │ ├── thinkCausal-reproduce.Rproj │ │ └── README.txt │ ├── extdata │ │ ├── obs_plots.rds │ │ ├── balance_dat.rds │ │ ├── post_treatment_timeline.csv │ │ ├── fundamental_table1.csv │ │ ├── truth.csv │ │ ├── fundamental_table2.csv │ │ ├── fundemental_table3.csv │ │ └── fundemental_table4.csv │ └── golem-config.yml ├── LICENSE ├── renv │ ├── .gitignore │ └── settings.json ├── R │ ├── _disable_autoload.R │ ├── mod_learn_versionC.R │ ├── mod_help.R │ ├── run_app.R │ ├── mod_settings_reference.R │ └── mod_settings_about.R ├── .Rprofile ├── .Rbuildignore ├── app.R ├── rsconnect │ └── shinyapps.io │ │ └── apsta │ │ ├── thinkCausal.dcf │ │ └── thinkCausal-dev.dcf ├── thinkCausal.Rproj ├── NAMESPACE └── dev │ └── run_dev.R ├── student_work ├── Tong │ ├── ui.R │ ├── tests │ │ ├── testthat.R │ │ └── testthat │ │ │ └── test_dgp_function.R │ ├── server.R │ ├── R │ │ ├── plot_effects.R │ │ └── create_summary_table.R │ └── global.R ├── Junhui │ ├── UI │ │ ├── headers │ │ │ ├── help_header.R │ │ │ ├── settings_header.R │ │ │ ├── reproducibility_header.R │ │ │ ├── analysis_header.R │ │ │ └── concepts_header.R │ │ └── pages │ │ │ ├── script_page.R │ │ │ └── log_page.R │ ├── tests │ │ ├── testthat.R │ │ └── testthat │ │ │ ├── test_convert_functions.R │ │ │ └── test_create_functions.R │ ├── www │ │ ├── img │ │ │ ├── tree.gif │ │ │ └── placeholder.png │ │ └── thumbnails │ │ │ ├── PA.png │ │ │ ├── PO.png │ │ │ ├── balance.png │ │ │ ├── propensity.png │ │ │ ├── regression.png │ │ │ ├── assumptions.png │ │ │ ├── practice_test.png │ │ │ ├── randomization.png │ │ │ ├── fundamental_problem.png │ │ │ └── regression_discontinuity.png │ ├── DESCRIPTION │ ├── man │ │ ├── plot_DAG.Rd │ │ ├── create_progress_bar.Rd │ │ ├── clean_detect_column_types.Rd │ │ ├── plot_variable_importance.Rd │ │ ├── convert_data_type_to_complex.Rd │ │ ├── clean_auto_convert_logicals.Rd │ │ ├── clean_names.Rd │ │ ├── convert_data_type_to_simple.Rd │ │ ├── create_datatable.Rd │ │ └── create_script.Rd │ ├── R │ │ ├── ggplot_settings.R │ │ ├── make_data_demo.R │ │ ├── plot_single_tree.R │ │ └── create_progress_bar.R │ └── NAMESPACE └── regression_trees_explainer │ └── www │ ├── diagram.png │ └── diagram_parameters.png ├── screenshot.png ├── _site ├── d3 │ ├── fundamental │ │ └── js │ │ │ ├── init.js │ │ │ └── namespace.js │ ├── overlap │ │ ├── js │ │ │ ├── namespace.js │ │ │ └── init.js │ │ └── data │ │ │ └── generate-data.R │ ├── scrollytell │ │ ├── js │ │ │ ├── namespace.js │ │ │ └── init.js │ │ └── data │ │ │ ├── line-data.csv │ │ │ └── point-data.csv │ ├── namespace │ │ ├── js │ │ │ ├── namespace.js │ │ │ ├── testFunctions.js │ │ │ └── showData.js │ │ └── index.html │ ├── bart │ │ ├── data │ │ │ └── draggable_points.csv │ │ └── js │ │ │ └── namespace.js │ ├── rct_draft │ │ ├── data │ │ │ └── draggable_points.csv │ │ └── js │ │ │ └── namespace.js │ ├── animations │ │ └── js │ │ │ └── showData.js │ └── pairing │ │ ├── js │ │ └── showData.js │ │ ├── data │ │ ├── line-data.csv │ │ └── point-data.csv │ │ └── index.html └── README.md ├── scratch ├── draft_d3 │ └── d3 │ │ └── bart │ │ ├── data │ │ └── draggable_points.csv │ │ └── js │ │ └── namespace.js └── draft_rct │ └── d3 │ └── bart │ └── js │ └── namespace.js ├── .github └── workflows │ ├── render-test-website.yaml │ ├── test-functions.yml │ ├── deploy-shinyapps-dev.yml │ └── deploy-shinyapps.yml └── .gitignore /thinkCausal/tests/testthat/test-fct_create.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /thinkCausal/tests/testthat/test-fct_detect.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /thinkCausal/.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | inst/doc 3 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/ignorability/img/.here: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /thinkCausal/inst/WORDLIST: -------------------------------------------------------------------------------- 1 | bartCause 2 | golem 3 | scaffolded 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/reproduce/.Rprofile: -------------------------------------------------------------------------------- 1 | source("renv/activate.R") 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/learn-post-treatment.css: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /thinkCausal/LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2022 2 | COPYRIGHT HOLDER: thinkCausal developers 3 | -------------------------------------------------------------------------------- /student_work/Tong/ui.R: -------------------------------------------------------------------------------- 1 | 2 | ui <- fluidPage( 3 | IgnorabilityUI("AllConfounders") 4 | ) -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/screenshot.png -------------------------------------------------------------------------------- /student_work/Junhui/UI/headers/help_header.R: -------------------------------------------------------------------------------- 1 | help_header <- navbarMenu(title = 'Help') 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands/section3.md: -------------------------------------------------------------------------------- 1 | This is a bunch of testing text. 2 | -------------------------------------------------------------------------------- /student_work/Tong/tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(Tong.v1) 3 | 4 | test_check("Tong.v1") 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/equations/equation1.md: -------------------------------------------------------------------------------- 1 | $$\frac{(283 + 278 + 280 + 284)}{4} = 281$$ 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/reproduce/renv/.gitignore: -------------------------------------------------------------------------------- 1 | library/ 2 | local/ 3 | cellar/ 4 | lock/ 5 | python/ 6 | staging/ 7 | -------------------------------------------------------------------------------- /thinkCausal/renv/.gitignore: -------------------------------------------------------------------------------- 1 | library/ 2 | local/ 3 | cellar/ 4 | lock/ 5 | python/ 6 | sandbox/ 7 | staging/ 8 | -------------------------------------------------------------------------------- /student_work/Junhui/tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(thinkCausal) 3 | 4 | test_check("thinkCausal") 5 | -------------------------------------------------------------------------------- /student_work/Tong/server.R: -------------------------------------------------------------------------------- 1 | 2 | server <- function(input, output){ 3 | callModule(Ignorability, "AllConfounders") 4 | } -------------------------------------------------------------------------------- /thinkCausal/R/_disable_autoload.R: -------------------------------------------------------------------------------- 1 | # Disabling shiny autoload 2 | 3 | # See ?shiny::loadSupport for more information 4 | -------------------------------------------------------------------------------- /thinkCausal/tests/testthat/test-fct_reproduce.R: -------------------------------------------------------------------------------- 1 | test_that("multiplication works", { 2 | expect_equal(2 * 2, 4) 3 | }) 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/css/reactable.css: -------------------------------------------------------------------------------- 1 | .rt-page-button-current { 2 | background: #ae4ec2; 3 | color: #fff; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /thinkCausal/tests/testthat/test-fct_learn_estimands.R: -------------------------------------------------------------------------------- 1 | test_that("multiplication works", { 2 | expect_equal(2 * 2, 4) 3 | }) 4 | -------------------------------------------------------------------------------- /student_work/Junhui/www/img/tree.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/img/tree.gif -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/favicon.ico -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/error.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/shrug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/shrug.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/tree.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/tree.gif -------------------------------------------------------------------------------- /thinkCausal/inst/extdata/obs_plots.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/extdata/obs_plots.rds -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/PA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/PA.png -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/PO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/PO.png -------------------------------------------------------------------------------- /thinkCausal/inst/extdata/balance_dat.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/extdata/balance_dat.rds -------------------------------------------------------------------------------- /student_work/Junhui/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: thinkCausal 2 | Version: 0.1.0 3 | RoxygenNote: 7.1.1 4 | Encoding: UTF-8 5 | Suggests: 6 | testthat 7 | -------------------------------------------------------------------------------- /student_work/Junhui/www/img/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/img/placeholder.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/placeholder.png -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/balance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/balance.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/example_trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/example_trace.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/PA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/PA.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/PO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/PO.png -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/propensity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/propensity.png -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/regression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/regression.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/example_balance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/example_balance.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thinkCausal_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thinkCausal_logo.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/tree_pixelated.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/tree_pixelated.gif -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section11.md: -------------------------------------------------------------------------------- 1 | Now we've filled in all the missing potential outcomes for runners with 0 prior races! 2 | 3 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section7.md: -------------------------------------------------------------------------------- 1 | We can plug the average into each missing `Y0` value for runners' with 0 prior races. 2 | 3 | -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/assumptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/assumptions.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/balance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/balance.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section10.md: -------------------------------------------------------------------------------- 1 | Now we can plug the average into each missing `Y1` value for runners' with 0 prior races. 2 | 3 | -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/practice_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/practice_test.png -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/randomization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/randomization.png -------------------------------------------------------------------------------- /thinkCausal/.Rprofile: -------------------------------------------------------------------------------- 1 | source("renv/activate.R") 2 | options(shiny.launch.browser = TRUE) 3 | options(repos = c(RSPM = "https://packagemanager.rstudio.com/cran/latest")) 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thinkCausal_logo_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thinkCausal_logo_wide.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/estimands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/estimands.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/propensity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/propensity.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/regression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/regression.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/ihdp_obs.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/ihdp_obs.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section29.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | How can we combine these into a single average treatment effect? 4 |
5 |
6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p2.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p2.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p3.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p4.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p4.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p5.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p5.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p6.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p6.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p7.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p7.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p8.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p9.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p9.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p2.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p3.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p4.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p5.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p6.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p7.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p8.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p9.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/ignorability/img/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/ignorability/img/p1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/ignorability/img/p2.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/ignorability/img/p2.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/post-treatment/p1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/post-treatment/p2.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/p3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/post-treatment/p3.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/p4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/post-treatment/p4.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/p5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/post-treatment/p5.png -------------------------------------------------------------------------------- /student_work/regression_trees_explainer/www/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/regression_trees_explainer/www/diagram.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/example_common_support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/example_common_support.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/post-treatment-timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/post-treatment-timeline.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/assumptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/assumptions.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/colinearity/plots/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/colinearity/plots/p1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p10.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p11.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p12.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p13.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p14.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p15.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p16.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p17.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p17.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p18.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p19.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p19.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p20.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p20.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p21.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p21.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p22.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p22.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p23.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p23.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p24.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p24.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p25.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p25.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p26.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p26.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p27.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p27.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p28.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p28.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p29.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p29.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p30.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p31.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p31.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p32.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p33.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p34.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p35.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p36.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p37.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p37.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p37.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p38.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p38.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p39.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p39.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p39.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p40.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p40.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p41.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p41.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p41.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p42.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p42.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p43.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p43.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p43.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p44.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p44.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p45.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p45.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p46.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p46.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p46.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p47.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p47.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p47.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p48.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p48.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p49.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p49.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/plots/p50.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/confounder/plots/p50.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p10.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p11.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p12.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p13.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p14.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p15.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p16.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p17.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p18.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p19.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p20.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p21.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p22.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p23.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p24.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p25.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p26.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/cf1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/cf1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/cf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/cf2.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p2.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p3.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p4.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p5.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p6.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p6.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p6.rds -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p7.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p7.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p7.rds -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/fundamental_problem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/fundamental_problem.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/decision_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/decision_tree.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/estimands-cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/estimands-cloud.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/observational.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/observational.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/post-treatment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/post-treatment.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/practice_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/practice_test.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/randomization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/randomization.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section33.md: -------------------------------------------------------------------------------- 1 | In our data, the majority of the 300 runners that wore hyperShoes are from the United States. 2 |
3 |
4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/p16.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/p16.2.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/quiz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/quiz1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/quiz2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/quiz2.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/quiz3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/quiz3.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section9.md: -------------------------------------------------------------------------------- 1 | The average of the 3 observed `Y1` values is 270. 2 |
3 |
4 | $$\frac{(266 + 272 + 273)}{3} = 270$$ 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/p_pre4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/p_pre4.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/ignorability/markdowns/section1.md: -------------------------------------------------------------------------------- 1 | Runners in the treatment group ran the race with hyperShoes and finished with an average time of 252.26 minutes. 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/markdowns/potential_outcomes_related.md: -------------------------------------------------------------------------------- 1 | ### Related modules 2 | 3 | - Learn more about bias 4 | - Learn more about simulation 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/factual1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/factual1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/plots/factual2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/fundemental/plots/factual2.png -------------------------------------------------------------------------------- /student_work/Junhui/UI/headers/settings_header.R: -------------------------------------------------------------------------------- 1 | settings_header <- tabPanel( 2 | title = 'Settings', 3 | navlistPanel( 4 | widths = c(2, 10), 5 | options_page 6 | ) 7 | ) 8 | -------------------------------------------------------------------------------- /student_work/Junhui/www/thumbnails/regression_discontinuity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/Junhui/www/thumbnails/regression_discontinuity.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/fundamental_problem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/fundamental_problem.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/potential-outcomes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/potential-outcomes.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section34.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | But most of the 726 runners who did not wear hyperShoes are not from the United States. 4 |
5 |
6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/no_overlap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/no_overlap.png -------------------------------------------------------------------------------- /student_work/regression_trees_explainer/www/diagram_parameters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/student_work/regression_trees_explainer/www/diagram_parameters.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p1.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p2.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p3.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p4.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p5.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p6.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p7.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p8.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p9.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/img/thumbnails/regression_discontinuity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/img/thumbnails/regression_discontinuity.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/plots/partial_overlap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/estimands2/plots/partial_overlap.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section19.md: -------------------------------------------------------------------------------- 1 | ### title here 2 | 3 | How close is our *estimated* average treatment effect and our *estimated* ITEs to the the true values? 4 | 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p10.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p11.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p12.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p13.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p14.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p15.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/plots/p16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/observational-analysis/plots/p16.png -------------------------------------------------------------------------------- /thinkCausal/inst/golem-config.yml: -------------------------------------------------------------------------------- 1 | default: 2 | golem_name: thinkCausal 3 | golem_version: 0.5.0 4 | app_prod: no 5 | production: 6 | app_prod: yes 7 | dev: 8 | golem_wd: !expr here::here() 9 | -------------------------------------------------------------------------------- /thinkCausal/tests/spelling.R: -------------------------------------------------------------------------------- 1 | if(requireNamespace('spelling', quietly = TRUE)) 2 | spelling::spell_check_test(vignettes = TRUE, error = FALSE, 3 | skip_on_cran = TRUE) 4 | -------------------------------------------------------------------------------- /_site/d3/fundamental/js/init.js: -------------------------------------------------------------------------------- 1 | 2 | fundamental.init = function(){ 3 | fundamental.showData(); 4 | fundamental.scrollytellState1(); 5 | fundamental.buildSupportPlots(); 6 | } 7 | fundamental.init() 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section12.md: -------------------------------------------------------------------------------- 1 | We can fill in all the remaining missing counter factual outcomes by repeating this process for runners with 1, 2 and 3 prior races. 2 | 3 | -------------------------------------------------------------------------------- /thinkCausal/inst/reproduce/inputs/README.txt: -------------------------------------------------------------------------------- 1 | Data 2 | 3 | Save your original data file witin this folder. This should be the same file you uploaded to the "Upload data" page within the thinkCausal application. 4 | -------------------------------------------------------------------------------- /student_work/Junhui/UI/headers/reproducibility_header.R: -------------------------------------------------------------------------------- 1 | reproducibility_header <- tabPanel( 2 | title = 'Reproduce', 3 | navlistPanel( 4 | widths = c(2, 10), 5 | log_page, 6 | script_page 7 | ) 8 | ) 9 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/PO_control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/PO_control.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/PO_treated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/PO_treated.png -------------------------------------------------------------------------------- /student_work/Junhui/UI/headers/analysis_header.R: -------------------------------------------------------------------------------- 1 | analysis_header <- navbarMenu( 2 | title = 'Analysis', 3 | data_page, 4 | eda_page, 5 | model_page, 6 | diagnostics_page, 7 | results_page, 8 | moderator_page 9 | ) -------------------------------------------------------------------------------- /thinkCausal/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^renv$ 2 | ^renv\.lock$ 3 | ^.*\.Rproj$ 4 | ^\.Rproj\.user$ 5 | ^data-raw$ 6 | dev_history.R 7 | ^dev$ 8 | $run_dev.* 9 | ^LICENSE\.md$ 10 | ^README\.Rmd$ 11 | ^app\.R$ 12 | ^rsconnect$ 13 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/hist_control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/hist_control.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/hist_treated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/hist_treated.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section24.md: -------------------------------------------------------------------------------- 1 | Now that we have filled in all of the missing counter-factual outcomes we can estimate the average treatment effect for each group of runners. 2 |
3 |
4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/eight_runners_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/eight_runners_2.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section11.md: -------------------------------------------------------------------------------- 1 | ### Infinite Possible Counterfactuals 2 | 3 | We could imagine an infinite number of possible counterfactuals. 4 | 5 | Let's consider some of the possibilities! 6 | 7 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/eight_runners_1_hyper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/eight_runners_1_hyper.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section3.md: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | The 724 runners in the control group ran the marathon without hyperShoes and finished with an average time of 216.64 minutes. 6 |
7 |
8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/eight_runners_1_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/eight_runners_1_normal.png -------------------------------------------------------------------------------- /_site/d3/overlap/js/namespace.js: -------------------------------------------------------------------------------- 1 | // helps manage namespace collisions across learning modules 2 | // all js objects/functions should be stored within this object 3 | // e.g. overlap.myFunction = function(x){...} 4 | var overlap = overlap || {}; 5 | 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/css/home.css: -------------------------------------------------------------------------------- 1 | .home-grid img { 2 | margin: 0em 0 1em 0; 3 | object-fit: cover; 4 | height: 200px; 5 | transition: transform 0.07s; 6 | } 7 | 8 | .home-grid img:hover { 9 | transform: scale(1.03); 10 | } 11 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section36.md: -------------------------------------------------------------------------------- 1 | To condition on both `professional status` and `USA` we will compare runners with and without hyperShoes who have the same value of `professional status` and `USA`. 2 |
3 |
4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section48.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | The company's initial analysis violated the ignorability assumption because we know there are two confounding variables that were not adjusted for. 4 |
5 |
6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/markdowns/post_treatment_learn_more.md: -------------------------------------------------------------------------------- 1 | ## Related modules 2 | 3 | 4 | Learn more about potential outcomes 5 | 6 | -------------------------------------------------------------------------------- /_site/d3/scrollytell/js/namespace.js: -------------------------------------------------------------------------------- 1 | // helps manage namespace collisions across learning modules 2 | // all js objects/functions should be stored within this object 3 | // e.g. estimands.myFunction = function(x){...} 4 | var estimands = estimands || {}; 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section2.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | We know the average time for runners with hyperShoes is 174.47 minutes, but *we don't know what their average time would have been without hyperShoes*. 4 |
5 |
6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section44.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | After filling in the missing averages, we will take the difference to estimate an effect of -14.06 for non-professional runners not from the United States. 4 |
5 |
6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section19.md: -------------------------------------------------------------------------------- 1 | The remainder of runners in our sample did not wear hyerShoes. To estimate the ATE, we also need to know what would have happened to these runners if they had worn hyperShoes. 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section14.md: -------------------------------------------------------------------------------- 1 | ### Practice: 2 | #### Runners with 2 prior races 3 | 4 | Using the strategy we used for runners with 1 and 2 prior races to fill in counter factual outcomes for runners with 3 prior races. 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/Factual_conterfactual_control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/Factual_conterfactual_control.png -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/Factual_conterfactual_treated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/priism-center/thinkCausal_dev/HEAD/thinkCausal/inst/app/www/learn/potential-outcomes/illustrations/Factual_conterfactual_treated.png -------------------------------------------------------------------------------- /_site/d3/fundamental/js/namespace.js: -------------------------------------------------------------------------------- 1 | // helps manage namespace collisions across learning modules 2 | // all js objects/functions should be stored within this object 3 | // e.g. fundamental.myFunction = function(x){...} 4 | var fundamental = fundamental || {}; 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section13.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | Looking at all the runners together, it is clear that the treatment group and the control group are very different in terms of the variable `professional status`! 4 |
5 |
6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational_learn_more.md: -------------------------------------------------------------------------------- 1 | ### Related modules 2 | 3 | - Learn more about potential outcomes 4 | - Learn more about causal estimands 5 | - Learn more about analyzing data from randomized studies 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section21.md: -------------------------------------------------------------------------------- 1 | For the professional runners that wore hyperShoes, we use the average time of the professional runners who did not wear hyperShoes, to represent what would have happened if they had not worn hyperShoes. 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section1.md: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 | The 300 runners in the treatment group ran the race with hyperShoes and finished with an average time of 174.47 minutes. 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands/js/1-namespace.js: -------------------------------------------------------------------------------- 1 | // helps manage namespace collisions across learning modules 2 | // all js objects/functions should be stored within this object 3 | // e.g. estimands.myFunction = function(x){...} 4 | var estimands = estimands || {}; 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section4.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | For runners in the control group, we know what the average finishing time was without hyperShoes, but *we don't know what the average finishing time would have been with hyperShoes*. 4 |
5 |
6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section12.md: -------------------------------------------------------------------------------- 1 | We could easily imagine that the effect of HyperShoes is the same for slower runners as it is for fast runners! 2 | 3 | Perhaps the mechanism behind HyperShoes would work the same regardless of runners' skills! 4 | 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/ignorability/markdowns/section2.md: -------------------------------------------------------------------------------- 1 | We know the average finishing time for runners' with hyperShoes is 252.26 minutes, but *we don't know what the runners' with hyerShoes average finishing time would have been had these runners' not worn hyperShoes*. 2 | -------------------------------------------------------------------------------- /_site/d3/namespace/js/namespace.js: -------------------------------------------------------------------------------- 1 | // helps manage namespace collisions across learning modules 2 | // all js objects/functions should be stored within this object 3 | // e.g. stimands.myVar = 10; 4 | // e.g. estimands.myFunction = function(x){...} 5 | var estimands = estimands || {}; 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section22.md: -------------------------------------------------------------------------------- 1 | Non-professional runners who did not wear hyperShoes had an average time of 226.98, we will use this time to represent what would have happened to non-professional runners who wore hyperShoes if they had not worn hyperShoes. 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section23.md: -------------------------------------------------------------------------------- 1 | And we will use the observed average time of non-professional runners who wore hyperShoes (229.73) to represent what would have happened to non-professional runners that did not wear hyperShoes if they had worn hyperShoes. 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section40.md: -------------------------------------------------------------------------------- 1 | Filling in missing counterfactuals with the average observed value of runners with equal values for `USA` and `professional status` gives an estimated effect of -5.97 for non-professional runners from the United States. 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section18.md: -------------------------------------------------------------------------------- 1 | A subset of all the runners in our sample wore HyerShoes. For these runners we need to know what would have happened if they had not worn hyperShoes. 2 | 3 | But these are not all of the runners in our sample! 4 | 5 | 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section42.md: -------------------------------------------------------------------------------- 1 | For professional runners not from the United States, the estimated effect of hyperShoes is -4.57. 2 |
3 |
4 | Remember, we are only comparing runners with equal values of our two confounding variables! 5 |
6 |
7 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section14.md: -------------------------------------------------------------------------------- 1 | The variable `professional status`, is also highly predictive of the outcome `finishing time in minutes`. 2 |
3 |
4 | Unsurprisingly, professorial runners are much faster than amateur runners. 5 |
6 |
7 |
8 |
9 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section6.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | The difference in mean estimator uses the average running time of the control group to represent what would have happened to runners' in the treatment group had they ran the race without hyperShoes. 4 |
5 |
6 | 7 | -------------------------------------------------------------------------------- /_site/d3/scrollytell/data/line-data.csv: -------------------------------------------------------------------------------- 1 | pair_id,treatment,xName_y0,xName_y1,yName_y0,yName_y1 2 | 1,0,0,1,155,153 3 | 2,1,0,1,142,136 4 | 3,0,0,1,153,155 5 | 4,1,0,1,147,139 6 | 5,0,0,1,154,154 7 | 6,1,0,1,145,135 8 | 7,0,0,1,151,152 9 | 8,1,0,1,148,138 10 | 9,0,0,1,149,148 11 | 10,1,0,1,143,137 12 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section7.md: -------------------------------------------------------------------------------- 1 | ### What about the ATC? 2 | 3 | What if we are not interested in the ATT and wanted to estimate the average treatment effect of the controls (ATC)? 4 | 5 | We'll return to the original marathon running data and explore estimating the ATC. 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/reproduce/thinkCausal-reproduce.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: No 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section25.md: -------------------------------------------------------------------------------- 1 | For professional runners in the treatment group (wore hyperShoes), the estimated average treatment effect is the difference between what happened with hyperShoe and what would have happened without hyperShoes: 2 | 3 | $$163.41 - 160.13 = 3.28$$ 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section26.md: -------------------------------------------------------------------------------- 1 | For professional runners in the control group (did not wear hyperShoes), the estimated average treatment effect is the difference between what would have happened with hyperShoes and what happened without hyperShoes: 2 | 3 | $$163.41 - 160.13 = 3.28$$ 4 | 5 | -------------------------------------------------------------------------------- /student_work/Junhui/UI/pages/script_page.R: -------------------------------------------------------------------------------- 1 | script_page <- tabPanel( 2 | title = "Script", 3 | style = "padding-left: 3rem;", 4 | br(), 5 | downloadButton( 6 | outputId = 'analysis_results_button_download', 7 | label = 'Download script', 8 | style = 'max-width: 300px' 9 | ), 10 | br(), br() 11 | ) -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands/data/line-data.csv: -------------------------------------------------------------------------------- 1 | pair_id,treatment,xName_y0,xName_y1,yName_y0,yName_y1 2 | 1,0,0,1,155,153 3 | 2,1,0,1,142,136 4 | 3,0,0,1,153,155 5 | 4,1,0,1,147,139 6 | 5,0,0,1,154,154 7 | 6,1,0,1,145,135 8 | 7,0,0,1,151,152 9 | 8,1,0,1,148,138 10 | 9,0,0,1,149,148 11 | 10,1,0,1,143,137 12 | -------------------------------------------------------------------------------- /thinkCausal/inst/reproduce/renv/settings.dcf: -------------------------------------------------------------------------------- 1 | bioconductor.version: 2 | external.libraries: 3 | ignored.packages: 4 | package.dependency.fields: Imports, Depends, LinkingTo 5 | r.version: 6 | snapshot.type: implicit 7 | use.cache: TRUE 8 | vcs.ignore.cellar: TRUE 9 | vcs.ignore.library: TRUE 10 | vcs.ignore.local: TRUE 11 | -------------------------------------------------------------------------------- /_site/d3/namespace/js/testFunctions.js: -------------------------------------------------------------------------------- 1 | 2 | estimands.abs = function(x){ 3 | return Math.abs(x) 4 | } 5 | 6 | estimands.mult = function(x){ 7 | return Math.abs(x * 10) 8 | } 9 | 10 | estimands.myVar = 90; 11 | 12 | m = function(){ 13 | estimands.myVar = estimands.myVar * 2; 14 | console.log(estimands.myVar) 15 | } 16 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section7.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | For the other missing counter-factuals, the difference in means estimator uses the average running time of the treatment group to represent what would have happened to runners' in the control group had they ran the race with hyperShoes. 4 |
5 |
6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/css/analysis-select-input.css: -------------------------------------------------------------------------------- 1 | .form-control-feedback { 2 | position: absolute; 3 | top: 0; 4 | right: 0; 5 | z-index: 2; 6 | display: block; 7 | width: 34px; 8 | height: 34px; 9 | line-height: 34px; 10 | text-align: center; 11 | pointer-events: none; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /thinkCausal/app.R: -------------------------------------------------------------------------------- 1 | # Launch the ShinyApp (Do not remove this comment) 2 | # To deploy, run: rsconnect::deployApp() 3 | # Or use the blue button on top of this file 4 | 5 | pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE) 6 | options( "golem.app.prod" = TRUE) 7 | thinkCausal::run_app() # add parameters here (if any) 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section31.md: -------------------------------------------------------------------------------- 1 | To estimate the ATE for our whole sample of runners, all we need to do is take a weighted average of the ATE for each each of the four groups. 2 |
3 |
4 | The weighted average accounts for the fact that there are different number of runners in each group. 5 |
6 |
7 | -------------------------------------------------------------------------------- /thinkCausal/rsconnect/shinyapps.io/apsta/thinkCausal.dcf: -------------------------------------------------------------------------------- 1 | name: thinkCausal 2 | title: 3 | username: 4 | account: apsta 5 | server: shinyapps.io 6 | hostUrl: https://api.shinyapps.io/v1 7 | appId: 5224902 8 | bundleId: 6135974 9 | url: https://apsta.shinyapps.io/thinkCausal/ 10 | when: 1658867695.1842 11 | lastSyncTime: 1658867695.18422 12 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section27.md: -------------------------------------------------------------------------------- 1 | For non-professional runners in the treatment group (wore hyperShoes), the estimated average treatment effect is the difference between what happened to these runners with hyperShoes and what would have happened to these runners without hyperShoes: 2 | 3 | $$229.73 - 226.98 = 2.75$$ 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section52.md: -------------------------------------------------------------------------------- 1 | ### Other Assumptions 2 | The ignorability assumption is not the only assumption we are make for observational studies. Remember that we also make assumptions of SUTVA (the stable unit treatment value assignment) and overlap. Check out the related learning modules for more information! 3 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/learn-potential-outcomes.css: -------------------------------------------------------------------------------- 1 | 2 | .learning_potential_outcomes-learning-content h2 { 3 | padding-top: 1.5em; 4 | } 5 | .learning_potential_outcomes-learning-content h3 { 6 | padding-top: 1.0em; 7 | } 8 | .learning_potential_outcomes-learning-content div h3 { 9 | padding-top: 0em; 10 | } 11 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section12.md: -------------------------------------------------------------------------------- 1 | Non-professional runners (amateurs), are less likely to wear hyperShoes. This could be because they are less invested in running and do not get hyperShoes for free. 2 |
3 |
4 | Of the 724 runners that did not wear hypeShoes, 612 were non-professional runners. 5 |
6 |
7 | 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section10.md: -------------------------------------------------------------------------------- 1 | For the majority of the control group, there are no similar runners that wore HyperShoes!! This is a big problem for us. 2 | 3 | Without any similar runners we have nothing to gauge what would have happened to runners with slower `qualifying times` if they had worn HyperShoes. 4 | 5 | 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section4.md: -------------------------------------------------------------------------------- 1 | In the marathon data, some runners did not wear HyperShoes but look very similar to the runners that did in terms of `qualifying time`! 2 | 3 | We can use information from these runners as a proxy for what would have happened to runners in the treated group if they did not have HyperShoes! 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section15.md: -------------------------------------------------------------------------------- 1 | ### Practice: 2 | #### Runners with 3 prior races 3 | 4 | We'll keep practicing by filling in the counter factual outcomes for runners with 3 prior races.
5 |
6 | Again we'll use the potential outcomes we can observe to predict the counter factual outcomes we can't observe. 7 | 8 | -------------------------------------------------------------------------------- /thinkCausal/rsconnect/shinyapps.io/apsta/thinkCausal-dev.dcf: -------------------------------------------------------------------------------- 1 | name: thinkCausal-dev 2 | title: 3 | username: 4 | account: apsta 5 | server: shinyapps.io 6 | hostUrl: https://api.shinyapps.io/v1 7 | appId: 9502603 8 | bundleId: 7492258 9 | url: https://apsta.shinyapps.io/thinkCausal-dev/ 10 | when: 1690233860.78099 11 | lastSyncTime: 1690233860.781 12 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section18.md: -------------------------------------------------------------------------------- 1 | Now we'll consider the running times of only non-professional runners. 2 |
3 |
4 | The 112 amateur runners who wore hyperShoes have an average time of 229.73 minutes. 5 |
6 |
7 | The 612 professional runners that did not wear hyperShoes have an average time of 226.98 minutes. 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands/markdowns/estimands_related.md: -------------------------------------------------------------------------------- 1 | ### Related modules 2 | You can learn more about bias is [here]() 3 | 4 | You can learn more about simulation is [here]() 5 | 6 | You can learn more about potential outcomes [here]() 7 | 8 | You can learn more about what makes a comparison fair or unfair [here]() 9 | 10 | 11 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/css/analysis-verify.css: -------------------------------------------------------------------------------- 1 | 2 | .bottom-shadow { 3 | position: sticky; 4 | bottom: 0; 5 | height: 20px; 6 | width: 100%; 7 | -moz-box-shadow: inset 0 -30px 10px -20px #fff; 8 | -webkit-box-shadow: inset 0 -30px 10px -20px #fff; 9 | box-shadow: inset 0 -30px 10px -20px #fff; 10 | opacity: 0.8; 11 | z-index: 1; 12 | } 13 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section5.md: -------------------------------------------------------------------------------- 1 |
2 |
3 |
The company used the difference in means estimatorAn estimator is a statistical model that estimates causal effects to fill in the missing counter-factual outcomes and estimate the ATE.
4 |
5 |
6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section17.md: -------------------------------------------------------------------------------- 1 | ### The ATE 2 | 3 | To estimate the ATE, we need counterfactuals for both the runners that wore HyperShoes and the runners that did not wear HyperShoes! 4 | 5 | For the ATE, our goal is estimating the difference between wearing HyperShoes and not wearing HyperShoes for every runner in our sample. 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section2.md: -------------------------------------------------------------------------------- 1 | ### The ATT 2 | 3 | For the ATT, our goal is to estimate whether wearing HyperShoes caused these runners (red points) to run faster than they would have ran had they not worn HyperShoes. 4 | 5 | The ATT is the average causal effect of HyperShoes for the runners that actually wore HyperShoes. 6 | 7 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis4.md: -------------------------------------------------------------------------------- 1 | We can extend this to all 200 runners in our study and calculate the individual causal effect for each of the 200 runners. Remember this requires that we have the running times for runner if they wore HyperShoes as well as the running times for each runner if they did not wear HyperShoes. 2 | -------------------------------------------------------------------------------- /_site/d3/bart/data/draggable_points.csv: -------------------------------------------------------------------------------- 1 | runningTime,caloriesConsumed 2 | 4704.467882243413,0 3 | 4625.100014285956,142.85714285714286 4 | 4568.000888094412,285.7142857142857 5 | 4516.432736941106,428.57142857142856 6 | 4501.509869523982,571.4285714285714 7 | 4563.508799782043,714.2857142857143 8 | 4608.862452851483,857.1428571428571 9 | 4702.308357796332,1000 10 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section16.md: -------------------------------------------------------------------------------- 1 | When we look at the running times of only professional runners we can see that the 250 professional runners who wore hyperShoes have an average finishing time of 163.41 minutes. 2 |
3 |
4 | The 50 professional runners that did not wear hyperShoes have an average finishing time of 160.13 minutes. 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/extdata/post_treatment_timeline.csv: -------------------------------------------------------------------------------- 1 | occured,measured,status,variable,.yend 2 | -2.5,7.5,pre-treatment,birth weight,0.1 3 | -2.3,7.3,pre-treatment,birth zip-code,-0.12 4 | -1,-1,pre-treatment,income,0.1 5 | -1.2,-1.2,pre-treatment,parent education,-0.1 6 | 5.5,5.5,post-treatment,1st grade reading level,0.1 7 | 8.2,8.2,outcome,2nd grade reading level,0.14 8 | -------------------------------------------------------------------------------- /student_work/Junhui/UI/pages/log_page.R: -------------------------------------------------------------------------------- 1 | log_page <- tabPanel( 2 | title = "Log", 3 | style = "padding-left: 3rem;", 4 | br(), 5 | downloadButton( 6 | outputId = 'settins_log_download', 7 | label = 'Download log', 8 | style = 'max-width: 300px' 9 | ), 10 | br(), br(), 11 | verbatimTextOutput( 12 | outputId = 'settings_log_text' 13 | ) 14 | ) -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section45.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | To estimate the Average Treatment Effect (ATE) for the whole sample, we can take a weighted average of each of the estimated treatment effects for each group of runners. 4 |
5 |
6 | The weights in our weighted average are the number of runners in each group (`n`). 7 |
8 |
9 | -------------------------------------------------------------------------------- /_site/d3/rct_draft/data/draggable_points.csv: -------------------------------------------------------------------------------- 1 | runningTime,caloriesConsumed 2 | 180.38444263352906,0 3 | 186.32745045333473,142.85714285714286 4 | 186.32745045333473,285.7142857142857 5 | 186.32745045333473,428.57142857142856 6 | 186.32745045333473,571.4285714285714 7 | 186.32745045333473,714.2857142857143 8 | 186.32745045333473,857.1428571428571 9 | 186.32745045333473,1000 10 | -------------------------------------------------------------------------------- /scratch/draft_d3/d3/bart/data/draggable_points.csv: -------------------------------------------------------------------------------- 1 | runningTime,caloriesConsumed 2 | 4704.467882243413,0 3 | 4625.100014285956,142.85714285714286 4 | 4568.000888094412,285.7142857142857 5 | 4516.432736941106,428.57142857142856 6 | 4501.509869523982,571.4285714285714 7 | 4563.508799782043,714.2857142857143 8 | 4608.862452851483,857.1428571428571 9 | 4702.308357796332,1000 10 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section23.md: -------------------------------------------------------------------------------- 1 | ### No Overlap 2 | 3 | Here is an example where there is no overlap for estimating the ATE, ATT or ATC! 4 | 5 | There are no control runners with low `qualifying times` and no treated runners with high `qualifying times`. 6 | 7 | How should we proceed when we have not overlap at all? 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /student_work/Tong/tests/testthat/test_dgp_function.R: -------------------------------------------------------------------------------- 1 | 2 | sampsize <- 1000 3 | tau <- 10 4 | data <- dgp(sampsize, tau) 5 | 6 | test_that("dgp() output is correct", { 7 | expect_s3_class(data, 'data.frame') 8 | expect_equal(length(data), 14) 9 | expect_lt( table(data$Z)["0"]/table(data$Z)["1"], 3/2) 10 | expect_gt( table(data$Z)["0"]/table(data$Z)["1"], 2/3) 11 | }) 12 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section28.md: -------------------------------------------------------------------------------- 1 | For our last group of runners non-professional runners in the control group (did not wear hyperShoes), the estimated average treatment effect is the difference between what would have happened to these runners with hyperShoes and what happened to these runners without hyperShoes: 2 | 3 | $$229.73 - 226.98 = 2.75$$ 4 | 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section43.md: -------------------------------------------------------------------------------- 1 | Our last combination of runners are non-professional runners who are not from the United States. 2 |
3 |
4 | There are 11 non-professional runners who are not from the United States that wore hyperShoes and 533 non-professional runners not from the Unites States that did not wear hyperShoes. 5 |
6 |
7 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands/markdowns/estimands_citations.md: -------------------------------------------------------------------------------- 1 | ### Citations and readings 2 | 3 | - Gelman, A., Hill, J. and Vehtari, A. (2020) Chapter 18 from *Regression and Other Stories*, Cambridge University Press 4 | - Rubin, D. B. (1974). Estimating causal effects of treatments in randomized and nonrandomized studies. *Journal of educational Psychology, 66(5), 688.* 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section16.md: -------------------------------------------------------------------------------- 1 | ### What about the ATE? 2 | 3 | We were able to estimate the ATT without any issues, but had problems estimating the ATC because of lack of complete overlap. We haven't considered the ATE yet. 4 | 5 | We'll return to our complete marathon running data and consider whether or not we can easily estimate the ATE. 6 | 7 | 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/reproduce/README.txt: -------------------------------------------------------------------------------- 1 | Reproducible script instructions 2 | 3 | -Unzip this folder and save all files to a new local folder 4 | -Save your dataset to the subfolder "/inputs" 5 | -Open the "thinkCausal.Rproj" file 6 | -Open thinkCausal_script.R 7 | -If asked to proceed, enter "y" 8 | -Execute each line individually or click "Run" in the top right of the Rstudio script editor 9 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section39.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | There are 39 non-professional runners who are from the United States that wore hyperShoes and these runners have an average time of 235.05. 4 |
5 |
6 | There are 79 professional runners from the Unites States that did not wear hyperShoes and these runners have an average time of 240.84. 7 |
8 |
9 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section5.md: -------------------------------------------------------------------------------- 1 | We'll ignore all the runners who do not resemble the treatment group. 2 | 3 | It may feel uncomfortable to disregard so much data, but remember the runners we are ignoring had much slower `qualifying times` than runners that wore HyperShoes and would not do a good job of representing a counterfactual for our treated group. 4 | 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational_citations.md: -------------------------------------------------------------------------------- 1 | ### Citations and readings 2 | 3 | - Gelman, A., Hill, J. and Vehtari, A. (2020) Chapter 20 from *Regression and Other Stories*, Cambridge University Press 4 | - Hill, J. L. (2011). Bayesian nonparametric modeling for causal inference. *Journal of Computational and Graphical Statistics, 20(1)*, 217-240. 12:05 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands/markdowns/estimands_2.md: -------------------------------------------------------------------------------- 1 | ## Checkpoint: Calculate the ATE 2 | 3 | Now a quiz to lorem ipsum. Including post-treatment variables can drastically impact the results of experiments. The data for this example was simulated so we know that, on average, the pest-control caused plants to grow 1.52 inches taller than they would have grown without the pest-control. 4 | 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/markdowns/potential_outcomes_citations.md: -------------------------------------------------------------------------------- 1 | ### Citations and readings 2 | 3 | - Gelman, A., Hill, J. and Vehtari, A. (2020) Chapter 18 from *Regression and Other Stories*, Cambridge University Press 4 | - Rubin, D. B. (1974). Estimating causal effects of treatments in randomized and nonrandomized studies. *Journal of educational Psychology, 66(5), 688.* 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis2.md: -------------------------------------------------------------------------------- 1 | #### Potential Outcomes 2 | Let's start with imagining the impossible situation where we have collected running times for each runner if they had worn HyperShoes and if they had worn standard shoes. 3 | 4 | Runners factual outcomes are represented as filled in points while unfilled circles represent runners counter-factual outcomes. -------------------------------------------------------------------------------- /_site/d3/bart/js/namespace.js: -------------------------------------------------------------------------------- 1 | // helps manage namespace collisions across learning modules 2 | // all js objects/functions should be stored within this object 3 | // e.g. bart.myFunction = function(x){...} 4 | var bart = bart || {}; 5 | bart.posterior = {}; 6 | bart.posterior1 = {}; // old plot to be removed 7 | bart.animation = {}; 8 | bart.animated = {}; 9 | bart.functional = {}; 10 | bart.overlap = {}; 11 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational-analysis5.md: -------------------------------------------------------------------------------- 1 | When we average the individual causal effects of all the runners in the treatment group, we can see that the true ATT from our sample is -4.9. This is the true ATT that we will be attempting to estimate. 2 | 3 | Now we will return to reality where we only have access to our observed data and need to estimate the ATT. 4 | 5 | -------------------------------------------------------------------------------- /_site/d3/rct_draft/js/namespace.js: -------------------------------------------------------------------------------- 1 | // helps manage namespace collisions across learning modules 2 | // all js objects/functions should be stored within this object 3 | // e.g. bart.myFunction = function(x){...} 4 | var bart = bart || {}; 5 | bart.posterior = {}; 6 | bart.posterior1 = {}; // old plot to be removed 7 | bart.animation = {}; 8 | bart.animated = {}; 9 | bart.functional = {}; 10 | bart.overlap = {}; 11 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section37.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | There are 217 professional runners who are from the United States that wore hyperShoes and these runners have an average time of 165.28. 4 |
5 |
6 | There are 23 professional runners from the Unites States that did not wear hyperShoes and these runners have an average time of 176.59. 7 |
8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /scratch/draft_d3/d3/bart/js/namespace.js: -------------------------------------------------------------------------------- 1 | // helps manage namespace collisions across learning modules 2 | // all js objects/functions should be stored within this object 3 | // e.g. bart.myFunction = function(x){...} 4 | var bart = bart || {}; 5 | bart.posterior = {}; 6 | bart.posterior1 = {}; // old plot to be removed 7 | bart.animation = {}; 8 | bart.animated = {}; 9 | bart.functional = {}; 10 | bart.overlap = {}; 11 | -------------------------------------------------------------------------------- /scratch/draft_rct/d3/bart/js/namespace.js: -------------------------------------------------------------------------------- 1 | // helps manage namespace collisions across learning modules 2 | // all js objects/functions should be stored within this object 3 | // e.g. bart.myFunction = function(x){...} 4 | var bart = bart || {}; 5 | bart.posterior = {}; 6 | bart.posterior1 = {}; // old plot to be removed 7 | bart.animation = {}; 8 | bart.animated = {}; 9 | bart.functional = {}; 10 | bart.overlap = {}; 11 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section30.md: -------------------------------------------------------------------------------- 1 | We have four different groups of runners and each group is a different size. 2 | 3 | There are: 4 | - 250 professional runners in the treatment group. 5 | - 112 professional runners in the control group 6 | - 50 amateur runners in the treatment group 7 | - 612 amateur runner in the control group 8 | 9 | We'll use `n` to represent the size of each group 10 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/markdowns/post_treatment_5.md: -------------------------------------------------------------------------------- 1 | When the farmer did not include the post-treatment variable `bugs`, the estimated average treatment effect of 1.51 with a 95% confidence interval between 1.21 and 1.82 is very close to the true average treatment effect 1.58. Using this analysis the farmer would correctly conclude that the new fertilizer caused an increase in the pounds of tomatoes! 2 | 3 | 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section47.md: -------------------------------------------------------------------------------- 1 | Computing the weighted average gives us an estimate ATE of -11.35! After adjusting for both `professional stautus` and `usa` we found that wearing hyperShoes causes a runner to run an average of 11.35 minutes *faster* than they would have ran without hyperShoes! Our conclusions about the hyperShoe are entirely different after we adjust for an additional confounding variable. 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section14.md: -------------------------------------------------------------------------------- 1 | It's just as likely that hyperShoes may only work for fast runners and actually cause slower runners to run even slower! 2 | 3 | It's possible that hyperShoes require high levels of fitness to use properly. For fast runners, who are very fit, this is not a problem but slower runners are less fit and cannot use the hyperShoe as intended causing them to run even slower. 4 | 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/css/analysis-subgroup.css: -------------------------------------------------------------------------------- 1 | 2 | #analysis_subgroup-analysis_subgroup_tabs .nav-link { 3 | margin: 0.5em; 4 | } 5 | 6 | #analysis_subgroup-analysis_subgroup_tabs .nav-link:hover { 7 | color: #787878; 8 | background: #f2f2f2; 9 | border-color: #f2f2f2; 10 | } 11 | 12 | #analysis_subgroup-analysis_subgroup_tabs .nav-link.active:hover { 13 | color: #fff !important; 14 | border-color: #ae4ec2; 15 | } 16 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section13.md: -------------------------------------------------------------------------------- 1 | We could just as easily imagine a situation where hyperShoes work even better for slower runners than they do for fast runners! 2 | 3 | Maybe the hyperShoe works by improving running technique and the fastest runners already have mastered their technique so they get a smaller benefit from hyperShoes compared to slower runners that have much more room for improvement. 4 | 5 | 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section19.md: -------------------------------------------------------------------------------- 1 | We know that non-professional runners that wore hyperShoes had an average time of 229.73 but we don't know what this groups average time would have been had they not worn hyperShoes. 2 |
3 |
4 | We know that non-professional runners that did not wear hyperShoes had an average time of 229.73 but we don't know what their average time would have been if they had worn hyperShoes. 5 | 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section35.md: -------------------------------------------------------------------------------- 1 | This variable is also related to running time. 2 |
3 |
4 | On average, runners from outside the United States to be faster than those from the United States. 5 |
6 |
7 | This means that `USA` is another confounding variable, because we did not account for `USA` in our last analysis our conclusion about the hyperShoe is likely incorrect! 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section3.md: -------------------------------------------------------------------------------- 1 | ### Potential Outcomes: ATT 2 | 3 | Thinking about the ATT in terms of potential outcomes, we can observe every runner’s `Y1` because all of these runners are in the treated group. However, we are missing every runner’s `Y0`! 4 | 5 | Our problem is that we need a way to consider what would have happened to this group of runners if they had not worn HyperShoes. 6 | 7 | How can we proceed? 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis10.md: -------------------------------------------------------------------------------- 1 | #### BART 2 | 3 | When the treatment is randomly assigned, fitting a BART model with all measured covariates will provide an unbiased estimate of the true ATE! When we use BART to analyze the data from our study the estimated ATE is -5.4. 4 | 5 | Like regression our BART model allows us to incorporate information about `age` but without assuming any linear relationships. 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section11.md: -------------------------------------------------------------------------------- 1 | Professional runners are more likely to wear hyperShoes than non-professional runners. hyperShoes are very expensive. A single pair cost $453, but many professional runners are given hyperShoes for free. 2 |
3 |
4 | It turns out that 250 of the 300 runners that wore HyperShoes are professional runners and only 50 of the 300 were non-professional (amateur) runners. 5 |
6 |
7 | -------------------------------------------------------------------------------- /thinkCausal/tests/testthat.R: -------------------------------------------------------------------------------- 1 | # This file is part of the standard setup for testthat. 2 | # It is recommended that you do not modify it. 3 | # 4 | # Where should you do additional test configuration? 5 | # Learn more about the roles of various files in: 6 | # * https://r-pkgs.org/tests.html 7 | # * https://testthat.r-lib.org/reference/test_package.html#special-files 8 | 9 | library(testthat) 10 | library(thinkCausal) 11 | 12 | test_check("thinkCausal") 13 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section20.md: -------------------------------------------------------------------------------- 1 |
When we conditioncondition on, adjust for, account for and control for can be used interchangeably. on `professional status`, we use the average time of professional runners who wore hyperShoes to represent what the average time would have been for professional runners that did not wear hyperShoes if they had worn hyperShoes.
2 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis15.md: -------------------------------------------------------------------------------- 1 | #### Comparing Efficiency 2 | 3 | When we compare the residuals across difference in means, regression and BART we see that the residual from the BART model are smaller compared to difference in means and regression. Smaller residuals means a model is providing a better fit to the data which reduces uncertainty in our estimated treatment effect and creates more efficient estimates. 4 | 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis3.md: -------------------------------------------------------------------------------- 1 | #### Individual Causal Effects (ICE) 2 | When we have access to all potential outcomes, we can calculate the individual causal effect for each runner. For more details about how individual causal effects are calculated you can refer to the potential outcomes learning module! 3 | 4 | We can zoom-in on 3 runners from our study and see they have individual causal effects of -6.2, -2.5 and -8.4. 5 | -------------------------------------------------------------------------------- /_site/d3/scrollytell/data/point-data.csv: -------------------------------------------------------------------------------- 1 | xName,yName,y,treatment,factual,pair_id 2 | 0,155,y0,0,1,1 3 | 0,142,y0,1,0,2 4 | 0,153,y0,0,1,3 5 | 0,147,y0,1,0,4 6 | 0,154,y0,0,1,5 7 | 0,145,y0,1,0,6 8 | 0,151,y0,0,1,7 9 | 0,148,y0,1,0,8 10 | 0,149,y0,0,1,9 11 | 0,143,y0,1,0,10 12 | 1,153,y1,0,0,1 13 | 1,136,y1,1,1,2 14 | 1,155,y1,0,0,3 15 | 1,139,y1,1,1,4 16 | 1,154,y1,0,0,5 17 | 1,135,y1,1,1,6 18 | 1,152,y1,0,0,7 19 | 1,138,y1,1,1,8 20 | 1,148,y1,0,0,9 21 | 1,137,y1,1,1,10 22 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section15.md: -------------------------------------------------------------------------------- 1 | ### We just dont know... 2 | 3 | Without any data-points to represent counterfactuals, the three possible stories we imagined are all equally plausible. 4 | 5 | **The lack of data-points to represent counterfactuals is called lack of complete overlap**. 6 | 7 | Because we lack overlap for large sections of the control group so we can't estimate the ATC in a reliable way. 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis8.md: -------------------------------------------------------------------------------- 1 | #### Difference in Means 2 | 3 | When the treatment is randomly assigned, taking the difference in the mean of the treatment group and the mean of the control group is an unbiased estimate of the true ATE! If we compare the difference in means from out data, the estimated ATE is -5.6. 4 | 5 | The difference in means does not use any information about runners age to inform the estimate of the ATE. 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section41.md: -------------------------------------------------------------------------------- 1 | Now we'll look at professional runners who are not from the United States. 2 |
3 |
4 | There are 33 professional runners who are not from the United States that wore hyperShoes and these runners have an average time of 151.13. 5 |
6 |
7 | There are 89 professional runners from the Unites States that did not wear hyperShoes and these runners have an average time of 155.88. 8 |
9 |
10 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section49.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | When we adjusted for the confounding variable `professional status`, our estimated Average Treatment Effect still violates the ignorability assumption because we have not adjusted for the confounding variable `usa`. 4 |
5 |
6 | The ignorability assumption for observational studies is only satisfied when all pre-treatment variables that predict the treatment and the outcome are adjusted for. 7 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section16.md: -------------------------------------------------------------------------------- 1 | ### Filled in Data 2 | 3 | Now we have filled in all the missing counter factual values with predictions for what would have happened if each runner had received the opposite treatment assignment. 4 |
5 |
6 | Consider runner 1, using the `Y0` values of runners with the same number of prior races as runner 1 we predicted that if runner 1 had not worn hyperShoes they would have had a running time of 250. 7 | 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis12.md: -------------------------------------------------------------------------------- 1 | #### Efficiency: difference in mean 2 | 3 | We can see that the difference in means method provides a weak fit to the data. While the fit is unbiased, residuals for each point (shown in black) are high. When covariates like `age` are associated with the outcome variable Y (running times), difference in means will be less efficient compared to methods that account for variation explained by covariates. 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis14.md: -------------------------------------------------------------------------------- 1 | #### Efficiency: BART 2 | 3 | BART models do not have the same linearity constraints as regression, as we can see the BART model is the best fit to our data and has the smallest residual. This leads to the most efficient estimation of the treatment effect! 4 | 5 | Like regression, BART will only improve efficiency if the included covariates explain variation in the outcome variable Y (running times). 6 | 7 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands/data/point-data.csv: -------------------------------------------------------------------------------- 1 | xName,yName,y,treatment,factual,pair_id 2 | 0,155,y0,0,1,1 3 | 0,142,y0,1,0,2 4 | 0,153,y0,0,1,3 5 | 0,147,y0,1,0,4 6 | 0,154,y0,0,1,5 7 | 0,145,y0,1,0,6 8 | 0,151,y0,0,1,7 9 | 0,148,y0,1,0,8 10 | 0,149,y0,0,1,9 11 | 0,143,y0,1,0,10 12 | 1,153,y1,0,0,1 13 | 1,136,y1,1,1,2 14 | 1,155,y1,0,0,3 15 | 1,139,y1,1,1,4 16 | 1,154,y1,0,0,5 17 | 1,135,y1,1,1,6 18 | 1,152,y1,0,0,7 19 | 1,138,y1,1,1,8 20 | 1,148,y1,0,0,9 21 | 1,137,y1,1,1,10 22 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section9.md: -------------------------------------------------------------------------------- 1 | For this analysis to be correct, the average running time of runners in the treatment group (174.47) needs to accurately represent what the average running time would have been for the control group had they worn hyperShoes and that the average running time of runners in the control group (216.64) needs to accurately represent what the average running time would have been for runners in the treatment group had they not worn hyperShoes. 2 | 3 | -------------------------------------------------------------------------------- /thinkCausal/thinkCausal.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | LineEndingConversion: Posix 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | -------------------------------------------------------------------------------- /student_work/Tong/R/plot_effects.R: -------------------------------------------------------------------------------- 1 | 2 | plot_effects <- function(dat_out){ 3 | 4 | ggplot(dat_out, aes(x = Category, y = Estimate)) + 5 | geom_point(aes(color = Category), size = 5) + 6 | geom_errorbar(aes(ymin = Estimate - Std.Dev, ymax = Estimate + Std.Dev), 7 | width = .2, 8 | position = position_dodge(.9), 9 | size = .5) + 10 | theme_minimal() + 11 | xlab("") + 12 | ylab("Estimated Treatment Effects") 13 | 14 | } -------------------------------------------------------------------------------- /thinkCausal/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(run_app) 4 | import(dplyr) 5 | import(ggplot2) 6 | import(shiny) 7 | importFrom(golem,activate_js) 8 | importFrom(golem,add_resource_path) 9 | importFrom(golem,bundle_resources) 10 | importFrom(golem,favicon) 11 | importFrom(golem,with_golem_options) 12 | importFrom(readr,parse_logical) 13 | importFrom(shiny,NS) 14 | importFrom(shiny,shinyApp) 15 | importFrom(shiny,tagList) 16 | importFrom(stringr,str_replace_all) 17 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section6.md: -------------------------------------------------------------------------------- 1 | ### Taking the mean 2 | The best predictions come from taking averages. 3 |
4 |
5 | We can take the average `Y0` of the 4 runners with 0 prior races and use that average to predict what `Y0` would have been for the 3 runners with 0 prior races with missing `Y0` values. 6 |
7 |
8 | Taking the average of the 4 `Y0` values we can observe gives us 281: 9 | 10 | $$\frac{(284 + 283 + 280 + 278)}{4} = 281$$ 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /thinkCausal/dev/run_dev.R: -------------------------------------------------------------------------------- 1 | # Set options here 2 | options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode 3 | 4 | # Comment this if you don't want the app to be served on a random port 5 | options(shiny.port = httpuv::randomPort()) 6 | 7 | # Detach all loaded packages and clean your environment 8 | golem::detach_all_attached() 9 | # rm(list=ls(all.names = TRUE)) 10 | 11 | # Document and reload your package 12 | golem::document_and_reload() 13 | 14 | # Run the application 15 | run_app() 16 | -------------------------------------------------------------------------------- /thinkCausal/renv/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "bioconductor.version": null, 3 | "external.libraries": [], 4 | "ignored.packages": [], 5 | "package.dependency.fields": [ 6 | "Imports", 7 | "Depends", 8 | "LinkingTo" 9 | ], 10 | "ppm.enabled": null, 11 | "ppm.ignored.urls": [], 12 | "r.version": null, 13 | "snapshot.type": "implicit", 14 | "use.cache": true, 15 | "vcs.ignore.cellar": true, 16 | "vcs.ignore.library": true, 17 | "vcs.ignore.local": true, 18 | "vcs.manage.ignores": true 19 | } 20 | -------------------------------------------------------------------------------- /thinkCausal/inst/extdata/fundamental_table1.csv: -------------------------------------------------------------------------------- 1 | runner,prior races,hyperShoe,Y0,Y1,Y 2 | 1,3,1,NA,224,224 3 | 2,1,0,281,NA,281 4 | 3,2,0,258,NA,258 5 | 4,0,1,NA,266,266 6 | 5,2,1,NA,248,248 7 | 6,0,0,283,NA,283 8 | 7,1,1,NA,273,273 9 | 8,0,1,NA,272,272 10 | 9,0,1,NA,273,273 11 | 10,2,0,260,NA,260 12 | 11,3,1,NA,222,222 13 | 12,3,0,250,NA,250 14 | 13,0,0,278,NA,278 15 | 14,2,1,NA,253,253 16 | 15,0,0,280,NA,280 17 | 16,0,0,284,NA,284 18 | 17,1,0,279,NA,279 19 | 18,2,1,NA,252,252 20 | 19,2,1,NA,251,251 21 | 20,2,1,NA,245,245 22 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/markdowns/potential_outcomes2_treated.md: -------------------------------------------------------------------------------- 1 | 2 | You decided that Alex should wear the Hypershoe! Alex ran the marathon and finished with a time of 3.1 hours. Is this faster than the finishing time Alex would have had if Alex did not wear the shoes? We don't know! Therefore, we still don’t know whether the shoes caused Alex to run faster, run the same speed or run slower than without the HyperShoe. 3 | 4 |
5 | 6 | But what if we could go back in time and make a different choice? 7 | 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/extdata/truth.csv: -------------------------------------------------------------------------------- 1 | runner,prior races,hyperShoe,Y0,Y1,Y 2 | 1,3,1,247,224,224 3 | 2,1,0,281,273,281 4 | 3,2,0,258,251,258 5 | 4,0,1,276,266,266 6 | 5,2,1,263,248,248 7 | 6,0,0,283,270,283 8 | 7,1,1,283,273,273 9 | 8,0,1,278,272,272 10 | 9,0,1,282,273,273 11 | 10,2,0,260,250,260 12 | 11,3,1,253,222,222 13 | 12,3,0,250,228,250 14 | 13,0,0,278,272,278 15 | 14,2,1,261,253,253 16 | 15,0,0,280,268,280 17 | 16,0,0,284,270,284 18 | 17,1,0,279,265,279 19 | 18,2,1,258,252,252 20 | 19,2,1,264,251,251 21 | 20,2,1,263,245,245 22 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/markdowns/potential_outcomes2_control.md: -------------------------------------------------------------------------------- 1 | 2 | You decided that Alex should wear the normal running shoes! Alex ran the marathon and finished with a time of 3.2 hours. Is this slower than the finishing time Alex would have had if Alex wore the HyperShoe? We don't know! Therefore, we still don’t know whether the HyperShoe could cause Alex to run faster, run the same speed or run slower than normal shoes. 3 | 4 |
5 | 6 | But what if we could go back in time and make a different choice? 7 | 8 | -------------------------------------------------------------------------------- /student_work/Junhui/man/plot_DAG.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_DAG.R 3 | \name{plot_DAG} 4 | \alias{plot_DAG} 5 | \title{Plot a simple DAG} 6 | \usage{ 7 | plot_DAG(Z_col, Y_col, X_cols) 8 | } 9 | \arguments{ 10 | \item{Z_col}{string} 11 | 12 | \item{Y_col}{string} 13 | 14 | \item{X_cols}{string or list of strings} 15 | } 16 | \value{ 17 | ggplot object 18 | } 19 | \description{ 20 | Plot a simple DAG 21 | } 22 | \examples{ 23 | plot_DAG("myZ", "myY", c("X1", "X2", "X3")) 24 | } 25 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section38.md: -------------------------------------------------------------------------------- 1 | When we condition to `professional status` and `USA`, we will fill in the missing counter-factuals with the observed times of runners who are the same on all counfounders. 2 |
3 |
4 | After filling in the missing counter-factuals we can take the difference between the average time with hyperShoes (`Y1`) and the average time without hyperShoes (`Y0`). 5 |
6 |
7 | For professional runners from the Unites States, the estimated treatment effect of hyperShoes is -11.31. 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section8.md: -------------------------------------------------------------------------------- 1 | ### The ATC 2 | 3 | The ATC is the average causal effect of HyperShoes for the runners that did not wear HyperShoes. 4 | 5 | When estimating the ATC, our goal is to understand whether or not the runners that did not wear HyperShoe would have ran faster if they had worn HyperShoes. 6 | 7 | Each blue point represents a runner that did not wear HyperShoes. We are only interested in comparing the blue points to what would have happened if each of those blue points had worn HyperShoes. 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational-analysis12.md: -------------------------------------------------------------------------------- 1 | Now we can calculate the true ATT for our sample of non-linear data by taking the average of all the individual causal effects for runners who received the treatment (wore HyperShoes) in the real world and see that, on average, runners that wore HyperShoes ran 7.9 minutes faster than they would have run had they worn standard shoes. 2 | 3 | Next we will return to reality where we only have access to each runner's factual outcomes and need to estimate the ATT... 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/extdata/fundamental_table2.csv: -------------------------------------------------------------------------------- 1 | runner,prior races,hyperShoe,Y0,Y1,Y 2 | 1,3,1,250,224,224 3 | 2,1,0,281,273,281 4 | 3,2,0,258,250,258 5 | 4,0,1,281,266,266 6 | 5,2,1,259,248,248 7 | 6,0,0,283,270,283 8 | 7,1,1,280,273,273 9 | 8,0,1,281,272,272 10 | 9,0,1,281,273,273 11 | 10,2,0,260,250,260 12 | 11,3,1,250,222,222 13 | 12,3,0,250,223,250 14 | 13,0,0,278,270,278 15 | 14,2,1,259,253,253 16 | 15,0,0,280,270,280 17 | 16,0,0,284,270,284 18 | 17,1,0,279,273,279 19 | 18,2,1,259,252,252 20 | 19,2,1,259,251,251 21 | 20,2,1,259,245,245 22 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational-analysis8.md: -------------------------------------------------------------------------------- 1 | ### BART with confounders 2 | 3 | Unlike linear regression, BART does not assume the relationship between predictors and outcome is linear, but when the data is actually linear BART performs quite similarly to linear regression. If we fit a BART model to our observational data the estimated ATT is -4.9, the same as the true ATT! 4 | 5 | Just as with linear regression, we are also making the strong assumption that we have included all confounders in the BART model. 6 | -------------------------------------------------------------------------------- /_site/d3/animations/js/showData.js: -------------------------------------------------------------------------------- 1 | function showData(data){ 2 | //buildTable(data.ratings) 3 | buildPlot(data) 4 | } 5 | 6 | // read in the data 7 | function loadData() { 8 | return Promise.all([ 9 | d3.csv("data/point-data.csv"), 10 | d3.csv("data/line-data.csv"), 11 | ]).then(datasets => { 12 | store = {}, 13 | store.scatter = datasets[0]; 14 | store.line = datasets[1]; 15 | console.log("Loaded data:", store) 16 | return store; 17 | }) 18 | } 19 | 20 | loadData().then(showData) 21 | -------------------------------------------------------------------------------- /_site/d3/pairing/js/showData.js: -------------------------------------------------------------------------------- 1 | function showData(data){ 2 | //buildTable(data.ratings) 3 | buildPlot(data) 4 | } 5 | 6 | // read in the data 7 | function loadData() { 8 | return Promise.all([ 9 | d3.csv("data/point-data.csv"), 10 | d3.csv("data/line-data.csv"), 11 | ]).then(datasets => { 12 | store = {}, 13 | store.scatter = datasets[0]; 14 | store.line = datasets[1]; 15 | console.log("Loaded data:", store) 16 | return store; 17 | }) 18 | } 19 | 20 | loadData().then(showData) 21 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section9.md: -------------------------------------------------------------------------------- 1 | ### Potential Outcomes: ATC 2 | If we took all the points from the last figure and put them in a potential outcomes table, we'd see that the ATC has the opposite problem of the ATT. 3 | 4 | For the ATC, we can observe every runners value of `Y0`, but we are missing every single value of `Y1`. 5 | 6 | To represent our missing `Y1` values, lets try to use the technique we did last time. This time we will use information from the treatment group to serve as conterfatuals for the control group. 7 | 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational-analysis2.md: -------------------------------------------------------------------------------- 1 | ### Our observed data 2 | 3 | When we plot the data from our observational study, we can see that `age` is related to the treatment assignment (whether or not a runner wore HyperShoes) and `age` is also related to the outcome (Y running times). Variables like `age` that are associated with both the treatment and the outcome variables are called confounders. As we will soon see, when confounders are not appropriately accounted for, estimated treatment effects can be biased. 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis6.md: -------------------------------------------------------------------------------- 1 | #### Estimating the ATE in Randomized Studies 2 | 3 | In practice researchers only have access to factual outcomes. Now our data reflects the type of analyses we actually conduct in practice. In real studies, we can never calculate the true ATE, but *we can estimate the ATE*. 4 | 5 | **When the treatment is randomly assigned, taking the difference in means, fitting a regression with covariates and fitting a BART model with covariates all produce unbiased estimates of the true ATE!** 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section21.md: -------------------------------------------------------------------------------- 1 | We have a problem! Like the ATC, there is no overlap of the control group among higher values of `qualifying time` and without overlap we have no way of estimating counterfactuals for slower runners in the control group. 2 | 3 | In observational studies, the ATE is the most difficult average causal effect to estimate because you need complete overlap for both the treated group and the control group. 4 | 5 | In this example, because we did not have overlap for the ATC we will not have overlap for the ATE. 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational-analysis13.md: -------------------------------------------------------------------------------- 1 | ### Difference in means 2 | 3 | If we use the difference in means as our statistical model, our estimate would be -12.6 which is extremely far from true ATT! The story is the same as the last time we used comparing the difference in means to estimate the ATT, we are still not incorporating any information about age and the imbalance of age has not been accounted for. Not appropriately adjusting for the confounding variable of `age` explains why the estimated ATT is so biased. 4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational-analysis3.md: -------------------------------------------------------------------------------- 1 | ### Imbalance 2 | 3 | In observational studies, the treatment is not randomly assigned and we no longer expect covariates to be balanced between the treatment and control group. So it's not surprising in this study that on average, runners in the treatment group are about 14 years younger than the runners in the control group. 4 | 5 | 6 | We will need to rely on a statistical model to correct this imbalance or else the substantial difference in age will bias our estimate of the ATT. 7 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section50.md: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | Our final analysis where we adjusted for both `professional status` and `usa` is only correct if these are the only two confounding variables that exist. 6 |
7 |
8 | If these are the only two confounding variables, the ignorability assumption is satisfied. 9 |
10 |
11 | **But if there are any other confounding variable other then the ignorability assumption is violated!** 12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section1.md: -------------------------------------------------------------------------------- 1 | ### The Marathon Data 2 | 3 | Visualizing the data from the marathon, we can see clear differences between runners who wore HyperShoes and runners who did not. 4 | 5 | Only runners with the fast qualifying times wore HyperShoes! In fact, there are no runners with qualifying times slower than about 145 minutes that wore HyperShoes. As we'll see, this will impact our ability to estimate different estimands (the ATT, ATC or ATE). 6 | 7 | Let's begin by considering the Average treatment effect of the treated (ATT). 8 | 9 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section13.md: -------------------------------------------------------------------------------- 1 | ### 1 prior race 2 | We will apply the same statagy as before but now we will move on to filling in counter-factual outcomes from runners with 1 prior race. 3 | 4 | **Filling in Y0** 5 | We can fill in the missing `Y0` value for runner 7 by taking the average `Y0` value of runner 2 and runner 3. 6 | 7 | $$\frac{(281 + 279)}{2} = 280$$ 8 | 9 | **Filling in Y1** 10 | To fill in the missing Y1 values for runner 2 and runner 3 we will use the average `Y1` value of runner 1. 11 | 12 | $$\frac{(273)}{1} = 273$$ 13 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section8.md: -------------------------------------------------------------------------------- 1 | Now we will consider the missing `Y1` values for the runners who have 0 prior races. 2 |
3 |
4 | For `Y1` we have the opposite problem: 5 |
6 | We can observe the `Y1` values for runner 4, runner 8 and runner 9. 7 |
8 |
9 | We are missing `Y1` values for runner 6, runner 13, runner 15 and runner 16. 10 |
11 |
12 | We'll use the same approach as before, this time we will use the average of the 3 `Y1` values we can observe to predict what the 4 missing `Y1` values would have been. 13 | -------------------------------------------------------------------------------- /_site/d3/pairing/data/line-data.csv: -------------------------------------------------------------------------------- 1 | pair_id,treatment,xName_y0,xName_y1,yName_y0,yName_y1 2 | 1,0,0,1,165.27088607142926,156.75908581624498 3 | 2,1,0,1,144.3490364396119,140.07514593352175 4 | 3,0,0,1,171.78364697950772,176.5127576137391 5 | 4,1,0,1,139.0907631697748,137.67714073055555 6 | 5,0,0,1,170.9452040324712,171.39353639624602 7 | 6,1,0,1,140.81280936088785,134.57175536605226 8 | 7,0,0,1,168.8676125124436,167.84783990246876 9 | 8,1,0,1,134.27828363097183,135.9977273605775 10 | 9,0,0,1,163.34311238695497,167.83156120042253 11 | 10,1,0,1,131.96770574235612,142.94217992546666 12 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/css/info-icon.css: -------------------------------------------------------------------------------- 1 | /* controls the information icon tooltips */ 2 | .infoToolTip .infoToolTipText { 3 | visibility: hidden; 4 | min-width: 120px; 5 | background-color: #302f42; 6 | color: #fff; 7 | text-align: center; 8 | border-radius: 2px; 9 | padding: 8px; 10 | font-size: 0.9em; 11 | font-weight: 300; 12 | 13 | /* postion */ 14 | position: absolute; 15 | z-index: 999; 16 | margin-top: 20px; 17 | margin-left: -60px; 18 | } 19 | 20 | .infoToolTip:hover .infoToolTipText { 21 | visibility: visible; 22 | opacity: 0.9; 23 | } 24 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section4.md: -------------------------------------------------------------------------------- 1 | ### Addressing the problem 2 | The fundamental problem of causal inference is a missing data problem. We will always be missing the counter-factual outcomes. How can we proceed if we will always be missing half of the data we need? 3 |
4 |
5 | To move forward with causal inference we will need to fill in the missing counter-factual outcomes. 6 |
7 |
8 | We'll do this by using the potential outcomes we can observe to predict what would have happened if a runner had received the opposite treatment assignment. 9 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section2.md: -------------------------------------------------------------------------------- 1 | #### Runner 1 wore hyperShoes. 2 | For runner 1: 3 | The running time with hyperShoes (`Y1`) is the factual outcome. 4 |
5 |
6 | What the running time would have been without hyperShoes (`Y0`) is the counter-factual outcome. 7 |
8 |
9 | To know the causal effect of hyperShoes for Runner 1, we need take the difference between `Y1` and `Y0`. 10 |
11 |
12 | The fundamental problem of causal inference is that we don't know what runner 1's time would have been if they had not worn hyperShoes. 13 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section3.md: -------------------------------------------------------------------------------- 1 | #### Runner 2 did not wear hyperShoes. 2 | For runner 2: 3 | The running time without hyperShoes (`Y0`) is the factual outcome. 4 |
5 |
6 | What the running time would have been with hyperShoes (`Y1`) is the counter-factual outcome. 7 |
8 |
9 | To know the causal effect of hyperShoes for Runner 2, we need take the difference between `Y1` and `Y0`. 10 |
11 |
12 | The fundamental problem of causal inference is that we don't know what runner 1's time would have been if they had not worn hyperShoes. 13 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section10.md: -------------------------------------------------------------------------------- 1 | The problem is that in observational studies, the treatment variable is not randomly assigned. Without random assignment the treatment and control group can look very different from one another. If these differences are related to the outcome (running time) then the treatment and control group will poorly represent one another! **This study is an observational study where hyperShoes were not randomly assigned.** Runners were not randomly assigned to wear hyperShoes, but self selected into wearing or not wearing hyperShoes. 2 |
3 |
4 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/markdowns/post_treatment_citations.md: -------------------------------------------------------------------------------- 1 | ## Citations and readings 2 | 3 | If you a looking for citations or more information about post-treatment variables you can refer to: 4 | 5 | - Rosenbaum, P. R. (1984). The consequences of adjustment for a concomitant variable that has been affected by the treatment. Journal of the Royal Statistical Society: Series A (General), 147(5), 656-666. 6 | - Gelman, A., Hill, J. and Vehtari, A. (2020) Chapter 19 “Causal inference using regression on the treatment variable,” Regression and Other Stories, Cambridge University Press 7 | 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section17.md: -------------------------------------------------------------------------------- 1 | We have two different groups of professional runners, most of the professional runners wore hyperShoes but a small group of professional runners did not. 2 |
3 |
4 | Professional runners that wore hyperShoes had an average time of 163.41 but we don't know what this groups average time would have been had they not worn hyperShoes. 5 |
6 |
7 | The other group of professional runners did not wear hyperShoes, they had an average time of 160.13 but we don't know what their average time would have been if they had worn hyperShoes. 8 | 9 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/css/analysis-upload.css: -------------------------------------------------------------------------------- 1 | #upload_file_div .form-control { 2 | background-color: rgba(48, 47, 66, 0) !important; 3 | border-radius: 3; 4 | box-shadow: none; 5 | border: 1px solid gray; 6 | color: rgba(48, 47, 66, 1) !important; 7 | font-weight: 300; 8 | font-family: "Roboto", Helvetica, Arial, sans-serif; 9 | max-width: 100%; 10 | word-wrap: break-word; 11 | white-space: normal; 12 | display: inline-block; 13 | padding: 10px; 14 | height: 46px; 15 | margin: 0.4em 0 0.4em 0; 16 | } 17 | .progress-bar { 18 | background-color: #302f42 !important; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section6.md: -------------------------------------------------------------------------------- 1 | ### Filling in missing Y0 values 2 | 3 | We can use a statistical model like Bayesian Additive Regression Trees (BART) or linear regression to fill in our missing `Y0` values. 4 | 5 | Here we'll use BART, the statistical model used in the thinkCausal analyses. The red line represents our best estimate of what would have happened to each runner in the treatment group had they not worn HyperShoes! If you'd like to learn more about how statistical models are used to predict counterfactuals, check out the module on the fundamental problem of causal inference. 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/fundemental/markdowns/section5.md: -------------------------------------------------------------------------------- 1 | We'll start by filling-in the missing `Y0` values for the runners who have 0 prior races. 2 |
3 |
4 | We are missing 3 `Y0` values (runner 4, runner 8 and runner 9). 5 |
6 |
7 | But we do know the `Y0` values for runner 6, runner 13, runner 15 and runner 16. 8 |
9 |
10 | To fill in the 3 missing `Y0` values, we can use what we know about the 4 `Y0` values we can observe. 11 |
12 |
13 | What is the best way to turn the 4 `Y0` values we know into predictions for the 3 `Y0` values we don't know? 14 | 15 | 16 | -------------------------------------------------------------------------------- /student_work/Junhui/R/ggplot_settings.R: -------------------------------------------------------------------------------- 1 | # default theme is set on load by input$settings_options_ggplot_theme 2 | 3 | # set default continuous colors 4 | options( 5 | ggplot2.continuous.colour = "viridis", 6 | ggplot2.continuous.fill = "viridis" 7 | ) 8 | 9 | # set default discrete colors 10 | scale_colour_discrete <- function(...) { 11 | viridis::scale_color_viridis(..., discrete = TRUE) 12 | } 13 | scale_color_discrete <- function(...) { 14 | viridis::scale_color_viridis(..., discrete = TRUE) 15 | } 16 | scale_fill_discrete <- function(...) { 17 | viridis::scale_fill_viridis(..., discrete = TRUE) 18 | } 19 | -------------------------------------------------------------------------------- /_site/d3/namespace/js/showData.js: -------------------------------------------------------------------------------- 1 | estimands.showData = function(data){ 2 | //buildTable(data.ratings) 3 | buildPlot(data) 4 | } 5 | 6 | // read in the data 7 | estimands.loadData = function() { 8 | return Promise.all([ 9 | d3.csv("../scrollytell/data/point-data.csv"), 10 | d3.csv("../scrollytell/data/line-data.csv"), 11 | ]).then(datasets => { 12 | store = {}, 13 | store.scatter = datasets[0]; 14 | store.line = datasets[1]; 15 | console.log("Loaded data:", store) 16 | return store; 17 | }) 18 | } 19 | 20 | estimands.loadData().then(estimands.showData) 21 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section20.md: -------------------------------------------------------------------------------- 1 | ### Potential Outcomes: ATE 2 | 3 | Let's put all of our data into a potential outcomes table. This will help us think about the meaning of the ATE. 4 | 5 | For the runners that wore HyperShoes (Z = 1), we can observe `Y1` values but are missing the `Y0` values. 6 | 7 | For the runners that did not wear HyperShoes (Z = 0), we can observe `Y0` values but are missing the `Y1` values. 8 | 9 | To estimate the ATE, we need to fill in the missing `Y0` values for runners that wore HyperShoes and the missing `Y1` values for runners that did not wear HyperShoes. 10 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/md/about.md: -------------------------------------------------------------------------------- 1 | ### About 2 | 3 | This tool was built by New York University PRIISM and funded by the Institute of Education Sciences. 4 | 5 | ### Have issues or questions? 6 | 7 | Leave feedback here or submit an issue on our GitHub page. 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/markdowns/post_treatment_8.md: -------------------------------------------------------------------------------- 1 | ## Recap 2 | 3 | Including post-treatment variables as predictors in a causal analysis should be avoided. As we saw in the bugs example, including post-treatment variables can distort causal analyses and lead you to incorrect conclusions. Post-treatment variables are any variables that occurred after the treatment was assigned and could possibly be influenced by the treatment. Statistical models with post-treatment variables make unfair comparisons and are biased because models do not have access to the potential outcomes of those variables. 4 | 5 |
6 |
7 |
8 | -------------------------------------------------------------------------------- /student_work/Junhui/man/create_progress_bar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/create_progress_bar.R 3 | \name{create_progress_bar} 4 | \alias{create_progress_bar} 5 | \title{Create a progress bar} 6 | \usage{ 7 | create_progress_bar(progress) 8 | } 9 | \arguments{ 10 | \item{progress}{integer between 0 and 100 representing the fill percentage} 11 | } 12 | \value{ 13 | HTML 14 | } 15 | \description{ 16 | Create a bootstrap HTML progress bar filled. `progress` specifies the fill percentage of the bar. 17 | } 18 | \examples{ 19 | create_progress_bar(80) 20 | } 21 | \author{ 22 | Joe Marlo 23 | } 24 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/colinearity/markdowns/section1.md: -------------------------------------------------------------------------------- 1 | ### The Study 2 | 3 | This hyperShoe study is an *observational study* on 500 professional runners from a recent race. This race required that every runner complete to two separate qualifying races (`qualify1` and `qualify2`). 4 | 5 | hyperShoes are a new product and both qualifying races took place before hyperShoes were available to any runners. **This means both qualifying races must be pre-treatment variables**. We'll talk about pre-treatment vs post-treatment variable later, for now all you need to know is that **adjusting for post-treatment variables is a bad idea**. 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section8.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | After filling in the missing counter-factual outcomes for the treatment and control groups, the difference in means estimates an Average Treatment Effect of -42.17. 4 | 5 |
Based on this analysis the company concluded that wearing hyperShoes caused runners' to to run an average of 42.17 minutes fasterThe negative sign is implied by the word faster. Running faster means times are -42.17 minutes what they would have been without hyperShoes. than they would have finished without hyperShoes.
6 | 7 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis5.md: -------------------------------------------------------------------------------- 1 | #### Calculating the true ATE 2 | 3 | As we learned in the estimands learning module, when we have all potential outcomes we can calculate the true average treatment effect (ATE) by taking the average of each runners individual causal effect. 4 | 5 | As we can see, the true ATE for our study on HyperShoes is -5.4. A runner who wore HyperShoes ran 5.4 minutes faster, on average, than they would have ran had they worn standard shoes. 6 | 7 | Remember that we can only calculate the true ATE when we have access to all potential outcomes which a researcher can never have in practice! 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis9.md: -------------------------------------------------------------------------------- 1 | #### Regression 2 | 3 | When the treatment is randomly assigned, fitting a regression with covaraites in also an unbiased estimate of the true ATE! If we fit a regression to the data from our study you can see the estimated ATE is -5.6. 4 | 5 | Our regression model differs from the difference in means model by incorporating information from the treatment variable and our single covariate `age`, however, `age` can only be incorporated as a linear relationship. 6 | 7 | *Note that while our regression model includes `age` as a predictor, we cannot make causal claims about `age`*. 8 | -------------------------------------------------------------------------------- /.github/workflows/render-test-website.yaml: -------------------------------------------------------------------------------- 1 | name: Build test site to GitHub Pages branch 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - dev 7 | 8 | jobs: 9 | build-site: 10 | timeout-minutes: 30 11 | runs-on: ubuntu-latest 12 | env: 13 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 14 | steps: 15 | - uses: actions/checkout@master 16 | 17 | - name: Deploy site to GitHub pages branch 18 | uses: s0/git-publish-subdir-action@v2.5.1 19 | env: 20 | REPO: self 21 | BRANCH: gh-pages 22 | FOLDER: _site 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /student_work/Junhui/man/clean_detect_column_types.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/clean_detect_column_types.R 3 | \name{clean_detect_column_types} 4 | \alias{clean_detect_column_types} 5 | \title{Return a list of the column types} 6 | \usage{ 7 | clean_detect_column_types(.data) 8 | } 9 | \arguments{ 10 | \item{.data}{a dataframe} 11 | } 12 | \value{ 13 | 14 | } 15 | \description{ 16 | Categorizes the types of columns in a dataframe by categorical or continuous. 17 | } 18 | \examples{ 19 | X <- data.frame(X1 = 1:5, X2 = rnorm(5), X3 = LETTERS[1:5], X4 = as.factor(LETTERS[1:5])) 20 | clean_detect_column_types(X) 21 | } 22 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/markdowns/potential_outcomes5.md: -------------------------------------------------------------------------------- 1 | Potential outcomes tables are useful to record data for each runner in the study. Potential outcomes tables show each individual's treatment assignment, what their outcome would have been without the treatment, and what their outcome would have been with the treatment and the outcome was actually observed. Full potential outcomes tables require access to our potential outcomes time machine, you can use the buttons below to switch back and forth between what we can see with our potential outcomes time machine and what we can see in practice. ***From now on we will refer to this as Omniscience mode.*** 2 | -------------------------------------------------------------------------------- /thinkCausal/inst/extdata/fundemental_table3.csv: -------------------------------------------------------------------------------- 1 | runner,hyperShoe,Y0,Y1,Y 2 | 1,1,NA,260,260 3 | 2,0,245,NA,245 4 | 3,0,253,NA,253 5 | 4,1,NA,245,245 6 | 5,1,NA,263,263 7 | 6,0,268,NA,268 8 | 7,0,251,NA,251 9 | 8,1,NA,260,260 10 | 9,1,NA,243,243 11 | 10,1,NA,257,257 12 | 11,1,NA,260,260 13 | 12,1,NA,261,261 14 | 13,0,250,NA,250 15 | 14,1,NA,257,257 16 | 15,1,NA,260,260 17 | 16,0,265,NA,265 18 | 17,0,264,NA,264 19 | 18,1,NA,259,259 20 | 19,1,NA,248,248 21 | 20,1,NA,244,244 22 | 21,0,264,NA,264 23 | 22,1,NA,262,262 24 | 23,0,262,NA,262 25 | 24,1,NA,256,256 26 | 25,1,NA,261,261 27 | 26,0,251,NA,251 28 | 27,0,266,NA,266 29 | 28,1,NA,262,262 30 | 29,0,251,NA,251 31 | 30,0,264,NA,264 32 | -------------------------------------------------------------------------------- /student_work/Junhui/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(clean_auto_convert_logicals) 4 | export(clean_detect_ZYX_columns) 5 | export(clean_detect_column_types) 6 | export(clean_detect_plot_vars) 7 | export(clean_names) 8 | export(convert_data_type_to_complex) 9 | export(convert_data_type_to_simple) 10 | export(create_datatable) 11 | export(create_progress_bar) 12 | export(create_script) 13 | export(plot_DAG) 14 | export(plot_exploration) 15 | export(plot_variable_importance) 16 | import(ggplot2) 17 | importFrom(DT,datatable) 18 | importFrom(GGally,ggpairs) 19 | importFrom(dplyr,across) 20 | importFrom(dplyr,mutate) 21 | importFrom(tidyselect,where) 22 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/markdowns/post_treatment_3.md: -------------------------------------------------------------------------------- 1 | When `bugs` **is included** in the analysis, the causal effect of the new fertilizer is estimated by comparing the average height of plants that received the new fertilizer (colored in red) against the average height and plants that did not receive the new fertilizer (colored in blue) **that is made within groups of plants that had bugs and did not have bugs**. 2 | 3 | The results of this analysis, which does control for post-treatment variables, found that receiving fertilizer caused plants to produce an average of **-.18 fewer pounds of fruit**, than they would have produced had they not received the new fertilizer 4 | -------------------------------------------------------------------------------- /_site/README.md: -------------------------------------------------------------------------------- 1 | # thinkCausal 2 | 3 | This subfolder is automatically copied over to the gh-pages branch which builds folder's contents to https://priism-center.github.io/thinkCausal_dev and used for testing. 4 | 5 | ### d3 6 | - [animations](https://priism-center.github.io/thinkCausal_dev/d3/animations) 7 | - [pairing](https://priism-center.github.io/thinkCausal_dev/d3/pairing) 8 | - [scrollytell](https://priism-center.github.io/thinkCausal_dev/d3/scrollytell) 9 | - [fundamental](https://priism-center.github.io/thinkCausal_dev/d3/fundamental) 10 | - [bart](https://priism-center.github.io/thinkCausal_dev/d3/bart) 11 | - [overlap](https://priism-center.github.io/thinkCausal_dev/d3/overlap) 12 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/markdowns/post_treatment_4.md: -------------------------------------------------------------------------------- 1 | As you just saw, including post-treatment variables can drastically impact the results of both randomized experiments and observational studies. 2 | 3 | If we had access to all potential outcomes we could see that the true average treatment effect is -.18. In this example knowing all potential outcomes would mean that we could see how many pounds of tomatoes would have grown if all of the farmers 400 plants had the new fertilizer and how many pounds of tomatoes would have grown if none of the farmers 400 plants had the new fertilizer. In practice we never know both potential outcomes for every unit in our studies. 4 | 5 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/estimands2/markdowns/section22.md: -------------------------------------------------------------------------------- 1 | ### Partial Overlap 2 | 3 | It is possible that you may only have partial overlap like the data shown here. 4 | 5 | Here we have overlap for both treated and control runners for the middle region of `qualifying times` but there is no overlap for treated runners with low `qualifying times` and there is no overlap for control runners with high `qualifying times`. 6 | 7 | Here is an example where there is not overlap for the ATE, ATT or ATC! 8 | 9 | There are no control runners with low `qualifying times` and no treated runners with high `qualifying times`. 10 | 11 | How should we proceed when we have not overlap at all? 12 | 13 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/markdowns/post_treatment_2.md: -------------------------------------------------------------------------------- 1 | ### Analysis without post-treatment variables 2 | 3 | When `bugs` **is not included** in the analysis, the causal effect of the new fertilizer is estimated by comparing the average pounds of tomatoes from plants that received fertilizer (colored in red) against the average pounds of tomatoes from plants that did not receive the new fertilizer (colored in blue). 4 | 5 | The results of this analysis, which does not control for post-treatment variables, found that receiving fertilizer caused plants to produce an average of **1.51 more pounds of fruit**, than they would have produced had they not received the new fertilizer. 6 | 7 | 8 | -------------------------------------------------------------------------------- /thinkCausal/R/mod_learn_versionC.R: -------------------------------------------------------------------------------- 1 | #' versionC UI Function 2 | #' 3 | #' @description A shiny Module. 4 | #' 5 | #' @param id,input,output,session Internal parameters for {shiny}. 6 | #' 7 | #' @noRd 8 | #' 9 | #' @importFrom shiny NS tagList 10 | mod_learn_versionC_ui <- function(id){ 11 | ns <- NS(id) 12 | tagList( 13 | 14 | ) 15 | } 16 | 17 | #' versionC Server Functions 18 | #' 19 | #' @noRd 20 | mod_learn_versionC_server <- function(id){ 21 | moduleServer( id, function(input, output, session){ 22 | ns <- session$ns 23 | 24 | }) 25 | } 26 | 27 | ## To be copied in the UI 28 | # mod_versionC_ui("versionC_1") 29 | 30 | ## To be copied in the server 31 | # mod_versionC_server("versionC_1") 32 | -------------------------------------------------------------------------------- /thinkCausal/R/mod_help.R: -------------------------------------------------------------------------------- 1 | #' help UI Function 2 | #' 3 | #' @description A shiny Module. 4 | #' 5 | #' @param id,input,output,session Internal parameters for {shiny}. 6 | #' 7 | #' @noRd 8 | #' 9 | #' @importFrom shiny NS tagList 10 | mod_help_ui <- function(id){ 11 | ns <- NS(id) 12 | tagList( 13 | includeMarkdown(app_sys('app', 'www', 'md', 'help.md')) 14 | ) 15 | } 16 | 17 | #' help Server Functions 18 | #' 19 | #' @noRd 20 | mod_help_server <- function(id){ 21 | moduleServer( id, function(input, output, session){ 22 | ns <- session$ns 23 | 24 | }) 25 | } 26 | 27 | ## To be copied in the UI 28 | # mod_help_ui("help_1") 29 | 30 | ## To be copied in the server 31 | # mod_help_server("help_1") 32 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational-analysis11.md: -------------------------------------------------------------------------------- 1 | ### Suspending disbelief to understand the goal: non-linear scenario 2 | 3 | Again, before moving on to estimating the ATT, we'll suspend belief and imagine that we have access to all potential outcomes. We can see each runners finishing time for if they had worn HyperShoes and if they had worn standard shoes. We can see the highly non-linear relationship between age and running times along with the individual causal effects (ICE) of all runners we need to calculate the ATT (shown in black lines). Remember that because we are interested in the ATT, we are only need the counter-factuals of runners in the treatment group. 4 | 5 | 6 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis13.md: -------------------------------------------------------------------------------- 1 | #### Efficiency: regression 2 | 3 | When using regression information about `age` is incorporated into the estimation process, however, this information can only be incorporated in a linear form. Even though using linear information about `age` is not a perfect fit to our data, the residuals are less than they were when using difference in means. 4 | 5 | Regression will only increase efficiency if the covariates in the regression model explain variation in outcome variable Y (running times). If `age` was unrelated to outcome variable Y (running times) then regression would be equally efficient to using the difference in means method. 6 | 7 | 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/colinearity/markdowns/section2.md: -------------------------------------------------------------------------------- 1 | Comparing the two qualifying times, we see that times from the first qualifying race (`qualify1`) and the second qualifying race (`qualify2`) have a correlation of .85. 2 |
3 |
4 | This is a really high correlation! 5 |
6 |
7 | In observational studies, it is crucial we adjust for all confounders, but you also may have heard in introductory statistics courses that we should avoid including variables that are highly correlated (multiple-colinearity) in a statistical model. 8 |
9 |
10 | We want to know the causal effect of hyperShoes on running times but it's unclear what we should or shouldn't adjust for in our analysis. 11 | 12 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/randomized-analysis/markdowns/rct_analysis7.md: -------------------------------------------------------------------------------- 1 | #### Balance and Overlap 2 | 3 | Randomization ensures that, **on average**, all covaraites are balanced and have complete overlap. This is true regardless if we measure variables or not. 4 | 5 | In our study, we can see `age` is balanced between runners in the treatment and control groups. We also see there is complete overlap for `age` between the treatment and control conditions. 6 | 7 | Imagine another potentially important variable `weight`. In our study we did not measure `weight`, but because the treatment has been randomly assigned, we can expect that weight is balanced and has complete overlap between the treatment and control groups. 8 | -------------------------------------------------------------------------------- /thinkCausal/tests/testthat/test-fct_model.R: -------------------------------------------------------------------------------- 1 | library(bartCause) 2 | 3 | # prep data 4 | .data <- readr::read_csv(app_sys('extdata', 'lalonde.csv')) 5 | .data <- dplyr::select(.data, 'treat', 're78', 'age', 'educ', 'black', 'hisp', 'married', 'nodegr') 6 | .data <- clean_auto_convert_logicals(.data) 7 | 8 | # fit model 9 | model_results <- fit_bart( 10 | .data = .data, 11 | ran_eff = NULL, 12 | .weights = NULL, 13 | .estimand = "ate", 14 | rct = T 15 | ) 16 | 17 | model_validation <- validate_model_fit_(model_results) 18 | test_that("bartCause::bartc() API still works", { 19 | expect_s3_class(model_results, 'bartcFit') 20 | }) 21 | test_that('validate_model_fit_() works', { 22 | expect_null(model_validation) 23 | }) 24 | -------------------------------------------------------------------------------- /student_work/Junhui/UI/headers/concepts_header.R: -------------------------------------------------------------------------------- 1 | concepts_header <- navbarMenu( 2 | title = 'Concepts', 3 | concepts_page, 4 | "-----", 5 | tabPanel(title = "Test your understanding", 6 | includeMarkdown(file.path("UI", "markdowns", 'concepts.md'))), 7 | tabPanel(title = 'Randomization', 8 | randomizationUI(id = "concepts_randomization")), 9 | tabPanel(title = "Fundamental problem", 10 | includeMarkdown(file.path("UI", "markdowns", 'concepts.md'))), 11 | tabPanel(title = "Assumptions", 12 | includeMarkdown(file.path("UI", "markdowns", 'concepts.md'))), 13 | tabPanel(title = "Regression methods", 14 | includeMarkdown(file.path("UI", "markdowns", 'concepts.md'))) 15 | ) -------------------------------------------------------------------------------- /_site/d3/pairing/data/point-data.csv: -------------------------------------------------------------------------------- 1 | xName,yName,y,treatment,factual,pair_id 2 | 0,3.4090740009035785,y0,0,1,1 3 | 0,3.0168173727178678,y0,1,0,2 4 | 0,3.224736167412366,y0,0,1,3 5 | 0,3.0313443716511905,y0,1,0,4 6 | 0,3.2810105378223344,y0,0,1,5 7 | 0,3.512859901373106,y0,1,0,6 8 | 0,2.8224864660785944,y0,0,1,7 9 | 0,2.7311600208729025,y0,1,0,8 10 | 0,3.040127173351634,y0,0,1,9 11 | 0,3.496984721574625,y0,1,0,10 12 | 1,1.7227789273430505,y1,0,0,1 13 | 1,2.1131193597244273,y1,1,1,2 14 | 1,2.322168994206197,y1,0,0,3 15 | 1,2.563425951365554,y1,1,1,4 16 | 1,1.982917454774935,y1,0,0,5 17 | 1,1.8438665439199533,y1,1,1,6 18 | 1,1.2916122419396623,y1,0,0,7 19 | 1,2.1343176545383673,y1,1,1,8 20 | 1,1.5358637168361204,y1,0,0,9 21 | 1,0.7967338947880178,y1,1,1,10 22 | -------------------------------------------------------------------------------- /student_work/Tong/global.R: -------------------------------------------------------------------------------- 1 | # ----- ----- ----- ----- title 2 | # 3 | # Title: thinkCausal Shiny App 4 | # Subtitle: Concepts - All Confounders Measured 5 | # 6 | # Description: illustrate why ignorability is important for causal inference 7 | # using regression analysis. 8 | 9 | # Dependencies ----------------------------------------------------------------- 10 | library(shiny) 11 | library(shinythemes) 12 | library(xtable) 13 | library(MASS) 14 | library(tidyverse) 15 | 16 | 17 | # Color palette ---------------------------------------------------------------- 18 | blue <- "#335C81" 19 | red <- "#F42C04" 20 | 21 | 22 | map(list.files('R', recursive = TRUE), function(file) source(file.path('R', file))) 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /student_work/Junhui/R/make_data_demo.R: -------------------------------------------------------------------------------- 1 | # example data set for demo 2 | make_dat_demo <- function(n = 400){ 3 | inv.log <- function(x){exp(x*.8)/(1 + exp(x*.8))} 4 | X <- runif(n, min = 0,max = 2) 5 | X2 <- rnorm(n, -2, 5) 6 | prob <- inv.log((-2 + (X^2))) 7 | Z <- rbinom(n, 1, prob) 8 | A <- matrix(runif(4), 2, 2) 9 | A <- A %*% t(A) 10 | diag(A) <- 1 11 | Sigma <- A 12 | X3 <- MASS::mvrnorm(n, rep(2, 2), Sigma)[, 1] 13 | X4 <- MASS::mvrnorm(n, rep(2, 2), Sigma)[, 2] 14 | Y0 <- 2*X + .8*X2 + rnorm(n, 0, 1) 15 | Y1 <- 2*X + 3*(X^2) + .8*X2 + rnorm(n, 0, 1) 16 | df <- data.frame(X, prob, Z, Y0, Y1, X2, X3, X4) 17 | df <- df %>% mutate(Y = if_else(Z ==1, Y1, Y0)) 18 | df <- df %>% dplyr::select(-c(Y0, Y1, prob)) 19 | return(df) 20 | } 21 | 22 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/colinearity/markdowns/section3.md: -------------------------------------------------------------------------------- 1 | Every choice about including or not including covariates should be made based on whether or not it will be helpful or harmful to our estimate of the causal effect of hyperShoes on running times. 2 | 3 | The problem is that we without knowing the true causal effect of hyperShoes on running times we can't see whether or not including a covariate is helpful or harmful. 4 | 5 | Because this is a hypothetical study, we have the power to see the true causal effect of hyperShoes on running times. 6 | 7 | You can flip back and forth between our view of the data as Researchers (what we can see in real causal inference problems) and what we could see if we were an oracle with the power or seeing all potential outcomes. 8 | 9 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational-analysis10.md: -------------------------------------------------------------------------------- 1 | ### Non-linear response surface 2 | 3 | The problem with the prior example is that we can't expect linear relationships between covariates and outcomes in social science data. The assumption of linearity is especially unrealistic when you need to adjust for many variables. In practice, models can contain 20, 40 and in some cases 200 or more covariates! All of these variables can have complex interactions and hidden non-linear relationships with the outcome. 4 | 5 | Let's imagine that instead of the linear relationship between `age` and `Y (running times)` the relationship is noticeably non-linear. There is still lack of overlap for the ATE and ATC so we will stick with estimating the ATT. 6 | 7 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/post-treatment/markdowns/post_treatment_6.md: -------------------------------------------------------------------------------- 1 | When the farmer included the post-treatment variable `bugs`, the estimated average treatment effect was -.18 with a 95% confidence interval between -.42 and 0.06. This is far off from the true average treatment effect 1.58. This analysis, is not only far from the true average treatment effect but would lead the farmer to reach the incorrect conclusion about the new fertilizer! 2 | 3 | Some fields would describe `bugs` as a *mediator*, *process variable* or *intermediate outcome* meaning that the treatment appears to work by protecting plants from being eaten by bugs. *Mediator*, *process variable*, *intermediate outcome* are all post-treatment variables and should not be adjusted for. 4 | 5 |
6 |
7 |
8 | 9 | -------------------------------------------------------------------------------- /thinkCausal/R/run_app.R: -------------------------------------------------------------------------------- 1 | #' Run the thinkCausal Shiny application 2 | #' 3 | #' @param ... arguments to pass to golem_opts. 4 | #' See `?golem::get_golem_options` for more details. 5 | #' @inheritParams shiny::shinyApp 6 | #' 7 | #' @export 8 | #' @importFrom shiny shinyApp 9 | #' @importFrom golem with_golem_options 10 | run_app <- function( 11 | onStart = NULL, 12 | options = list(launch.browser = TRUE), 13 | enableBookmarking = NULL, 14 | uiPattern = "/", 15 | ... 16 | ) { 17 | with_golem_options( 18 | app = shinyApp( 19 | ui = app_ui, 20 | server = app_server, 21 | onStart = onStart, 22 | options = options, 23 | enableBookmarking = enableBookmarking, 24 | uiPattern = uiPattern 25 | ), 26 | golem_opts = list(...) 27 | ) 28 | } 29 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/section15.md: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | `professional status` is **confounder**. A **confounder** or a **confounding variable** is any pre-treatment variable that is *both* related to the treatment and related the outcome. When we do not account for a confounder, the average observed outcomes from the treatment group will be an unreliable representation of what would have happened to the control group had they worn hyperShoes and vice versa. The analysis reported by the company did not adjust for this confounder so the estimated ATE of of -42.17 is misleading! **If we properly account for all confounding variables in our analysis, we can still estimate unbiased causal effects for observation study!** 6 |
7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /student_work/Junhui/tests/testthat/test_convert_functions.R: -------------------------------------------------------------------------------- 1 | my_character = c('one', 'two', 'three') 2 | my_logical = c(TRUE, FALSE, FALSE) 3 | my_numeric = c(1.24, 7, -22) 4 | X <- data.frame(my_character = my_character, my_logical = my_logical, my_numeric = my_numeric) 5 | simple_data_types <- convert_data_type_to_simple(X) 6 | test_that("convert_data_type_to_simple() output is correct", { 7 | expect_equal(simple_data_types, 8 | c("Categorical", 'Binary', 'Continuous')) 9 | expect_type(simple_data_types, 'character') 10 | }) 11 | 12 | # clean_auto_convert_logicals(X) 13 | # test_that("clean_auto_convert_logicals() output is correct", { 14 | # expect_equal(detected_y, list(Z = 'treatment', Y = 'rsp', X = c('dummy1', 'dummy2'))) 15 | # expect_type(detected_y, 'list') 16 | # }) 17 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/colinearity/markdowns/intro.md: -------------------------------------------------------------------------------- 1 | # Colinearity 2 | 3 | Even if two or more pre-treatment variables are highly correlated, they both should be included in the analysis. **Concerns about colinearity (high correlation between covariates) is not a valid reasons to exclude variables from a causal analysis**. 4 |
5 |
6 | Despite these recommendations, including highly correlated variables in an analysis makes many researchers uncomfortable because this contradicts advice given in some introductory statistics courses. 7 |
8 |
9 | We'll use a hypothetical study about the effects of wearing hyperShoes (a high performance running shoe) on running times, to explore how including or not including highly correlated variables impacts the conclusion of a causal analysis. 10 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/observational-analysis/markdowns/observational-analysis9.md: -------------------------------------------------------------------------------- 1 | ### Comparing estimates 2 | 3 | Lets compare the results from our 3 statistical models. 4 | 5 | Difference in means is far off from the true ATT, and the uncertainty estimates provided by difference in means do not cover the true ATT. 6 | 7 | When the assumption of linearity and the assumption that all confounders are measured and included in the model are held, linear regression can estimate the true ATT even when treatment is not randomly assigned. 8 | 9 | The same is true for the BART model, when all confounders are measured and included in the model, estimates from a BART model are unbiased estimates of the true ATT. 10 | 11 | In the next section, we'll see what would happen if our data was no longer linear! 12 | 13 | -------------------------------------------------------------------------------- /_site/d3/scrollytell/js/init.js: -------------------------------------------------------------------------------- 1 | estimands.initializeData = function(data){ 2 | //buildTable(data.ratings) 3 | estimands.buildPlot(data, "#estimands-plot-ATE") 4 | estimands.scrollytellState1() 5 | estimands.plotATT(data, '#estimands-plot-ATT') 6 | estimands.plotATC(data, '#estimands-plot-ATC') 7 | } 8 | 9 | // read in the data 10 | estimands.loadData = function() { 11 | return Promise.all([ 12 | d3.csv("data/point-data.csv"), 13 | d3.csv("data/line-data.csv"), 14 | ]).then(datasets => { 15 | estimands.data = {}, 16 | estimands.data.scatter = datasets[0]; 17 | estimands.data.line = datasets[1]; 18 | console.log("Loaded data:", estimands.data) 19 | return estimands.data; 20 | }) 21 | } 22 | 23 | estimands.loadData().then(estimands.initializeData) 24 | -------------------------------------------------------------------------------- /thinkCausal/inst/extdata/fundemental_table4.csv: -------------------------------------------------------------------------------- 1 | runner,first.race,hyperShoe,Y0,Y1,Y 2 | 1,yes,1,258,260,260 3 | 2,no,0,245,256,245 4 | 3,no,0,253,256,253 5 | 4,no,1,258,245,245 6 | 5,yes,1,258,263,263 7 | 6,yes,0,268,256,268 8 | 7,no,0,251,256,251 9 | 8,yes,1,258,260,260 10 | 9,no,1,258,243,243 11 | 10,yes,1,258,257,257 12 | 11,yes,1,258,260,260 13 | 12,yes,1,258,261,261 14 | 13,no,0,250,256,250 15 | 14,yes,1,258,257,257 16 | 15,yes,1,258,260,260 17 | 16,yes,0,265,256,265 18 | 17,yes,0,264,256,264 19 | 18,yes,1,258,259,259 20 | 19,no,1,258,248,248 21 | 20,no,1,258,244,244 22 | 21,yes,0,264,256,264 23 | 22,yes,1,258,262,262 24 | 23,yes,0,262,256,262 25 | 24,yes,1,258,256,256 26 | 25,yes,1,258,261,261 27 | 26,no,0,251,256,251 28 | 27,yes,0,266,256,266 29 | 28,yes,1,258,262,262 30 | 29,no,0,251,256,251 31 | 30,yes,0,264,256,264 32 | -------------------------------------------------------------------------------- /student_work/Junhui/man/plot_variable_importance.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_variable_importance.R 3 | \name{plot_variable_importance} 4 | \alias{plot_variable_importance} 5 | \title{Variable importance of Bayesian Additive Regression Trees} 6 | \usage{ 7 | plot_variable_importance(.model, confounders, out = "all") 8 | } 9 | \arguments{ 10 | \item{.model}{a model produced by bartCause::bartc(). Typically store$model_results} 11 | 12 | \item{confounders}{matrix of confounders} 13 | } 14 | \value{ 15 | a list containing variable importance plot & ordered table of confounders by scaled importance 16 | } 17 | \description{ 18 | Fit single regression tree on bartc() icates to produce variable importance plot & table. 19 | } 20 | \author{ 21 | George Perrett, Joe Marlo 22 | } 23 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/markdowns/potential_outcomes3_control.md: -------------------------------------------------------------------------------- 1 | Now we get to see the run time for Alex with the Hypershoe. Alex would have finished the race in 3.1 hours. Now we know that the Hypershoe did indeed have a causal effect on Alex's run time. 2 | 3 |
4 |
5 | 6 | ### Causal inference makes comparisons between counterfactual states for the same person. 7 | Causal inference requires within-person comparisons between a factual outcome (what did happen) and one or more counterfactual outcomes (what would have happened under a different treatment regime). To know whether or not the shoes caused a faster marathon time compare the factual and counterfactual outcomes, we see that wearing the HyperShoes caused Alex to finish .1 hours faster than Alex would have finished without wearing HyperShoes. 8 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/potential-outcomes/markdowns/potential_outcomes3_treated.md: -------------------------------------------------------------------------------- 1 | Now we get to see the run time for Alex without the Hypershoe. Alex would have finished the race in 3.2 hours. Now we know that the Hypershoe did indeed have a causal effect on Alex's run time. 2 | 3 |
4 |
5 | 6 | ### Causal inference makes comparisons between counterfactual states for the same person. 7 | Causal inference requires within-person comparisons between a factual outcome (what did happen) and one or more counterfactual outcomes (what would have happened under a different treatment regime). To know whether or not the shoes caused a faster marathon time compare the factual and counterfactual outcomes, we see that wearing the HyperShoes caused Alex to finish .1 hours faster than Alex would have finished without wearing HyperShoes. 8 | -------------------------------------------------------------------------------- /thinkCausal/R/mod_settings_reference.R: -------------------------------------------------------------------------------- 1 | #' settings_reference UI Function 2 | #' 3 | #' @description A shiny Module. 4 | #' 5 | #' @param id,input,output,session Internal parameters for {shiny}. 6 | #' 7 | #' @noRd 8 | #' 9 | #' @importFrom shiny NS tagList 10 | mod_settings_reference_ui <- function(id){ 11 | ns <- NS(id) 12 | tagList( 13 | includeMarkdown(app_sys('app', 'www', 'md', 'reference.md')) 14 | ) 15 | } 16 | 17 | #' settings_reference Server Functions 18 | #' 19 | #' @noRd 20 | mod_settings_reference_server <- function(id){ 21 | moduleServer( id, function(input, output, session){ 22 | ns <- session$ns 23 | 24 | }) 25 | } 26 | 27 | ## To be copied in the UI 28 | # mod_settings_reference_ui("settings_reference_1") 29 | 30 | ## To be copied in the server 31 | # mod_settings_reference_server("settings_reference_1") 32 | -------------------------------------------------------------------------------- /.github/workflows/test-functions.yml: -------------------------------------------------------------------------------- 1 | name: test-functions 2 | 3 | on: 4 | push: 5 | branches: [main, master, dev, workflows] 6 | pull_request: 7 | branches: [main, master, dev, workflows] 8 | 9 | env: 10 | RENV_CONFIG_SANDBOX_ENABLED: False 11 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 12 | 13 | jobs: 14 | test-functions: 15 | timeout-minutes: 45 16 | runs-on: ubuntu-20.04 17 | steps: 18 | - uses: actions/checkout@v1 19 | - uses: r-lib/actions/setup-r@v2 20 | with: 21 | r-version: '4.2.0' 22 | - uses: priism-center/thinkCausal_dev/.github/setup-renv@master 23 | env: 24 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 25 | - name: Run tests 26 | shell: Rscript {0} 27 | run: print(getwd()); testthat::test_local(); 28 | working-directory: thinkCausal 29 | 30 | -------------------------------------------------------------------------------- /thinkCausal/inst/app/www/learn/confounder/markdowns/scratch.md: -------------------------------------------------------------------------------- 1 | 2 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | --------------------------------------------------------------------------------