.stratify.calculate | R Documentation |
stratify()
Intended only to be called within stratify_guided
and stratify_unguided
, not as a standalone function
.stratify.calculate(data, n_strata, variables, idvar, verbose)
data |
data.frame object containing the population data to be stratified (observations as rows); must include a unique id variable for each observation, as well as covariates. |
n_strata |
integer, number of strata in which to divide to cluster population |
variables |
character, character vector of the names of stratifying variables (from population data frame) |
idvar |
character, haracter vector of the name of the ID variable (from population data frame) |
verbose |
logical, defaults to TRUE. |
The list contains 14 components: idvar
, variables
, dataset
, n_strata
, solution
, pop_data_by_stratum
, summary_stats
, data_omitted
, cont_data_stats
, cat_data_levels
, heat_data
, heat_data_simple
, heat_data_kable
, and heat_plot
.
The function returns a list of class "generalizeR_stratify" that can be provided as input to recruit()
. More information on the components of this list can be found above under "Details."
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.