Learn R Programming

fastStat (version 1.4)

idi: Perform IDI for logistic and cox regression

Description

Easy to perform integrated discrimination improvement index (IDI) for logistic and cox regression.

Usage

idi(f1, f2, ...)

# S3 method for lrm idi(f1, f2, ...)

# S3 method for cph idi(f1, f2, timepoint = NULL, ...)

# S3 method for coxph idi(f1, f2, timepoint = NULL, ...)

Arguments

f1

base model

f2

the other model

...

ignore

timepoint

one time point for cox regression, default is median time.

Value

IDI results

Examples

Run this code
# NOT RUN {
library(rms)
# logistic

data(lung)

lung$status=lung$status-1
f1=lrm(status~age+sex,lung)
f2=lrm(status~age+sex+ph.ecog,lung)
idi(f1,f2)

# survival

head(lung)

range(lung$time)

lung=lung[complete.cases(lung),]

f1=cph(Surv(time,status)~age+sex,lung)
f2=cph(Surv(time,status)~age+sex+ph.ecog,lung)
idi(f1,f2)
# }

Run the code above in your browser using DataLab