kfoldSSF: Cross-validation for regression models.Taken and modified...

View source: R/fcts RSF.R

kfoldSSFR Documentation

Cross-validation for regression models.Taken and modified slightly from hab package

Description

Note: needs complete names in the coxph/clogit call, and not 'cos(var)' or 'I(var*10)', except for 'strata()' and 'cluster()'.

Usage

kfoldSSF(
  mod,
  k = 5,
  nrepet = 100,
  jitter = TRUE,
  reproducible = TRUE,
  form_ls = ls,
  x = m,
  method = method,
  details = FALSE
)

Arguments

mod

A fitted model for which there exists a kfold method (currently coxph and clogit models).

k

The number of equal size subsamples of the partition.

nrepet

The number of repetitions.

jitter

Logical, whether to add some random noise to the predictions (useful when the model is fitted on categorical variables, which can produces error in the ranking process).

reproducible

Logical, whether to use a fixed seed for each repetition.

Value

A data frame with the correlations (cor) and the type of value (type).

Author(s)

Adapted from Mathieu Basille function in hab package


BastilleRousseau/IndRSA documentation built on July 1, 2024, 7:48 a.m.