dot-stratify.calculate: Internal function that performs the actual stratification...

.stratify.calculateR Documentation

Internal function that performs the actual stratification calculations for stratify()

Description

Intended only to be called within stratify_guided and stratify_unguided, not as a standalone function

Usage

.stratify.calculate(data, n_strata, variables, idvar, verbose)

Arguments

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.

Details

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.

Value

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."


NUstat/generalizeR documentation built on Feb. 7, 2024, 6:39 p.m.