This function performs k-fold cross-validation for model selection in the context of Generalized Estimating Equations (GEE). It is designed to evaluate the performance of different models specified by a range of lambda values, choosing the one that minimizes the cross-validation criterion.
CVfit(
formula,
id,
data,
family,
scale.fix,
scale.value,
fold,
lambda.vec,
pindex,
eps,
maxiter,
tol,
corstr = "independence",
ncore = 1
)
An object of class "CVfit"
, which is a list containing:
fold
The number of folds used in the cross-validation.
lam.vect
The vector of lambda values tested.
cv.vect
The cross-validation error for each lambda.
lam.opt
The lambda value that resulted in the minimum cross-validation error.
cv.min
The minimum cross-validation error.
call
The matched call.
an object of class "formula"
(or one that can be coerced to that class):
a symbolic description of the model to be fitted.
a vector which identifies the cluster/group for each observation.
an optional data frame containing the variables in the model.
a description of the error distribution and link function to be used in the model.
logical; if TRUE
, the scale parameter is fixed to scale.value
.
the value of the scale parameter when scale.fix
is TRUE
.
the number of folds to be used in the cross-validation.
a vector of lambda values for which the cross-validation error will be calculated.
an optional numeric vector specifying a parameter index.
the threshold for convergence criteria.
the maximum number of iterations for the convergence of the algorithm.
the tolerance level for the convergence of the algorithm.
the correlation structure used.
if greater than 1, the function will use parallel computation.
Note that this is a re-implemented version with parallel computing.