Skip to content

WhatIf

1.5-11

Software for Evaluating Counterfactuals

0packages depend
1.5Kdownloads / year
47.1%test coverage
12/13checks pass

Overview

About
Maintained by Katalina TothFirst published 2026-03-269 releasesCRAN page ↗GitHub ↗

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.

Install

Health

CRAN checks
1NOTE12OK
Failing flavors
  • NOTE r-devel-linux-x86_64-debian-gcc
Slowest check: 56 s · r-oldrel-windows-x86_64
Code health
Yes
Tests · ratio 0.14
47.1%
Coverage · measured lines
100%
Documentation · exports
3
Dependencies · direct
Check history
  • NOTE2026-08-01
    12 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • OK2026-04-25
    12 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • NOTE2026-03-27
    9 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • ERROR2026-03-26
    5 OK · 2 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE

Documentation

Documentation
READMENoVignettesNopkgdown siteNoNEWSYes · 100% structuredCode of conductNoContributing guideNo
Examples that run
100%
Documented parameters
100%
Return-value docs
100%
References docs
100%

Downloads

1.5K
CRAN downloads in the past year
Rank #11,688 · ~4/day · ~123/mo
Daily download trend is not available in this view yet.
23730 days
86790 days
1.5K1 year
Compare downloads with other packages →
Also on114 r2u40 c2d4u

Repository

Repository
18Stars
6Forks
4Open issues
0Open PRs
0Releases
60Commits
8Contributors
60 commits · Last activity 2023-05-17

Stars over time

2024-12-06 · 182026-07-07 · 18

Repository practices

Upstream repositoryBeta

3 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/iqss/whatif on 2026-07-31.

Continuous integration (2)
Travis CIAppVeyor
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v1 (2026-07-18)

Dependencies

Declared dependencies
3 external dependencies (excludes base and recommended)
Depends (1)
R >= 3.5.0
Imports (3)
LinkingTo (0)
none
Suggests (1)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Code & Tests

Datasets

People & History

People (7)
Maintainer (1)
Maintainer · added in 1.5-11
Authors (5)
Author · added in 1.5-8
Author
Author · added in 1.5-9
Contributors (1)
Contributor · added in 1.5-11
Package Timeline

9 releases. Pick two to compare their code metrics. R releases are shown for context.

  • R
    R 4.6.0 released · 2026-04-24
  • 1.5-11Latest
    2026-03-26 · current release · diff ↗
  • unarchivedReturned to CRAN
    2026-03-25
  • archivedRemoved from CRAN
    2025-12-22
    issues were not corrected despite reminders
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • 1.5-10
    2020-11-14 · diff ↗
  • unarchivedReturned to CRAN
    2020-11-14
  • R
    R 4.0.0 released · 2020-04-24
  • archivedRemoved from CRAN
    2020-03-07
    check problems were not corrected despite reminders
  • R
    R 3.6.0 released · 2019-04-26
  • R
    R 3.5.0 released · 2018-04-23
  • 1.5-9
    2017-07-25 · diff ↗
Show 25 earlier events
  • R
    R 3.4.0 released · 2017-04-21
  • 1.5-8
    2017-03-21 · diff ↗
  • R
    R 3.3.0 released · 2016-05-03
  • R
    R 3.2.0 released · 2015-04-16
  • R
    R 3.1.0 released · 2014-04-10
  • 1.5-6
    2014-01-08 · diff ↗
  • R
    R 3.0.0 released · 2013-04-03
  • R
    R 2.15.0 released · 2012-03-30
  • R
    R 2.14.0 released · 2011-10-31
  • R
    R 2.13.0 released · 2011-04-13
  • R
    R 2.12.0 released · 2010-10-15
  • R
    R 2.11.0 released · 2010-04-22
  • R
    R 2.10.0 released · 2009-10-26
  • R
    R 2.9.0 released · 2009-04-17
  • 1.5-5
    2009-03-08 · diff ↗
  • R
    R 2.8.0 released · 2008-10-20
  • R
    R 2.7.0 released · 2008-04-22
  • R
    R 2.6.0 released · 2007-10-03
  • 1.5-4
    2007-09-24 · diff ↗
  • R
    R 2.5.0 released · 2007-04-24
  • R
    R 2.4.0 released · 2006-10-03
  • 1.4-6
    2006-08-19 · diff ↗
  • R
    R 2.3.0 released · 2006-04-24
  • 1.3-4-3
    2005-10-31
  • R
    R 2.2.0 released · 2005-10-06

Package metadata

First published
2026-03-26
Total releases
9 / 1 yrs
License
GPL (>= 3) OSI
Minimum R
≥ 3.5.0
Bundled data
8.0 KB / 2 files
Download size
not tracked yet
Installed size
not tracked yet
With dependencies
not tracked yet
Appears in task views
Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy