Learn R Programming

jsmodule (version 1.5.7)

reclassificationJS: reclassificationJS: Function for reclassification table and statistics

Description

Modified function of PredictABEL::reclassification: return output table

Usage

reclassificationJS(
  data,
  cOutcome,
  predrisk1,
  predrisk2,
  cutoff,
  dec.value = 3,
  dec.p = 3
)

Value

Table including NRI(categorical), NRI(continuous), IDI with 95

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. Ex: c(0,.20,.30,1)

dec.value

digits of value, Default: 4

dec.p

digits of p, Default: 3

Details

Modified function of PredictABEL::reclassification

See Also

Examples

Run this code
m1 <- glm(vs ~ am + gear, data = mtcars, family = binomial)
m2 <- glm(vs ~ am + gear + wt, data = mtcars, family = binomial)
reclassificationJS(
  data = mtcars, cOutcome = 8,
  predrisk1 = predict(m1, type = "response"),
  predrisk2 = predict(m2, type = "response"), cutoff = c(0, .20, .40, 1)
)

Run the code above in your browser using DataLab