R Package

Native R package for semisupervised mean inference with AIPW and calibration.

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

Install the R package from GitHub or from a local checkout

The R package lives in the repository subdirectory r/ppiAIPW, so GitHub installs should target that subdirectory explicitly.

GitHub install with remotes

remotes::install_github(
  "Larsvanderlaan/ppi-aipw",
  subdir = "r/ppiAIPW"
)

GitHub install with pak

pak::pak("Larsvanderlaan/ppi-aipw/r/ppiAIPW")

Local source install

R CMD INSTALL r/ppiAIPW

Quickstart

Start with 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

Three starting points for R users

These documents live in the package source and install with the package, so they can be opened locally after installation.

Notes

R interface, same core workflow

The R package keeps the same core workflow as the Python package, with an R-native interface.

Core API

mean_inference(), mean_pointestimate(), mean_se(), mean_ci(), diagnostics, weights, and the causal wrapper are all available in R.

Result objects

Functions return S3 objects with print(), summary(), and plot() methods.

Install path

The package lives in r/ppiAIPW, so GitHub installs should use the repository subdirectory.