robin_wt {RobinCID} | R Documentation |
Inverse Probability Weighting Based Inference
Description
Provides robust inference via inverse probability weighting.
Usage
robin_wt(
data,
estimand = list(tx_colname = NULL, tx_to_compare = NULL),
design = list(randomization_var_colnames = NULL, randomization_table = NULL),
estimated_propensity = TRUE,
outcome_model = list(formula = NULL, family = gaussian()),
contrast_specs = list(contrast = "difference", contrast_jac = NULL),
alpha = 0.05,
...
)
Arguments
data |
( |
estimand |
(
|
design |
(
|
estimated_propensity |
( |
outcome_model |
(
|
contrast_specs |
(
|
alpha |
( |
... |
Additional arguments passed to |
Details
If randomization_table
is provided, it must include columns corresponding to randomization_var_colnames
,
as well as treatment assignment probability columns named after the treatment levels in tx_colname
from data
.
If family
is MASS::negative.binomial(NA)
, the function will use MASS::glm.nb
instead of glm
.
Value
A treatment_effect object.
Examples
data_sim <- RobinCID::example
tx_colname <- "treatment"
treatment_levels <- unique(data_sim[[tx_colname]])
tx_to_compare <- c("trt.1", "trt.3")
randomization_var_colnames <- c("t", "subtype")
df <- data_sim[c("xb", "xc", tx_colname, randomization_var_colnames, "y")]
randomization_table <- unique(data_sim[c(randomization_var_colnames, treatment_levels)])
robin_wt(
data = df,
estimand = list(tx_colname = tx_colname,
tx_to_compare = tx_to_compare),
design = list(randomization_var_colnames = randomization_var_colnames,
randomization_table = randomization_table),
estimated_propensity = FALSE,
outcome_model = list(formula = y ~ 1,
family = gaussian())
)