cv.imcid {MCID}R Documentation

Selection of the tuning parameters for determining the MCID at the individual level

Description

cv.imcid returns the optimal tuning parameter \delta and \lambda selected from a given grid by using k-fold cross-validation. The tuning parameters are selected for determining the MCID at the individual level

Usage

cv.imcid(x, y, z, lamseq, delseq, k = 5, maxit = 100, tol = 0.01)

Arguments

x

a continuous variable denoting the outcome change of interest

y

a binary variable denoting the patient-reported outcome derived from the anchor question

z

a vector or matrix denoting the patient's clinical profiles

lamseq

a vector containing the candidate values for the tuning parameter \lambda, where \lambda is the coefficient of the penalty term, used for avoiding the issue of model overfitting

delseq

a vector containing the candidate values for the tuning parameter \delta, where \delta is used to control the difference between the 0-1 loss and the surrogate loss. We recommend selecting the possible values from the neighborhood of the standard deviation of x

k

the number of groups into which the data should be split to select the tuning parameter \delta by cross-validation. Defaults to 5

maxit

the maximum number of iterations. Defaults to 100

tol

the convergence tolerance. Defaults to 0.01

Value

a list including the combinations of the selected tuning parameters and the value of the corresponding target function

Examples


n <- 500
lambdaseq <- 10 ^ seq(-3, 3, 0.1)
deltaseq <- seq(0.1, 0.3, 0.1)
a <- 0.1
b <- 0.55
c <- -0.1
d <- 0.45

set.seed(721)
p <- 0.5
y <- 2 * rbinom(n, 1, p) - 1
z <- rnorm(n, 1, 0.1)
y_1 <- which(y == 1)
y_0 <- which(y == -1)
x <- c()
x[y_1] <- a + z[y_1] * b + rnorm(length(y_1), 0, 0.1)
x[y_0] <- c + z[y_0] * d + rnorm(length(y_0), 0, 0.1)

sel <- cv.imcid(x = x, y = y, z = z, lamseq = lambdaseq,
         delseq = deltaseq, k = 5, maxit = 100, tol = 1e-02)
sel$'Selected lambda'
sel$'Selected delta'



[Package MCID version 0.1.0 Index]