glmm
is used to fit a single generalized mixed model via Monte Carlo
Expectation Conditional Minimization (MCECM). Unlike glmmPen
, no model selection
is performed.
glmm(
formula,
data = NULL,
family = "binomial",
covar = NULL,
offset = NULL,
optim_options = optimControl(),
adapt_RW_options = adaptControl(),
trace = 0,
tuning_options = lambdaControl(),
progress = TRUE,
...
)
A reference class object of class pglmmObj
for which many methods are
available (e.g. methods(class = "pglmmObj")
)
a two-sided linear formula object describing both the fixed effects and
random effects part of the model, with the response on the left of a ~ operator and the terms,
separated by + operators, on the right. Random-effects terms are distinguished by vertical bars
("|") separating expression for design matrices from the grouping factor. formula
should be
of the same format needed for glmer
in package lme4.
Only one grouping factor
will be recognized. The random effects covariates need to be a subset of the fixed effects covariates.
The offset must be specified outside of the formula in the 'offset' argument.
an optional data frame containing the variables named in formula
. If data
is
omitted, variables will be taken from the environment of formula
.
a description of the error distribution and link function to be used in the model.
Currently, the glmmPen
algorithm allows the Binomial ("binomial" or binomial()),
Gaussian ("gaussian" or gaussian()), and Poisson ("poisson" or poisson()) families
with canonical links only. See phmmPen
for variable selection within
proportional hazards mixed models for survival data.
character string specifying whether the covariance matrix should be unstructured
("unstructured") or diagonal with no covariances between variables ("independent").
Default is set to NULL
. If covar
is set to NULL
and the number of random effects
predictors (not including the intercept) is
greater than or equal to 10 (i.e. high dimensional), then the algorithm automatically assumes an
independent covariance structure and covar
is set to "independent". Otherwise if covar
is set to NULL
and the number of random effects predictors is less than 10, then the
algorithm automatically assumes an unstructured covariance structure and covar
is set to "unstructured".
This can be used to specify an a priori known component to be included in the
linear predictor during fitting. Default set to NULL
(no offset). If the data
argument is not NULL
, this should be a numeric vector of length equal to the
number of cases (the length of the response vector).
If the data argument specifies a data.frame, the offset
argument should specify the name of a column in the data.frame.
a structure of class "optimControl" created
from function optimControl
that specifies several optimization parameters. See the
documentation for optimControl
for more details on defaults.
a list of class "adaptControl" from function adaptControl
containing the control parameters for the adaptive random walk Metropolis-within-Gibbs procedure.
Ignored if optimControl
parameter sampler
is set to "stan" (default) or "independence".
an integer specifying print output to include as function runs. Default value is 0. See Details for more information about output provided when trace = 0, 1, or 2.
a list of class "selectControl" or "lambdaControl" resulting from
selectControl
or lambdaControl
containing additional control parameters.
When function glmm
is used,the algorithm may be run using one specific set of
penalty parameters lambda0
and lambda1
by specifying such values in lambdaControl()
.
The default for glmm
is to run the model fit with no penalization (lambda0
= lambda1
= 0).
When function glmmPen
is run, tuning_options
is specified using selectControl()
.
See the lambdaControl
and selectControl
documentation for further details.
a logical value indicating if additional output should be given showing the
progress of the fit procedure. If TRUE
, such output includes iteration-level information
for the fit procedure (iteration number EM_iter,
number of MCMC samples nMC, average Euclidean distance between current coefficients and coefficients
from t--defined in optimControl
--iterations back EM_conv,
and number of non-zero fixed and random effects covariates
not including the intercept). Additionally, progress = TRUE
gives some other information regarding the progress of the variable selection
procedure, including the model selection criteria and log-likelihood estimates
for each model fit.
Default is TRUE
.
additional arguments that could be passed into glmmPen
. See glmmPen
for further details.
The glmm
function can be used to fit a single generalized mixed model.
While this approach is meant to be used in the case where the user knows which
covariates belong in the fixed and random effects and no penalization is required, one is
allowed to specify non-zero fixed and random effects penalties using lambdaControl
and the (...) arguments. The (...) allow for specification of penalty-related arguments; see
glmmPen
for details. For a high dimensional situation, the user may want to fit a
minimal penalty model using a small penalty for the fixed and random effects and save the posterior
samples from this minimal penalty model for use in any BIC-ICQ calculations during selection within glmmPen
.
Specifying a file name in the 'BICq_posterior' argument will save the posterior samples from the
glmm
model into a big.matrix with this file name, see the Details section of
glmmPen
for additional details.