Skip to content

rbw

Residual Balancing Weights for Marginal Structural Models

v0.3.2 · Mar 1, 2022 · GPL (>= 3)

Description

Residual balancing is a robust method of constructing weights for marginal structural models, which can be used to estimate (a) the average treatment effect in a cross-sectional observational study, (b) controlled direct/mediator effects in causal mediation analysis, and (c) the effects of time-varying treatments in panel data (Zhou and Wodtke 2020 <doi:10.1017/pan.2020.2>). This package provides three functions, rbwPoint(), rbwMed(), and rbwPanel(), that produce residual balancing weights for estimating (a), (b), (c), respectively.

Downloads

CRAN

321

Last 30 days

14118th

710

Last 90 days

2.7K

Last year

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

r2u CRAN

2

Last 30 days

26

Last 90 days

100

Last year

Trend: -77.8% (30d vs prior 30d)

autoCRAN

3

Last 7 days

13

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

2 NOTE
11 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang NOTE
r-devel-linux-x86_64-debian-gcc NOTE
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc 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 details (2 non-OK)
NOTE r-devel-linux-x86_64-debian-clang

CRAN incoming feasibility

Maintainer: ‘Xiang Zhou <xiang_zhou@fas.harvard.edu>’

The BugReports field in DESCRIPTION has
  https://github.com/xiangzhou09/rbw
which should likely be
  https://github.com/xiangzhou09/rbw/issues
instead.
NOTE r-devel-linux-x86_64-debian-gcc

CRAN incoming feasibility

Maintainer: ‘Xiang Zhou <xiang_zhou@fas.harvard.edu>’

The BugReports field in DESCRIPTION has
  https://github.com/xiangzhou09/rbw
which should likely be
  https://github.com/xiangzhou09/rbw/issues
instead.

Check History

NOTE 12 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
NOTE r-devel-linux-x86_64-debian-clang

CRAN incoming feasibility

Maintainer: ‘Xiang Zhou <xiang_zhou@fas.harvard.edu>’

The BugReports field in DESCRIPTION has
  https://github.com/xiangzhou09/rbw
which should likely be
  https://github.com/xiangzhou09/rbw/issues
instead.
NOTE r-devel-linux-x86_64-debian-gcc

CRAN incoming feasibility

Maintainer: ‘Xiang Zhou <xiang_zhou@fas.harvard.edu>’

The BugReports field in DESCRIPTION has
  https://github.com/xiangzhou09/rbw
which should likely be
  https://github.com/xiangzhou09/rbw/issues
instead.

Code

Structure

Lines of code

1,378

Files

36

Compiled share

0%

Has compiled src

No

Language breakdown

R 746 (54.1%)Tests 154 (11.2%)Docs 470 (34.1%)Vignettes 8 (0.6%)

API

Exported functions

4

Internal functions

4

Recent export changes

v0.3.1+1 rbwPoint  −1 rbwATE
v0.3.0+1 rbwATE

Testing & CI

Has tests

Yes

Test-to-code ratio

0.21

testthat edition

3

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

0%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

Unsafe pattern score

0

Dep constraint coverage

66.7%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.5.0

System requirements

C++ standard

License

GPL (>= 3)

License flags

SPDX valid, OSI approved

History

Versions

4

First release

2020-04-15

Latest release

2022-03-01

Avg cadence

158 days

Cold removal rate

100%

Dep drift

1

LOC over versions

v0.2.0: 812 LOCv0.3.0: 1,148 LOCv0.3.1: 4,993 LOCv0.3.2: 1,378 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Dependency Network

Dependencies Reverse dependencies dplyr rlang rbw

Version History

5 tracked
new 0.3.2 Mar 10, 2026
updated 0.3.2 ← 0.3.1 diff Feb 28, 2022
updated 0.3.1 ← 0.3.0 diff Feb 27, 2022
updated 0.3.0 ← 0.2.0 diff Sep 22, 2021
new 0.2.0 Apr 14, 2020