catpredi.survival: Function to obtain optimal cut points to categorise a...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/catpredi.survival.R

Description

Returns an object with the optimal cut points to categorise a continuous predictor variable in a Cox proportional hazards regression model

Usage

1
2
3
catpredi.survival(formula, cat.var, cat.points = 1, data, 
method = c("addfor", "genetic"), conc.index = c("cindex", "cpe"),
range = NULL, correct.index = TRUE, control = controlcatpredi.survival(), ...)

Arguments

formula

An object of class formula giving the model to be fitted in addition to the continuous covariate is aimed to categorise. The response must be a survival object as returned by the Surv function. This argument allows the user to specify whether the continuous predictor should be categorised in a univariable context, or in presence of other covariates or cofounders, i.e in a multiple Cox proportional hazards regression model. For instance, Surv(SurvT,SurvS)~1 indicates that the categorisation should be done in a univariable setting.

cat.var

Name of the continuous variable to categorise.

cat.points

Number of cut points to look for.

data

Data frame containing all needed variables.

method

The algorithm selected to search for the optimal cut points. "addfor" if the AddFor algorithm is choosen and "genetic" otherwise.

conc.index

The concordance probability estimator selected for maximisation purposes. "cindex" if the c-index concordance probability is choosen and "cpe" otherwise. The c-index and CPE are estimated using the rms and CPE packages, respectively.

range

The range of the continuous variable in which to look for the cut points. By default NULL, i.e, all the range.

correct.index

A logical value. If TRUE the bias corrected concordance probability is estimated.

control

Output of the controlcatpredi.survival() function.

...

Further arguments for passing on to the function genoud of the package rgenoud.

Value

Returns an object of class "catpredi.survival" with the following components:

call

the matched call.

method

the algorithm selected in the call.

formula

an object of class formula giving the model to be fitted in addition to the continuous covariate is aimed to categorise.

cat.var

name of the continuous variable to categorise.

data

the data frame with the variables used in the call.

correct.index

The logical value used in the call.

results

a list with the estimated cut points, concordance probability and bias corrected concordance probability.

control

the control parameters used in the call.

When the c-index concordance probability is choosen, a list with the following components is obtained for each of the methods used in the call:

"cutpoints"

Estimated optimal cut points.

"Cindex"

Estimated c-index.

"Cindex.cor"

Estimated bias corrected c-index.

When the CPE concordance probability is choosen, a list with the following components is obtained for each of the methods used in the call:

"cutpoints"

Estimated optimal cut points.

"CPE"

Estimated CPE.

"CPE.cor"

Estimated bias corrected CPE.

Author(s)

Irantzu Barrio and Maria Xose Rodriguez-Alvarez

References

I Barrio, M.X Rodriguez-Alvarez, L Meira-Machado, C Esteban and I Arostegui (2017). Comparison of two discrimination indexes in the categorisation of continuous predictors in time-to-event studies. SORT, 41:73-92

M Gonen and G Heller (2005). Concordance probability and discriminatory power in proportional hazards regression. Biometrika, 92:965-970.

F Harrell (2001). Regression modeling strategies: with applications to linear models, logistic and ordinal regression, and survival analysis. Springer.

See Also

See Also controlcatpredi.survival, comp.cutpoints.survival, plot.catpredi.survival, catpredi.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(CatPredi)
library(survival)
set.seed(123)
#Simulate data
  n = 500
  tauc = 1
  X <- rnorm(n=n, mean=0, sd=2)
  SurvT <- exp(2*X + rweibull(n = n, shape=1, scale = 1))   + rnorm(n, mean=0, sd=0.25)
  # Censoring time
  CensTime <- runif(n=n, min=0, max=tauc)
  # Status
  SurvS <- as.numeric(SurvT <= CensTime)
  # Data frame
  dat <- data.frame(X = X, SurvT = pmin(SurvT, CensTime), SurvS = SurvS)
  
  # Select optimal cut points using the AddFor algorithm
  res <- catpredi.survival (formula= Surv(SurvT,SurvS)~1, cat.var="X", cat.points = 2,
   data = dat, method = "addfor", conc.index = "cindex", range = NULL, 
   correct.index = FALSE) 

CatPredi documentation built on Jan. 10, 2022, 5:07 p.m.