CVfit {geeVerse}R Documentation

Cross-Validation for Generalized Estimating Equations (GEE)

Description

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.

Usage

CVfit(
  formula,
  id,
  data,
  family,
  scale.fix,
  scale.value,
  fold,
  lambda.vec,
  pindex,
  eps,
  maxiter,
  tol,
  corstr = "independence",
  ncore = 1
)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

id

a vector which identifies the cluster/group for each observation.

data

an optional data frame containing the variables in the model.

family

a description of the error distribution and link function to be used in the model.

scale.fix

logical; if TRUE, the scale parameter is fixed to scale.value.

scale.value

the value of the scale parameter when scale.fix is TRUE.

fold

the number of folds to be used in the cross-validation.

lambda.vec

a vector of lambda values for which the cross-validation error will be calculated.

pindex

an optional numeric vector specifying a parameter index.

eps

the threshold for convergence criteria.

maxiter

the maximum number of iterations for the convergence of the algorithm.

tol

the tolerance level for the convergence of the algorithm.

corstr

the correlation structure used.

ncore

if greater than 1, the function will use parallel computation.

Details

Note that this is a re-implemented version with parallel computing.

Value

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.


[Package geeVerse version 0.2.1 Index]