glmmLasso()
predicts on newdata objects from a glmmLasso object.
predict_glmmLasso(census, m, L1.x, lasso.L2.x, L2.unit, L2.reg)
Returns a numeric vector of predictions from a glmmLasso()
object.
Census data. A data.frame
whose column names include
L1.x
, L2.x
, L2.unit
, if specified, L2.reg
and
pcs
, and either bin.proportion
or bin.size
.
A glmmLasso()
object.
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
.
Lasso context-level covariates. A character vector
containing the column names of the context-level variables in
survey
and census
to be used by the lasso classifier. If
NULL
and lasso
is set to TRUE
, then lasso uses the
variables specified in L2.x
. Default is NULL
.
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
.