Skip to content

WeightIt

Weighting for Covariate Balance in Observational Studies

v1.6.0 · Mar 19, 2026 · GPL (>= 2)

Description

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 package 'WeightIt' uses, including those that may not be on CRAN.

Downloads

9.3K

Last 30 days

1274th

26.8K

Last 90 days

101.6K

Last year

Trend: +6.3% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 26, 2026
ERROR 4 OK · 0 NOTE · 1 WARNING · 9 ERROR · 0 FAILURE Mar 10, 2026
ERROR r-devel-linux-x86_64-debian-clang

examples

Running examples in ‘WeightIt-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: method_energy
> ### Title: Energy Balancing
> ### Aliases: method_energy
> 
> ### ** Examples
> 
> ##
...[truncated]...
argument is deprecated.
ℹ Use `polishing` instead.
Error in eval(ei, envir) : 
  OSQP setup failed with error code 2: Solver settings validation.
Calls: withAutoprint ... <Anonymous> -> withVisible -> <Anonymous> -> osqp -> osqpSetup
Execution halted
ERROR r-devel-linux-x86_64-debian-gcc

examples

Running examples in ‘WeightIt-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: method_energy
> ### Title: Energy Balancing
> ### Aliases: method_energy
> 
> ### ** Examples
> 
> ##
...[truncated]...
argument is deprecated.
ℹ Use `polishing` instead.
Error in eval(ei, envir) : 
  OSQP setup failed with error code 2: Solver settings validation.
Calls: withAutoprint ... <Anonymous> -> withVisible -> <Anonymous> -> osqp -> osqpSetup
Execution halted
ERROR r-devel-linux-x86_64-fedora-clang

examples

Running examples in ‘WeightIt-Ex.R’ failed
The error most likely occurred in:

> ### Name: method_energy
> ### Title: Energy Balancing
> ### Aliases: method_energy
> 
> ### ** Examples
> 
> ## Don't show: 
> if (rlang::is_installed("osqp")) withAutop
...[truncated]...
argument is deprecated.
ℹ Use `polishing` instead.
Error in eval(ei, envir) : 
  OSQP setup failed with error code 2: Solver settings validation.
Calls: withAutoprint ... <Anonymous> -> withVisible -> <Anonymous> -> osqp -> osqpSetup
Execution halted
ERROR r-devel-linux-x86_64-fedora-gcc

examples

Running examples in ‘WeightIt-Ex.R’ failed
The error most likely occurred in:

> ### Name: method_energy
> ### Title: Energy Balancing
> ### Aliases: method_energy
> 
> ### ** Examples
> 
> ## Don't show: 
> if (rlang::is_installed("osqp")) withAutop
...[truncated]...
argument is deprecated.
ℹ Use `polishing` instead.
Error in eval(ei, envir) : 
  OSQP setup failed with error code 2: Solver settings validation.
Calls: withAutoprint ... <Anonymous> -> withVisible -> <Anonymous> -> osqp -> osqpSetup
Execution halted
ERROR r-devel-windows-x86_64

examples

Running examples in 'WeightIt-Ex.R' failed
The error most likely occurred in:

> ### Name: method_energy
> ### Title: Energy Balancing
> ### Aliases: method_energy
> 
> ### ** Examples
> 
> ## Don't show: 
> if (rlang::is_installed("osqp")) withAutop
...[truncated]...
argument is deprecated.
ℹ Use `polishing` instead.
Error in eval(ei, envir) : 
  OSQP setup failed with error code 2: Solver settings validation.
Calls: withAutoprint ... <Anonymous> -> withVisible -> <Anonymous> -> osqp -> osqpSetup
Execution halted
ERROR r-patched-linux-x86_64

examples

Running examples in ‘WeightIt-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: method_energy
> ### Title: Energy Balancing
> ### Aliases: method_energy
> 
> ### ** Examples
> 
> ##
...[truncated]...
 Solver settings validation.
