powered by
Form initial propensity score strata to be improved upon by refine().
refine()
prop_strat(z, X, nstrata = 5)
Object of class "strat", which is a list containing z, X with the propensity score as an additional column, base_strata
z
X
base_strata
(a factor of the resulting propensity score strata), and details, (a list containing X_std, which is the standardized version of the new X)
details
X_std
Vector of treatment assignment
Covariate matrix or data.frame
The number of strata to form
ps <- prop_strat(z = rhc_X[, "z"], X = rhc_X[, !(colnames(rhc_X) %in% c("pr", "z"))]) table(rhc_X[, "z"], ps$base_strata)
Run the code above in your browser using DataLab