cv.pmcid {MCID} | R Documentation |
Selection of the tuning parameter for determining the MCID at the population level
Description
cv.pmcid
returns the optimal tuning parameter \delta
selected from a given grid by using k-fold cross-validation.
The tuning parameter is selected for determining the MCID at the population level
Usage
cv.pmcid(x, y, delseq, k = 5, maxit = 100, tol = 0.01)
Arguments
x |
a continuous variable denoting the outcome change of interest |
y |
a binary variable indicating the patient-reported outcome derived from the anchor question |
delseq |
a vector containing the candidate values for the tuning parameter |
k |
the number of groups into which the data should be split to select the tuning parameter |
maxit |
the maximum number of iterations. Defaults to 100 |
tol |
the convergence tolerance. Defaults to 0.01 |
Value
a list including the selected tuning parameter and the value of the corresponding target function
Examples
n <- 500
deltaseq <- seq(0.1, 1, 0.1)
a <- 0.2
b <- -0.1
p <- 0.5
set.seed(115)
y <- 2 * rbinom(n, 1, p) - 1
y_1 <- which(y == 1)
y_0 <- which(y == -1)
x <- c()
x[y_1] <- rnorm(length(y_1), a, 0.1)
x[y_0] <- rnorm(length(y_0), b, 0.1)
sel <- cv.pmcid(x = x, y = y, delseq = deltaseq, k = 5,
maxit = 100, tol = 1e-02)
sel$'Selected delta'
sel$'Function value'