This shows you the differences between the selected revision and the current version of the page.

additional:chapter15 2019/05/03 08:36 | additional:chapter15 2019/05/03 08:50 current | ||
---|---|---|---|

Line 3: | Line 3: | ||

Gary Weissman posted an excellent illustration of how we may calculate the maximum Brier score, which we need for [[https://gweissman.github.io/post/evaluating-the-equivalence-of-different-formulations-of-the-scaled-brier-score/|the scaled Brier score]]. Three approaches were found to be equivalent, while the intuition for the maximum score may be best for the first formulation, as discussed at [[https://twitter.com/garyweissman/status/1121100599918039040||Twitter]]. | Gary Weissman posted an excellent illustration of how we may calculate the maximum Brier score, which we need for [[https://gweissman.github.io/post/evaluating-the-equivalence-of-different-formulations-of-the-scaled-brier-score/|the scaled Brier score]]. Three approaches were found to be equivalent, while the intuition for the maximum score may be best for the first formulation, as discussed at [[https://twitter.com/garyweissman/status/1121100599918039040||Twitter]]. | ||

- | ===== Code for scaled Brier score calculation ===== | + | ==== Code for scaled Brier score calculation ==== |

<code> | <code> | ||

+ | brier_score <- function(obs, pred) { mean((obs - pred)^2) } # obs: 0/1 outcome y; pred: predicted probability p̂ | ||

scaled_brier_score_1 <- function(obs, pred) { | scaled_brier_score_1 <- function(obs, pred) { | ||

- | 1 - (brier_score(obs, pred) / brier_score(obs, mean(obs))) } | + | 1 - (brier_score(obs, pred) / brier_score(obs, mean(obs))) } # mean(obs): ȳ |

scaled_brier_score_2 <- function(obs, pred) { | scaled_brier_score_2 <- function(obs, pred) { | ||

1 - (brier_score(obs, pred) / (mean(obs) * (1 - mean(obs)))) } | 1 - (brier_score(obs, pred) / (mean(obs) * (1 - mean(obs)))) } | ||

Line 14: | Line 15: | ||

+ | \\ | ||

===== Illustration of the Hosmer-Lemeshow goodness of fit test ===== | ===== Illustration of the Hosmer-Lemeshow goodness of fit test ===== | ||

{{additional:hl_test_illustration.jpg|Illustration of HL test}} | {{additional:hl_test_illustration.jpg|Illustration of HL test}} | ||

{{additional:table_15.extra_hl_test.pdf|Hosmer-Lemeshow test for calibration of the testicular cancer prediction model}} | {{additional:table_15.extra_hl_test.pdf|Hosmer-Lemeshow test for calibration of the testicular cancer prediction model}} | ||

- | ===== Code for HL test calculation ===== | + | ==== Code for HL test calculation ==== |

<code> | <code> | ||

# Jan 07, Ewout Steyerberg | # Jan 07, Ewout Steyerberg |