Package: aihuman 1.0.1

aihuman: Experimental Evaluation of Algorithm-Assisted Human Decision-Making

Provides statistical methods for analyzing experimental evaluation of the causal impacts of algorithmic recommendations on human decisions developed by Imai, Jiang, Greiner, Halen, and Shin (2023) <doi:10.1093/jrsssa/qnad010> and Ben-Michael, Greiner, Huang, Imai, Jiang, and Shin (2024) <doi:10.48550/arXiv.2403.12108>. The data used for this paper, and made available here, are interim, based on only half of the observations in the study and (for those observations) only half of the study follow-up period. We use them only to illustrate methods, not to draw substantive conclusions.

Authors:Sooahn Shin [aut, cre], Zhichao Jiang [aut], Kosuke Imai [aut]

aihuman_1.0.1.tar.gz
aihuman_1.0.1.zip(r-4.7)aihuman_1.0.1.zip(r-4.6)aihuman_1.0.1.zip(r-4.5)
aihuman_1.0.1.tgz(r-4.6-x86_64)aihuman_1.0.1.tgz(r-4.6-arm64)aihuman_1.0.1.tgz(r-4.5-x86_64)aihuman_1.0.1.tgz(r-4.5-arm64)
aihuman_1.0.1.tar.gz(r-4.7-arm64)aihuman_1.0.1.tar.gz(r-4.7-x86_64)aihuman_1.0.1.tar.gz(r-4.6-arm64)aihuman_1.0.1.tar.gz(r-4.6-x86_64)
aihuman_1.0.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
aihuman/json (API)

