naiveConcordance: Naive Concordance

Description Usage Arguments Value References Examples

View source: R/cr_naiveConcordance.R

Description

Used to calculate a concordance index error. The user needs to supply a list of mortalities, with each item in the list being a vector for the corresponding event. To calculate mortalities a user should look to extractMortalities.

Usage

1
naiveConcordance(responses, predictedMortalities)

Arguments

responses

A list of responses corresponding to the provided mortalities; use CR_Response.

predictedMortalities

A list of mortality vectors; each element of the list should correspond to one of the events in the order of event 1 to J, and should be a vector of the same length as responses.

Value

A vector of 1 minus the concordance scores, with each element corresponding to one of the events. To be clear, the lower the score the more accurate the model was.

References

Section 3.2 of Wolbers, Marcel, Paul Blanche, Michael T. Koller, Jacqueline C M Witteman, and Thomas A Gerds. 2014. “Concordance for Prognostic Models with Competing Risks.” Biostatistics 15 (3): 526–39. https://doi.org/10.1093/biostatistics/kxt059.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data <- data.frame(delta=c(1,1,0,0,2,2), T=1:6, x=1:6)

model <- train(CR_Response(delta, T) ~ x, data, ntree=100, numberOfSplits=0, mtry=1, nodeSize=1)

newData <- data.frame(delta=c(1,0,2,1,0,2), T=1:6, x=1:6)
predictions <- predict(model, newData)

mortalities <- list(
  extractMortalities(predictions, 1, 6),
  extractMortalities(predictions, 2, 6)
)

naiveConcordance(CR_Response(newData$delta, newData$T), mortalities)

jatherrien/largeRCRF documentation built on Nov. 15, 2019, 7:16 a.m.