Function for reclassification table and statistics.

Description

The function creates a reclassification table and provides statistics.

Usage

1
reclassification(data, cOutcome, predrisk1, predrisk2, cutoff)

Arguments

data

Data frame or matrix that includes the outcome and predictors variables.

cOutcome

Column number of the outcome variable.

predrisk1

Vector of predicted risks of all individuals using initial model.

predrisk2

Vector of predicted risks of all individuals using updated model.

cutoff

Cutoff values for risk categories. Define the cut-off values as c(0,...,1). Multiple values can be defined and always specify 0 and 1. Example: c(0,.20,.30,1)

Details

The function creates a reclassification table and computes the categorical and continuous net reclassification improvement (NRI) and integrated discrimination improvement (IDI). A reclassification table indicates the number of individuals who move to another risk category or remain in the same risk category as a result of updating the risk model. Categorical NRI equal to x% means that compared with individuals without outcome, individuals with outcome were almost x% more likely to move up a category than down. The function also computes continuous NRI, which does not require any discrete risk categories and relies on the proportions of individuals with outcome correctly assigned a higher probability and individuals without outcome correctly assigned a lower probability by an updated model compared with the initial model. IDI equal to x% means that the difference in average predicted risks between the individuals with and without the outcome increased by x% in the updated model. The function requires predicted risks estimated by using two separate risk models. Predicted risks can be obtained using the functions fitLogRegModel and predRisk or be imported from other methods or packages.

Value

The function returns the reclassification table, separately for individuals with and without the outcome of interest and the following measures:

NRI (Categorical)

Categorical Net Reclassification Improvement with 95% CI and p-value of the test

NRI (Continuous)

Continuous Net Reclassification Improvement with 95% CI and p-value of the test

IDI

Integrated Discrimination Improvement with 95% CI and p-value of the test

References

Cook NR. Use and misuse of the receiver operating characteristic curve in risk prediction. Circulation 2007;115(7):928-935.

Pencina MJ, D'Agostino RB Sr, D'Agostino RB Jr, Vasan RS. Evaluating the added predictive ability of a new marker: from area under the ROC curve to reclassification and beyond. Stat Med 2008;27(2):157-172; discussion 207-212.

See Also

plotDiscriminationBox, predRisk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# specify dataset with outcome and predictor variables 
data(ExampleData)
# specify column number of the outcome variable
cOutcome <- 2

# fit logistic regression models
# all steps needed to construct a logistic regression model are written in a function
# called 'ExampleModels', which is described on page 4-5
riskmodel1 <- ExampleModels()$riskModel1
riskmodel2 <- ExampleModels()$riskModel2

# obtain predicted risks
predRisk1 <- predRisk(riskmodel1)
predRisk2 <- predRisk(riskmodel2)
# specify cutoff values for risk categories
cutoff <- c(0,.10,.30,1)    

# compute reclassification measures
reclassification(data=ExampleData, cOutcome=cOutcome, 
predrisk1=predRisk1, predrisk2=predRisk2, cutoff)