dot-n.strata.less.than.max: Internal function that ensures that the number of strata...

.n.strata.less.than.maxR Documentation

Internal function that ensures that the number of strata requested does not exceed the maximum possible (maximum n-2 where n is number of observations w/ no missing variables of interest)

Description

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

Usage

.n.strata.less.than.max(n_strata, data_interest, variables, idvar)

Arguments

n_strata

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

data_interest

data.frame, a data.frame object with the population of interest (rows are observations)

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)

Value

The function returns a boolean value indicating whether the number of observations with non-missing variables of interests exceeds 1 plus the number of strata requested


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