Learn R Programming

survMisc (version 0.4.2)

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

Description

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 (not implemented)
var
Variable to test. Must be continuous (i.e. >2 unique values)
plot
If TRUE will plot cut points against the statistic $S$

Value

  • A data.frame with columns:
  • CPThe cut point. 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 $U$.

Details

The statistic is based on the score test from the Cox model. For a cut point $\mu$, of a predictor vector $G$ the data is split into two groups, those $\geq \mu$ and those $< \mu$. The log-rank statistic $U$ is calculated for each unique element $k$ in $G$: $$U_k = \sum_{i=1}^D ( e_i^+ - n_i^+ \frac{e_i}{n_i} )$$ Where $e_i^+$ and $n_i^+$ refer to the no. of events and no. at risk in those above the cutpoint. 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 |U_k|}{\sigma \sqrt{D-1}}$$ Under the null hypothesis that the chosen cut-point does not predict survival, the distribution of $Q$ had a limiting distibution of the supremum of the absolute value of a Brownian bridge, that is $$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