WeightIt
Weighting for Covariate Balance in Observational Studies
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
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
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
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
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
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
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
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
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
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
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 }
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