Package: WhatIf 1.5-10

Soubhik Barari

WhatIf: Software for Evaluating Counterfactuals

Inferences about counterfactuals are essential for prediction, answering what if questions, and estimating causal effects. However, when the counterfactuals posed are too far from the data at hand, conclusions drawn from well-specified statistical analyses become based largely on speculation hidden in convenient modeling assumptions that few would be willing to defend. Unfortunately, standard statistical approaches assume the veracity of the model rather than revealing the degree of model-dependence, which makes this problem hard to detect. WhatIf offers easy-to-apply methods to evaluate counterfactuals that do not require sensitivity testing over specified classes of models. If an analysis fails the tests offered here, then we know that substantive inferences will be sensitive to at least some modeling choices that are not based on empirical evidence, no matter what method of inference one chooses to use. WhatIf implements the methods for evaluating counterfactuals discussed in Gary King and Langche Zeng, 2006, "The Dangers of Extreme Counterfactuals," Political Analysis 14 (2) <doi:10.1093/pan/mpj004>; and Gary King and Langche Zeng, 2007, "When Can History Be Our Guide? The Pitfalls of Counterfactual Inference," International Studies Quarterly 51 (March) <doi:10.1111/j.1468-2478.2007.00445.x>.

Authors:Heather Stoll <[email protected]>, Gary King <[email protected]>, Langche Zeng <[email protected]>, Christopher Gandrud <[email protected]>, Ben Sabath

WhatIf_1.5-10.tar.gz
WhatIf_1.5-10.zip(r-4.5)WhatIf_1.5-10.zip(r-4.4)WhatIf_1.5-10.zip(r-4.3)
WhatIf_1.5-10.tgz(r-4.4-any)WhatIf_1.5-10.tgz(r-4.3-any)
WhatIf_1.5-10.tar.gz(r-4.5-noble)WhatIf_1.5-10.tar.gz(r-4.4-noble)
WhatIf_1.5-10.tgz(r-4.4-emscripten)WhatIf_1.5-10.tgz(r-4.3-emscripten)
WhatIf.pdf |WhatIf.html
WhatIf/json (API)
NEWS

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

Peer review:

Bug tracker:https://github.com/iqss/whatif/issues

Datasets:
  • peacecf - Counterfactual Replication Data from King and Zeng 2006b
  • peacef - Factual Replication Data from King and Zeng 2006b

On CRAN:

5.77 score 17 stars 14 scripts 241 downloads 17 mentions 1 exports 2 dependencies

Last updated 2 years agofrom:69e49a0bb3. Checks:OK: 1 WARNING: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 07 2024
R-4.5-winWARNINGNov 07 2024
R-4.5-linuxWARNINGNov 07 2024
R-4.4-winWARNINGNov 07 2024
R-4.4-macWARNINGNov 07 2024
R-4.3-winWARNINGNov 07 2024
R-4.3-macWARNINGNov 07 2024

Exports:whatif

Dependencies:lpSolvepbmcapply