model_list_pca()
generates an exhaustive list of lme4 model formulas
from the individual level and context level principal components as well as
geographic unit variables to be iterated over in best subset selection with
principal components.
model_list_pca(y, L1.x, L2.x, L2.unit, L2.reg = NULL)
Returns a list with the number of elements k+1 where k is the number of context-level variables. Each element is of class formula. The first element is a model with context-level variables and the following models iteratively add the principal components as context-level variables.
Outcome variable. A character vector containing the column names of the outcome variable.
Individual-level covariates. A character vector containing the
column names of the individual-level variables in survey
and
census
used to predict outcome y
. Note that geographic unit
is specified in argument L2.unit
.
Context-level covariates. A character vector containing the
column names of the context-level variables in survey
and
census
used to predict outcome y
.
Geographic unit. A character scalar containing the column name
of the geographic unit in survey
and census
at which outcomes
should be aggregated.
Geographic region. A character scalar containing the column
name of the geographic region in survey
and census
by which
geographic units are grouped (L2.unit
must be nested within
L2.reg
). Default is NULL
.