| ipwplot | R Documentation |
Plots the distribution of inverse probability weights. Displays a density plot for point treatment weights or boxplots across follow-up intervals for time-varying weights.
ipwplot(
weights,
timevar = NULL,
binwidth = NULL,
logscale = TRUE,
xlab = NULL,
ylab = NULL,
main = "",
ref = TRUE,
...
)
weights |
Numerical vector of inverse probability weights. |
timevar |
Optional numerical vector of follow-up time. |
binwidth |
Interval width for grouping follow-up time when |
logscale |
Logical; if |
xlab |
Horizontal axis label. |
ylab |
Vertical axis label. |
main |
Main plot title. |
ref |
Logical; if |
... |
Additional graphical parameters passed to |
Willem M. van der Wal willem@vanderwalresearch.com, Ronald B. Geskus rgeskus@oucru.org
# Point treatment weights density plot
set.seed(123)
w_point <- runif(500, 0.5, 4)
ipwplot(weights = w_point, logscale = FALSE, main = "Density Plot of Point Treatment Weights")
# Time-varying weights boxplot across follow-up strata
w_tv <- runif(1100, 0.2, 5)
time_tv <- rep(seq(0, 500, by = 50), each = 100)
ipwplot(weights = w_tv, timevar = time_tv, binwidth = 50, main = "Time-Varying Weights Boxplot")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.