Package: WeightIt 1.7.0.9000

WeightIt: Weighting for Covariate Balance in Observational Studies

Generates balancing weights for causal effect estimation in observational studies with binary, multi-category, or continuous point or longitudinal treatments by easing and extending the functionality of several R packages and providing in-house estimation methods. Available methods include those that rely on parametric modeling, optimization, and machine learning. Also allows for assessment of weights and checking of covariate balance by interfacing directly with the 'cobalt' package. Methods for estimating weighted regression models that take into account uncertainty in the estimation of the weights via M-estimation or bootstrapping are available. See the vignette "Installing Supporting Packages" for instructions on how to install any optional package 'WeightIt' uses, including those that may not be on CRAN.

Authors:Noah Greifer [aut, cre]

WeightIt_1.7.0.9000.tar.gz
WeightIt_1.7.0.9000.zip(r-4.7)WeightIt_1.7.0.9000.zip(r-4.6)WeightIt_1.7.0.9000.zip(r-4.5)
WeightIt_1.7.0.9000.tgz(r-4.6-any)WeightIt_1.7.0.9000.tgz(r-4.5-any)
WeightIt_1.7.0.9000.tar.gz(r-4.7-any)WeightIt_1.7.0.9000.tar.gz(r-4.6-any)
WeightIt_1.7.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
WeightIt/json (API)

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

Bug tracker:https://github.com/ngreifer/weightit/issues

Pkgdown/docs site:https://ngreifer.github.io

Datasets:
  • msmdata - Simulated data for a 3 time point sequential study

On CRAN:

Conda:

causal-inferenceinverse-probability-weightsobservational-studypropensity-scores

12.07 score 131 stars 4 packages 834 scripts 10.0k downloads 4 mentions 17 exports 24 dependencies

Last updated from:cc361f9c6b. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK300
source / vignettesOK339
linux-release-x86_64OK261
macos-release-arm64OK149
macos-oldrel-arm64OK147
windows-develOK193
windows-releaseOK176
windows-oldrelOK199
wasm-releaseOK194

Exports:.weightit_methodsas.weightitas.weightitMSMcalibratecoxph_weightitESSget_w_from_psglm_weightitlm_weightitmake_full_rankmultinom_weightitordinal_weightitsbpstrimweightitweightit.fitweightitMSM

Dependencies:argclicobaltcpp11farvergenericsggplot2gluegridExtragtableisobandlabelinglatticelifecycleR6RColorBrewerrlangS7sandwichscalesvctrsviridisLitewithrzoo

Estimating Effects After Weighting
Introduction | Identifying the estimand | G-computation | Modeling the Outcome | Estimating Standard Errors and Confidence Intervals | Asymptotically Correct Standard Errors Using M-estimation | Robust Standard Errors | Bootstrapping | Estimating Treatment Effects and Standard Errors After Weighting | The Standard Case: Binary Treatment with Asymptotically Correct SEs | Adjustments to the Standard Case | Weighting for the ATT or ATC | Weighting for estimands other than the ATT, ATC, or ATE | Binary, count, and categorical outcomes | Survival outcomes | Using sampling weights and/or clustered data | Multi-Category Treatments | Continuous Treatments | Longitudinal Treatments | Moderation Analysis | Reporting Results | References | Code to Generate Data used in Examples

Last update: 2026-04-08
Started: 2023-04-10

Using WeightIt to Estimate Balancing Weights
Introduction | Balancing Weights for a Point Treatment | Balancing Weights for a Longitudinal Treatment | References

Last update: 2025-11-15
Started: 2020-08-20

Installing Supporting Packages
Propensity score weighting using GLMs (method = "glm") | missing = "saem" | Binary and multi-category treatments with link = "br.logit" | Multi-category treatments with multi.method = "mclogit" | Multi-category treatments with multi.method = "mnp" | Propensity Score weighting using GBM (method = "gbm") | Covariate Balancing Propensity Score weighting (method = "cbps") | Nonparametric Covariate Balancing Propensity Score weighting (method = "npcbps") | Entropy balancing (method = "ebal") | Inverse probability tilting (method = "ipt") | Stable balancing weighting (method = "optweight") | Propensity score weighting using SuperLearner (method = "super") | Propensity score weighting using BART (method = "bart") | Energy Balancing (method = "energy")

Last update: 2025-09-16
Started: 2022-06-22

Readme and manuals

Help Manual

Help pageTopics
Weighting methods.weightit_methods
Methods for 'glm_weightit()' objectsanova.glm_weightit
Create a 'weightit' object manuallyas.weightit as.weightit.default as.weightit.weightit.fit as.weightitMSM as.weightitMSM.default
Calibrate Propensity Score Weightscalibrate calibrate.default calibrate.weightit
Fitting (Weighted) Cox Proportional Hazards Modelscoxph_weightit
Compute effective sample size of weighted sampleESS
Compute weights from propensity scoresget_w_from_ps
Fitting (Weighted) Generalized Linear Modelsglm_weightit lm_weightit
Methods for 'glm_weightit()' objectsestfun.glm_weightit glm_weightit-methods print.glm_weightit summary.coxph_weightit summary.glm_weightit summary.multinom_weightit summary.ordinal_weightit update.glm_weightit vcov.glm_weightit
Make a design matrix full rankmake_full_rank
Propensity Score Weighting Using BARTmethod_bart
Covariate Balancing Propensity Score Weightingmethod_cbps
Characteristic Function Distance Balancingmethod_cfd
Entropy Balancingmethod_ebal method_entropy
Energy Balancingmethod_energy
Propensity Score Weighting Using Generalized Boosted Modelsmethod_gbm
Propensity Score Weighting Using Generalized Linear Modelsmethod_glm
Inverse Probability Tiltingmethod_ipt
Nonparametric Covariate Balancing Propensity Score Weightingmethod_npcbps
Stable Balancing Weightsmethod_optweight method_sbw
Propensity Score Weighting Using SuperLearnermethod_super
User-Defined Functions for Estimating Weightsmethod_user
Simulated data for a 3 time point sequential studymsmdata
Fitting (Weighted) Multinomial Regression Modelsmultinom_weightit
Fitting (Weighted) Ordinal Regression Modelsordinal_weightit
Plot information about the weight estimation processplot.weightit
Predictions for 'glm_weightit' objectspredict.glm_weightit predict.multinom_weightit predict.ordinal_weightit
Subgroup Balancing Propensity Scoresbps
Print and Summarize Outputplot.summary.weightit plot.summary.weightitMSM summary.weightit summary.weightitMSM
Trim (Winsorize) Large Weightstrim trim.default trim.weightit
Estimate Balancing Weightsweightit
Generate Balancing Weights with Minimal Input Processingweightit.fit
Generate Balancing Weights for Longitudinal TreatmentsweightitMSM