Learn R Programming

survMisc (version 0.4.4)

cutp: Cutpoint for a continuous variable in a coxph or survfit model

Description

Determine the optimal cutpoint for a continuous variable in a coxph or survfit model

Usage

cutp(x, ...)

## S3 method for class 'coxph': cutp(x, ..., var = "", plot = FALSE)

## S3 method for class 'survfit': cutp(x, ..., var = "", plot = FALSE)

Arguments

x
A survfit or coxph object
...
Additional arguments. Passed to graphics::plot.
var
Variable to test. Must be continuous (i.e. $>2$ unique values)
plot
If plot=TRUE will plot cut points against the test statistic $Q$.

Value

  • A data.frame with columns:
  • cpThe cut point. The optimum value at which to divide the groups into those $\geq$ the cutpoint and those below.
  • QThe test statistic
  • pp-value
  • If plot=TRUE a plot of cut points against values of the log-rank test statistic $LR$.

Details

The statistic is based on the score test from the Cox model. For the cut point $\mu$, of a predictor $K$, the data is split into two groups, those $\geq \mu$ and those $< \mu$. The log-rank statistic $LR$ is calculated for each unique element $k$ in $K$: $$LR_k = \sum_{i=1}^D ( e_i^+ - n_i^+ \frac{e_i}{n_i} )$$ Where $e_i^+$ and $n_i^+$ refer to the number of events and number at risk in those above the cutpoint, respectively. The sum is taken to across distinct times with observed events, to $D$, the largest of these. It is normalized (standardized), in the case of censoring, by finding $\sigma^2$ which is: $$\sigma^2 = \frac{1}{D-1} \sum_i^D ( 1 - \sum_{j=1}^i \frac{1}{D+1-j} )^2$$ The test statistic is then $$Q = \frac{\max |LR_k|}{\sigma \sqrt{D-1}}$$ Under the null hypothesis that the chosen cut-point does not predict survival, the distribution of $Q$ has a limiting distibution which is the supremum of the absolute value of a Brownian bridge: $$p= Pr ( \sup Q \geq q ) = 2 \sum_{i=1}^{\infty} (-1)^{i+1} \exp (-2 i^2 q^2)$$

References

Examples are from Klein J, Moeschberger M 2003 Survival Analysis, 2nd edition. New York: Springer. Example 8.3, pp 273-274.

Contal C, O'Quigley J, 1999 An application of changepoint methods in studying the effect of age on survival in breast cancer. Computational Statistics & Data Analysis 30(3):253--70. http://www.sciencedirect.com/science/article/pii/S0167947398000966{ScienceDirect}

Examples

Run this code
data(kidtran, package="KMsurv")
k1 <- kidtran
k2 <- k1[k1$gender==1 & k1$race==2, ]
c1 <- coxph(Surv(time, delta) ~ age, data = k2)
cutp(c1, var="age", plot=TRUE)
k2 <- k1[k1$gender==2 & k1$race==2, ]
c1 <- coxph(Surv(time, delta) ~ age, data = k2)
cutp(c1, var="age")

Run the code above in your browser using DataLab