phmm_FA: Fit a Proportional Hazards Mixed Model via Monte Carlo...

View source: R/phmmPen.R

phmm_FAR Documentation

Fit a Proportional Hazards Mixed Model via Monte Carlo Expectation Conditional Minimization (MCECM) using a Piecewise Constant Hazard Mixed Model Approximation

Description

phmm_FA is used to fit a single piecewise constant hazard mixed model as an approximation to a proportional hazards mixed model via Monte Carlo Expectation Conditional Minimization (MCECM). This piecewise constant hazard mixed model uses a factor model decomposition of the random effects. No model selection is performed.

Usage

phmm_FA(
  formula,
  data = NULL,
  offset = NULL,
  r_estimation = rControl(),
  optim_options = optimControl(),
  adapt_RW_options = adaptControl(),
  trace = 0,
  tuning_options = lambdaControl(),
  survival_options = survivalControl(),
  progress = TRUE,
  ...
)

Arguments

formula

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. The response must be a Surv object (see Surv from the survival package). 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.

data

an optional data frame containing the variables named in formula. If data is omitted, variables will be taken from the environment of formula.

offset

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.

r_estimation

a list of class "rControl" from function rControl containing the control parameters for the estimation of the number of latent factors to use in the glmmPen_FA and glmm_FA estimation procedures.

optim_options

a structure of class "optimControl" created from function optimControl that specifies several optimization parameters. See the documentation for optimControl for more details on defaults.

adapt_RW_options

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".

trace

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.

tuning_options

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.

survival_options

a structure of class "survivalControl" created from function survivalControl that specifies several parameters needed to properly fit the input survival data using a piecewise constant hazard mixed model. See the documentation for survivalControl for more details on defaults.

progress

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 phmmPen_FA. See phmmPen_FA for further details.

Details

The phmm_FA function can be used to approximate a single proportional hazards mixed model using a piecewise constant hazard 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 phmmPen_FA for details. For a high dimensional situation, the user may want to fit a full model using a small penalty for the fixed and random effects and save the posterior draws from this full model for use in any BIC-ICQ calculations during selection within phmmPen_FA. Specifying a file name in the 'BICq_posterior' argument will save the posterior draws from the phmm_FA model into a big.matrix with this file name, see the Details section of phmmPen_FA for additional details.

Value

A reference class object of class pglmmObj for which many methods are available (e.g. methods(class = "pglmmObj"))


hheiling/glmmPen documentation built on Jan. 15, 2024, 11:47 p.m.