robin_ps {RobinCID} | R Documentation |
Post-Stratification Based Inference
Description
Provides robust inference via post stratification.
Usage
robin_ps(
data,
estimand = list(tx_colname = NULL, tx_to_compare = NULL),
design = list(randomization_var_colnames = NULL, randomization_table = NULL),
stratify_by = NULL,
outcome_model = list(formula = NULL, family = gaussian()),
contrast_specs = list(contrast = "difference", contrast_jac = NULL),
alpha = 0.05,
...
)
Arguments
data |
( |
estimand |
(
|
design |
(
|
stratify_by |
( |
outcome_model |
(
|
contrast_specs |
(
|
alpha |
( |
... |
Additional arguments passed to |
Details
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_ps(
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),
stratify_by = NULL,
outcome_model = list(formula = y ~ 1,
family = gaussian())
)