dot-stratify.unguided: Internal function that provides the unguided version of...

.stratify.unguidedR Documentation

Internal function that provides the unguided version of stratify(). Given the dataset of interest, the number of strata, covriates of interest, and an id variable, performs stratification

Description

Intended only to be called within stratify, not as a standalone function

Usage

.stratify.unguided(
  data,
  n_strata = NULL,
  variables = NULL,
  idvar = NULL,
  verbose = TRUE
)

Arguments

data

data.frame object containing the population data to be stratified (rows are observations).

n_strata

integer, a number of strata in which to divide to cluster population

variables

character, provide a character vector of the names of stratifying variables (from population data frame)

idvar

character, provide a character 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.