GitHub install with remotes
remotes::install_github(
"Larsvanderlaan/ppi-aipw",
subdir = "r/ppiAIPW"
)
R Package
ppiAIPW takes labeled outcomes, labeled predictions,
and unlabeled predictions, and returns point estimates, standard
errors, confidence intervals, calibration diagnostics, and a
Wald causal wrapper.
Install
The R package lives in the repository subdirectory
r/ppiAIPW, so GitHub installs should target that
subdirectory explicitly.
remotesremotes::install_github(
"Larsvanderlaan/ppi-aipw",
subdir = "r/ppiAIPW"
)
pakpak::pak("Larsvanderlaan/ppi-aipw/r/ppiAIPW")
R CMD INSTALL r/ppiAIPW
Quickstart
mean_inference(...)
Use mean_inference(...) when you want the estimate,
standard error, confidence interval, fitted calibrator, and
diagnostics in one call.
All numeric inputs must be finite. The package rejects
NaN and Inf values in outcomes,
predictions, covariates, and weights with clear validation
errors.
library(ppiAIPW)
result = mean_inference(
Y,
Yhat,
Yhat_unlabeled,
method = "monotone_spline",
alpha = 0.1
)
estimate = result$pointestimate
standard_error = result$se
lower = result$ci[[1]]
upper = result$ci[[2]]
summary(result)
mean_pointestimate()Return only the point estimate when you do not need the full result object.
mean_se() and mean_ci()Pull out uncertainty summaries directly for scripting or reporting pipelines.
method="auto"Choose among "aipw", "linear", "monotone_spline", and "isotonic".
calibration_diagnostics()Optional honest out-of-fold calibration check from a result or fitted model.
causal_inference()Estimate arm means and control-vs-treatment ATEs from predicted potential outcomes.
compute_two_sample_balancing_weights()Construct nonnegative labeled-sample balancing weights.
Vignettes
These documents live in the package source and install with the package, so they can be opened locally after installation.
ppiAIPW-quickstart.Rmd
gives the main estimation workflow and core result-object usage.
ppiAIPW-causal.Rmd
shows arm means and ATEs from the causal wrapper.
ppiAIPW-diagnostics.Rmd
covers out-of-fold calibration summaries and plots.
Notes
The R package keeps the same core workflow as the Python package, with an R-native interface.
mean_inference(), mean_pointestimate(), mean_se(), mean_ci(), diagnostics, weights, and the causal wrapper are all available in R.
Functions return S3 objects with print(), summary(), and plot() methods.
The package lives in r/ppiAIPW, so GitHub installs should use the repository subdirectory.