# Install 'aihuman' in R:
install.packages('aihuman', repos = c('https://sooahnshin.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/sooahnshin/aihuman/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:
  • FTAdata - Interim Dane data with failure to appear (FTA) as an outcome
  • HearingDate - Interim court event hearing date
  • hearingdate_synth - Synthetic court event hearing date
  • NCAdata - Interim Dane data with new criminal activity (NCA) as an outcome
  • NVCAdata - Interim Dane data with new violent criminal activity (NVCA) as an outcome
  • psa_synth - Synthetic PSA data
  • PSAdata - Interim Dane PSA data
  • synth - Synthetic data

On CRAN:

Conda:

openblascppopenmp

4.48 score 2 stars 15 scripts 593 downloads 60 exports 71 dependencies

Last updated from:9d7857b120. Checks:13 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK209
linux-devel-x86_64OK217
source / vignettesOK325
linux-release-arm64OK215
linux-release-x86_64OK238
macos-release-arm64OK284
macos-release-x86_64OK347
macos-oldrel-arm64OK230
macos-oldrel-x86_64OK531
windows-develOK187
windows-releaseOK204
windows-oldrelOK186
wasm-releaseOK183

Exports:A_llamaAiEvalmcmcAPCEsummaryAPCEsummaryipwBootstrapAPCEipwBootstrapAPCEipwREBootstrapAPCEipwREparallelCalAPCECalAPCEipwCalAPCEipwRECalAPCEparallelCalDeltaCalDIMCalDIMsubgroupCalFairnessCalOptimalDecisionCalPScompute_bounds_aipwcompute_nuisance_functionscompute_nuisance_functions_aicompute_statscompute_stats_agreementcompute_stats_aipwcompute_stats_subgroupcrossfitg_legendnca_follow_policynca_follow_policy_decnca_provide_policynca_provide_policy_decnuis_funcnuis_func_aiplot_agreementplot_diff_ai_aipwplot_diff_humanplot_diff_human_aipwplot_diff_subgroupplot_preferencePlotAPCEPlotDIMdecisionsPlotDIMoutcomesPlotFairnessPlotOptimalDecisionPlotPSPlotSpilloverCRTPlotSpilloverCRTpowerPlotStackedBarPlotStackedBarDMFPlotUtilityDiffPlotUtilityDiffCISpilloverCRTSpilloverCRTpowertable_agreementTestMonotonicityTestMonotonicityREvis_agreementvis_diff_aivis_diff_humanvis_diff_subgroupvis_preference

Dependencies:abindbackportscachemcheckmateclassclassIntclicodacodetoolscpp11data.tableDBIdigestdoParalleldplyre1071farverfastmapforcatsforeachFormulaformula.toolsgbmgenericsggplot2GLMMadaptivegluegtableisobanditeratorsKernSmoothlabelinglatticelifecyclelubridatemagrittrMASSMatrixmatrixStatsmemoisemetRnlmeoperator.toolspillarpkgconfigplyrproxypurrrR6RColorBrewerRcppRcppArmadilloRcppEigenrlangs2S7scalessfstringistringrsurvivaltibbletidyrtidyselecttimechangeunitsutf8vctrsviridisLitewithrwk

Replication Codes for Does AI help humans make better decisions?
Overview | Data Preparation & Descriptive Analysis | Nuisance functions | Contingency table of human decisions and PSA recommendations | Agreement between human decisions and PSA recommendations | Human+AI v. Human comparison | How the human overrides the AI recommendation? | AI v. Human comparison | Alternative AI Recommendations | Different loss functions | Policy Learning | Helper functions | Whether to provide PSA | Whether to follow PSA

Last update: 2024-12-23
Started: 2024-12-05

Replication Codes for Experimental Evaluation of Algorithm-Assisted Human Decision-Making: Application to Pretrial Public Safety Assessment
Overview | Synthetic data | Data 1: synth | Data 2: psa_synth | Data 3: hearingdate_synth | Interim data | Descriptive statistics | Distribution of the judge's decisions (Figure 1) | Replication codes | Intention to treat effects of PSA Provision (Figure 2) | Main analysis: Average Principal Causal Effects (APCE) | AiEvalmcmc() | CalAPCE() or CalAPCEparallel() | APCEsummary() | PlotAPCE() (Figure 4) | Principal strata (Figure 3) | Principal fairness (Figure 5) | Optimal decision (Figure 6) | Comparison between the judge's decisions and DMF recommendations (Figure 7) | Test of spillover effects: Conditional Randomization Test (CRT) | Frequentist analysis | Sensitivity analysis

Last update: 2024-12-05
Started: 2023-02-25

Readme and manuals

Help Manual

Help pageTopics
Experimental Evaluation of Algorithm-Assisted Human Decision-Makingaihuman-package aihuman
Gibbs sampler for the main analysisAiEvalmcmc
Summary of APCEAPCEsummary
Summary of APCE for frequentist analysisAPCEsummaryipw
Bootstrap for estimating variance of APCEBootstrapAPCEipw
Bootstrap for estimating variance of APCE with random effectsBootstrapAPCEipwRE
Bootstrap for estimating variance of APCE with random effectsBootstrapAPCEipwREparallel
Calculate APCECalAPCE
Compute APCE using frequentist analysisCalAPCEipw
Compute APCE using frequentist analysis with random effectsCalAPCEipwRE
Calculate APCE using parallel computingCalAPCEparallel
Calculate the delta given the principal stratumCalDelta
Calculate diff-in-means estimatesCalDIM
Calculate diff-in-means estimatesCalDIMsubgroup
Calculate the principal fairnessCalFairness
Calculate optimal decision & utilityCalOptimalDecision
Calculate the proportion of principal strata (R)CalPS
Compute Risk (AI v. Human)compute_bounds_aipw
Fit outcome/decision and propensity score modelscompute_nuisance_functions
Fit outcome/decision and propensity score models conditioning on the AI recommendationcompute_nuisance_functions_ai
Compute Risk (Human+AI v. Human)compute_stats
Agreement of Human and AI Decision Makerscompute_stats_agreement
Compute Risk (Human+AI v. Human)compute_stats_aipw
Compute Risk (Human+AI v. Human) for a Subgroup Defined by AI Recommendationcompute_stats_subgroup
Crossfitting for nuisance functionscrossfit gbm
Interim Dane data with failure to appear (FTA) as an outcomeFTAdata
Pulling ggplot legendg_legend
Interim court event hearing dateHearingDate
Synthetic court event hearing datehearingdate_synth
Interim Dane data with new criminal activity (NCA) as an outcomeNCAdata
Interim Dane data with new violent criminal activity (NVCA) as an outcomeNVCAdata
Visualize Agreementplot_agreement
Visualize Difference in Risk (AI v. Human)plot_diff_ai_aipw
Visualize Difference in Risk (Human+AI v. Human)plot_diff_human
Visualize Difference in Risk (Human+AI v. Human)plot_diff_human_aipw
Visualize Difference in Risk (Human+AI v. Human) for a Subgroup Defined by AI Recommendationplot_diff_subgroup
Visualize Preferenceplot_preference
Plot APCEPlotAPCE
Plot diff-in-means estimatesPlotDIMdecisions
Plot diff-in-means estimatesPlotDIMoutcomes
Plot the principal fairnessPlotFairness
Plot optimal decisionPlotOptimalDecision
Plot the proportion of principal strata (R)PlotPS
Plot conditional randomization testPlotSpilloverCRT
Plot power analysis of conditional randomization testPlotSpilloverCRTpower
Stacked barplot for the distribution of the decision given psaPlotStackedBar
Stacked barplot for the distribution of the decision given DMF recommendationPlotStackedBarDMF
Plot utility differencePlotUtilityDiff
Plot utility difference with 95% confidence intervalPlotUtilityDiffCI
Synthetic PSA datapsa_synth
Interim Dane PSA dataPSAdata
Conduct conditional randomization testSpilloverCRT
Conduct power analysis of conditional randomization testSpilloverCRTpower
Synthetic datasynth
Table of Agreementtable_agreement
Test monotonicityTestMonotonicity
Test monotonicity with random effectsTestMonotonicityRE