Calls: withAutoprint ... <Anonymous> -> withVisible -> <Anonymous> -> osqp -> osqpSetup
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
           user system elapsed
calibrate 3.774  0.087   5.392
ERROR r-release-linux-x86_64

examples

Running examples in ‘WeightIt-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: method_energy
> ### Title: Energy Balancing
> ### Aliases: method_energy
> 
> ### ** Examples
> 
> ##
...[truncated]...
 Solver settings validation.
Calls: withAutoprint ... <Anonymous> -> withVisible -> <Anonymous> -> osqp -> osqpSetup
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
           user system elapsed
calibrate 3.761  0.085   5.074
ERROR r-release-windows-x86_64

examples

Running examples in 'WeightIt-Ex.R' failed
The error most likely occurred in:

> ### Name: method_energy
> ### Title: Energy Balancing
> ### Aliases: method_energy
> 
> ### ** Examples
> 
> ## Don't show: 
> if (rlang::is_installed("osqp")) withAutop
...[truncated]...
argument is deprecated.
ℹ Use `polishing` instead.
Error in eval(ei, envir) : 
  OSQP setup failed with error code 2: Solver settings validation.
Calls: withAutoprint ... <Anonymous> -> withVisible -> <Anonymous> -> osqp -> osqpSetup
Execution halted
WARNING r-oldrel-macos-arm64

PDF version of manual

LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
! Infinite glue shrinkage found in box being split.
<argument> Infinite shrink error above ignored ! 
                                                 
l.5017 }
ERROR r-oldrel-windows-x86_64

examples

Running examples in 'WeightIt-Ex.R' failed
The error most likely occurred in:

> ### Name: method_energy
> ### Title: Energy Balancing
> ### Aliases: method_energy
> 
> ### ** Examples
> 
> ## Don't show: 
> if (rlang::is_installed("osqp")) withAutop
...[truncated]...
argument is deprecated.
ℹ Use `polishing` instead.
Error in eval(ei, envir) : 
  OSQP setup failed with error code 2: Solver settings validation.
Calls: withAutoprint ... <Anonymous> -> withVisible -> <Anonymous> -> osqp -> osqpSetup
Execution halted

Reverse Dependencies (19)

Dependency Network

Dependencies Reverse dependencies cobalt ggplot2 cli rlang sandwich generics CIMTx MatchThem mvGPS senseweight DAGassist adjustedCurves adrftools clarify cobalt fullRankMatrix insight jointVIP lmw mccount optweight +4 more reverse deps WeightIt

Version History

updated 1.6.0 ← 1.5.1 diff Mar 19, 2026
new 1.5.1 Mar 10, 2026
updated 1.5.1 ← 1.5.0 diff Nov 14, 2025
updated 1.5.0 ← 1.4.0 diff Sep 17, 2025
updated 1.4.0 ← 1.3.2 diff Feb 23, 2025
updated 1.3.2 ← 1.3.1 diff Nov 4, 2024
updated 1.3.1 ← 1.3.0 diff Oct 3, 2024
updated 1.3.0 ← 1.2.0 diff Aug 23, 2024
updated 1.2.0 ← 1.1.0 diff Jul 26, 2024
updated 1.1.0 ← 1.0.0 diff May 3, 2024
updated 1.0.0 ← 0.14.2 diff Mar 22, 2024
updated 0.14.2 ← 0.14.1 diff May 22, 2023
updated 0.14.1 ← 0.14.0 diff May 9, 2023
updated 0.14.0 ← 0.13.1 diff Apr 11, 2023
updated 0.13.1 ← 0.12.0 diff Jun 27, 2022
updated 0.12.0 ← 0.11.0 diff Apr 2, 2021
updated 0.11.0 ← 0.10.2 diff Feb 1, 2021
updated 0.10.2 ← 0.10.1 diff Aug 26, 2020
updated 0.10.1 ← 0.10.0 diff Aug 11, 2020
updated 0.10.0 ← 0.9.0 diff Jul 6, 2020