strat {optrefine} | R Documentation |
Helper for object of class "strat"
Description
Creates an object of S3 class "strat"
Usage
strat(z, X, base_strata = NULL, refined_strata = NULL, details = NULL)
Arguments
z |
Vector of treatment assignment |
X |
Covariate matrix or data.frame |
base_strata |
Original strata, if they exist |
refined_strata |
Refined strata, if they exist |
details |
A list of details from the linear program. Include X_std if calculated |
Value
Object of class strat
if valid
Examples
# Don't need to include any stratification
strat_object <- strat(z = rhc_X[, "z"], X = rhc_X[, !(colnames(rhc_X) %in% "z")])
# Can include base and/or refined stratification if desired
strat_object <- strat(z = rhc_X[, "z"], X = rhc_X[, !(colnames(rhc_X) %in% "z")],
base_strata = rep(1, nrow(rhc_X)),
refined_strata = NULL)
[Package optrefine version 1.1.0 Index]