Locally Sparse Varying Coefficient Mixed Models
Usage
lsvcmm(
data,
response,
subject,
time,
vc_covariates = NULL,
nvc_covariates = NULL,
offset = NULL,
weight = NULL,
add_intercept = T,
estimated_time = NULL,
family = DEFAULT_FAMILY_ARGS,
kernel = DEFAULT_KERNEL_ARGS,
penalty = DEFAULT_PENALTY_ARGS,
working_covariance = DEFAULT_WORKING_COVARIANCE_ARGS,
control = DEFAULT_CONTROL_ARGS,
return_models = F
)
Arguments
- data
A data frame containing the variables in the model.
- response
The name of the response variable in
data
.- subject
The name of the subject variable in
data
.- time
The name of the time variable in
data
.- vc_covariates
The names of the varying coefficient covariates in
data
.- nvc_covariates
The names of the non-varying coefficient covariates in
data
.- offset
The name of the offset variable in
data
.- weight
The name of the weight variable in
data
.- add_intercept
Whether to add an intercept to the model.
- estimated_time
The time points at which to estimate the varying coefficients. If missing, all observed time points are used.
- family
A list of arguments for the response distribution. See
family_args
.- kernel
A list of arguments for the kernel. See
kernel_args
.- penalty
A list of arguments for the penalty. See
penalty_args
.- working_covariance
A list of arguments for the working covariance. See
working_covariance_args
.- control
A list of arguments for the control parameters. See
control_args
.- return_models
Whether to return the fitted models.
Value
A list containing the following elements:
- family
A list of arguments for the response distribution. See
family_args
.- kernel
A list of arguments for the kernel. See
kernel_args
.- penalty
A list of arguments for the penalty. See
penalty_args
.- working_covariance
A list of arguments for the working covariance. See
working_covariance_args
.- control
A list of arguments for the control parameters. See
control_args
.- results
A data frame containing the results of the optimization. Each row is a model resulting from a particular tuning parameter combination.
- nvc_path
A matrix containing the estimated non-varying coefficient path of dimension (
p_u
,n_models
).- vc_path
An array containing the estimated varying coefficient path of dimension (
p_x
,n_timepoints
,n_models
).- scaled_time
The time points at which the varying coefficients were estimated.
- unscaled_time
The corresponding values in the original scale.
- range_time
The range of the time points.
- models
A list of the fitted models.
Details
The lsvcmm
function fits a locally sparse varying coefficient mixed model (LSVCMM) to longitudinal data.
The LSVCMM is a semiparametric model for longitudinal data that allows the coefficients of the non-varying covariates to vary smoothly over time. The model is defined as $$Y_{ij} = \beta_0(t_{ij}) + \sum_{k=1}^p \beta_k(t_{ij}) X_{ijk} + \epsilon_{ij},$$ where \(Y_{ij}\) is the response of the \(i\)-th subject at time \(t_{ij}\), \(X_{ijk}\) is the \(k\)-th non-varying covariate of the \(i\)-th subject at time \(t_{ij}\), \(\beta_0(t)\) is the intercept function, \(\beta_k(t)\) is the coefficient function of the \(k\)-th non-varying covariate, and \(\epsilon_{ij}\) is the error term.