Package: CausalState 0.10.2

CausalState: Causal Inference in a Longitudinal Transitioning State Environment

Implements Sequential Doubly Robust (SDR) and infinite-dimensional Targeted Maximum Likelihood (iTMLE) estimators for longitudinal modified treatment policies in settings with transitioning states, such as ICU, ward, or emergency department care episodes. Treatment is permitted in active states and becomes structurally inapplicable after a state transition (e.g. discharge or death). Supports asymmetric g- and Q-model regularisation, k-fold cross-fitting, and pluggable SuperLearner ensembles. Includes specialised SuperLearner wrappers (SL.tgt.* and SL.tmle_* families) for the iTMLE targeting step, which pass the logit offset as a covariate column to preserve correct subsetting during SuperLearner cross-validation. Methods based on Diaz et al. (2021) <doi:10.1080/01621459.2021.1955691> and Luedtke et al. (2017) <doi:10.48550/arXiv.1705.02459>.

Authors:Sebastiaan Blank [aut, cre, cph]

CausalState_0.10.2.tar.gz
CausalState_0.10.2.zip(r-4.7-any)CausalState_0.10.2.zip(r-4.6-any)CausalState_0.10.2.zip(r-4.5-any)
CausalState_0.10.2.tgz(r-4.6-any)CausalState_0.10.2.tgz(r-4.5-any)
CausalState_0.10.2.tar.gz(r-4.7-any)CausalState_0.10.2.tar.gz(r-4.6-any)
CausalState_0.10.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
CausalState/json (API)

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

Bug tracker:https://github.com/sebastiaan-blank/causalstate/issues

On CRAN:

Conda:

5.29 score 359 downloads 27 exports 52 dependencies

Last updated from:45ab7facea. Checks:7 WARNING, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develWARNING140
source / vignettesOK204
linux-releaseWARNING161
macos-releaseWARNING190
macos-oldrelWARNING142
windows-develWARNING129
windows-releaseWARNING140
windows-oldrelWARNING112
wasm-releaseOK101

Exports:absorb_rulebranch_cal_summarycontrastdensity_ratioitmlemethod.WB_drqregsdrsim_binsim_contsim_multisl_tmleSL.tgt.emptySL.tgt.glmSL.tgt.glmnetSL.tgt.interceptSL.tgt.xgboostSL.tmle_emptySL.tmle_glmSL.tmle_glmnet_enetSL.tmle_glmnet_lassoSL.tmle_glmnet_ridgeSL.tmle_interceptSL.tmle_xgb_d1SL.tmle_xgb_d3SL.tmle_xgb_d6weight_diagnostics

Dependencies:abindassertthatbitopscaToolsclicodetoolscpp11cvAUCdata.tabledigestdplyrforeachfuturefuture.applygamgenericsglmnetglobalsgluegplotsgtoolsiteratorsjsonliteKernSmoothlatticelifecyclelistenvmagrittrMatrixnnlsorigamiparallellypillarpkgconfigpurrrR6RcppRcppEigenrlangROCRshapestringistringrSuperLearnersurvivaltibbletidyrtidyselectutf8vctrswithrxgboost

Wu-Benkeser density-ratio metalearner
Overview | Standard approach: classify then convert | WB approach: combine in density-ratio space | Clipping in the WB pathway | Custom DR-returning wrappers (required) | When to prefer WB over NNLS | Full example | References

Last update: 2026-09-22
Started: 2026-07-20

Diagnostics workflow
Overview | 1. Density ratios: is the intervention supportable? | weight_diagnostics() | policy_change_summary | Picking a trim | 2. Q calibration: are the outcome models trustworthy? | branch_cal_summary() | Alternative: pure Q-view with qreg() | Tuning the targeting library (itmle() only) | 3. Final estimation | 4. Post-estimation sanity checks | diagnostics$recursion_diag | diagnostics$target_cal (iTMLE only) | diagnostics$sl_summary | ic_df | Workflow summary

Last update: 2026-08-02
Started: 2026-08-02

Getting started with CausalState
Overview | Data structure | Simulated example data | Step 1 — Define a policy | Step 2 — Density ratios | Weights, intervention windows, and trim | Using dr_sl = TRUE (Wu-Benkeser metalearner) | Step 3 — SDR estimator | Step 4 — Infinite-dimensional TMLE (iTMLE) | Step 5 — Q-recursion sensitivity check (qreg) | Diagnostics | SuperLearner weights — sl_summary | Per-fold summaries — fold_diag | Branch calibration — diagnostics$branch_cal (SDR / qreg) | Targeting diagnostics — target_diag, targeting_gap (iTMLE only) | Density-ratio ESS | Parallelism | References

Last update: 2026-07-24
Started: 2026-07-10