Factor level response check This function checks that there are some non-zero counts in each level of each factor variable for consideration in a model
Source:R/functions.R
checkfactorlevelcounts.Rd
Factor level response check
This function checks that there are some non-zero counts in each level of each factor variable for consideration in a model
Arguments
- factorlist
Vector of factor variables specified in
model
. Specified so that a check can be made that there are non-zero counts in all levels of each factor.- data
Data frame containing columns of covariates listed in
factorlist
. Column names must match with names infactorlist
- response
A vector of response values
Examples
# load data
data(ns.data.re)
checkfactorlevelcounts(factorlist=c('floodebb', 'impact'), ns.data.re,
ns.data.re$birds)
#> [1] "floodebb will be fitted as a factor variable; there are non-zero counts for all levels"
#> [1] "impact will be fitted as a factor variable; there are non-zero counts for all levels"