Learn R Programming

MCID

‘MCID’ is an R package used to provide the point and interval estimation on the minimal clinically important difference (MCID) at the population and individual level. For population level, it produces a constant value for the estimation of MCID. For individual level, the MCID is defined as a linear function of patient’s clinical characteristics, and the estimated linear coefficients can be obtained.

Installation

You can install the released version of MCID from GitHub with:

# install.packages("devtools")
devtools::install_github("zzhou0721/MCID")

Example

Generate data

rm(list = ls())
library(MCID)
#> Welcome to MCID package
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(115)
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)

Determine MCID at the population level

To determine MCID at the populaton level, we first need to select an optimal value for the tuning parameter δ, which is used to control the difference between 0-1 loss and surrogate loss.

sel <- cv.pmcid(x = x, y = y, delseq = deltaseq, 
                k = 5, maxit = 100, tol = 1e-02)
delsel <- sel$'Selected delta'
delsel
#> [1] 0.1

Then with selected optimal value of δ, we can determine the point and interval estimation of MCID at the population level. The confidence interval is constructed based on the asymptotic normality. In our simulated data, the true population MCID is 0.5.

result <- pmcid(x = x, y = y, n = n, delta = delsel, 
                maxit = 100, tol = 1e-02, alpha = 0.05)
result$'Point estimate'
#> [1] 0.4961217
result$'Standard error'
#> [1] 0.0101217
result$'Confidence interval'
#> [1] 0.4762836 0.5159599

Determine MCID at the individual level

To determine MCID at the individual level, we first need to select a combination of the optimal values for the tuning parameters δ and λ. δ is used to control the difference between 0-1 loss and surrogate loss. λ is the coefficient of the penalty term used to avoid the overfitting issue.

sel <- cv.imcid(x = x, y = y, z = z, lamseq = lambdaseq, 
                delseq = deltaseq, k = 5, maxit = 100, tol = 1e-02)
lamsel <- sel$'Selected lambda'
delsel <- sel$'Selected delta'
lamsel
#> [1] 0.004496472
delsel
#> [1] 0.2

Then with selected δ and λ, we can determine the point and interval estimation for the linear coefficients of the individualized MCID function. The confidence intervals are constructed based on the asymptotic normalities. In our simulated data, the true linear coefficients of the individualized MCID are β0 = 0 and β1 = 0.5

result <- imcid(x = x, y = y, z = z, n = n, lambda = lamsel, 
                delta = delsel, maxit = 100, tol = 1e-02, alpha = 0.05)
result$'Point estimates'
#>              [,1]
#> beta0 -0.01551779
#> beta1  0.51193914
result$'Standard errors'
#>            [,1]
#> beta0 0.1292652
#> beta1 0.1227669
result$'Confidence intervals'
#>       Lower bound Upper bound
#> beta0  -0.2688728   0.2378373
#> beta1   0.2713205   0.7525577

Copy Link

Version

Install

install.packages('MCID')

Monthly Downloads

202

Version

0.1.0

License

GPL (>= 2)

Maintainer

Zehua Zhou

Last Published

September 10th, 2021

Functions in MCID (0.1.0)

pmcid.ramp.smooth

The value function needed to be optimized for determining the population MCID
pmcidcv.smooth

The function used to determine the value of target function for different value of delta in the population MCID setting
pmcid

Point and interval estimation for the MCID at the population level
pmcid.hinge.smooth

The value function used to search the initial value for determining the population MCID
imcid.hinge.smooth

The value function used to search the initial value for determining the individualized MCID
h.pfun

The hassen matrix function for determining the population MCID
cv.imcid

Selection of the tuning parameters for determining the MCID at the individual level
h.ifun

The hassen matrix function for determining the individualized MCID
g.ifun

The square of the score function for determining the individualized MCID
g.pfun

The square of the score function for determining the population MCID
imcid

Point and interval estimation for the MCID at the individual level
imcid.ramp.smooth

The value function needed to be optimized for determining the individualized MCID
cv.pmcid

Selection of the tuning parameter for determining the MCID at the population level
imcidcv.smooth

The function used to determine the value of target function for different value of delta in the individualized MCID setting