Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

tidymodelsによるtidyな生存時間解析 / Japan.R2024

tidymodelsによるtidyな生存時間解析 / Japan.R2024

2024年12月7日に行われた、Japan.R 2024での発表資料です。
https://japanr.connpass.com/event/334154/

森下光之助

December 07, 2024
Tweet

More Decks by 森下光之助

Other Decks in Programming

Transcript

  1. 𝑇 𝑇 0 𝑓(𝑡) 𝐹(𝑡) 𝑡 𝐹 𝑡 = Pr

    𝑇 ≤ 𝑡 = + ! " 𝑓 𝑢 𝑑𝑢 𝑡 100% 𝑆 𝑡 𝑆 𝑡 = Pr 𝑇 > 𝑡 = 1 − 𝐹 𝑡
  2. ℎ 𝑡 𝑡 Δ𝑡 Δ𝑡 ℎ 𝑡 = lim #"→!

    Pr 𝑡 < 𝑇 ≤ 𝑡 + Δ𝑡 ∣ 𝑇 > 𝑡 Δ𝑡 = lim #"→! Pr 𝑡 < 𝑇 ≤ 𝑡 + Δ𝑡, 𝑇 > 𝑡 Δ𝑡 × 1 Pr 𝑇 > 𝑡 = lim #"→! Pr 𝑡 < 𝑇 ≤ 𝑡 + Δ𝑡 Δ𝑡 × 1 Pr 𝑇 > 𝑡 = lim #"→! 𝐹 𝑡 + 𝛥𝑡 − 𝐹 𝑡 Δ𝑡 × 1 Pr 𝑇 > 𝑡 = 𝑓(𝑡) 𝑆 𝑡
  3. 𝑆′ 𝑡 = 𝑑 𝑑𝑡 1 − 𝐹(𝑡) = −𝑓

    𝑡 ℎ 𝑡 = 𝑓 𝑡 𝑆(𝑡) = − 𝑆% 𝑡 𝑆 𝑡 = − 𝑑 𝑑𝑡 log 𝑆 𝑡 𝑆 𝑡 = exp − + ! " ℎ 𝑢 𝑑𝑢 𝑓 𝑡 = ℎ(𝑡)𝑆 𝑡 = ℎ(𝑡) exp − + ! " ℎ 𝑢 𝑑𝑢
  4. l l l 𝜆 l ℎ 𝑡 = 𝜆 l

    𝑆 𝑡 = exp − * ! " 𝜆𝑑𝑢 = 𝑒#$" l 𝑓 𝑡 = ℎ 𝑡 𝑆 𝑡 = 𝜆𝑒#$"
  5. l l l l ℎ 𝑡 = 𝜙𝜆𝑡%#& l 𝑆

    𝑡 = exp − * ! " 𝜙𝜆𝑡%#&𝑑𝑢 = 𝑒#$"! l 𝑓 𝑡 = ℎ 𝑡 𝑆 𝑡 = 𝜙𝜆𝑡%#&𝑒#$"!
  6. ℎ 𝑡 = 𝜙𝜆𝑡!"# 𝑆 𝑡 = 𝑒"$%! • 𝜙

    < 1 • 𝜙 = 1 • 1 < 𝜙 < 2 • 𝜙 = 2 • 𝜙 > 2
  7. l 𝒙 l 蓄 𝜆 = 𝛼𝑒𝒙&𝜷 ℎ 𝒙 =

    𝛼𝑒𝒙&𝜷 = 𝛼𝑒(')*((()⋯)*)() l 𝑥, 1 ℎ 𝑥-, … , 𝑥, + 1, … , 𝑥. = 𝛼𝑒(')*((()⋯ **)- (*)⋯)*)() = 𝛼𝑒𝒙&𝜷 𝑒(* = ℎ 𝒙 𝑒(* 𝛽, 1 𝑒(*
  8. l l 𝑖 = 1, … , 𝑛 𝑑/ ∈

    0, 1 𝑡/ l 𝑡/ 𝑡" 𝑡# 𝑡$ 𝑡% 𝑑" = 1 𝑑# = 0 𝑑$ = 1 𝑑% = 0 機器1 機器2 機器3 機器4
  9. 𝐿 = O /0- 1 𝑓 𝑡/ 2+ Pr 𝑇

    > 𝑡/ -32+ = O /0- 1 𝑓 𝑡/ 2+𝑆 𝑡/ -32+ = O /0- 1 𝑓 𝑡/ 𝑆 𝑡/ 2+ 𝑆 𝑡/ = O /0- 1 ℎ 𝑡/ 2+𝑆 𝑡/ log 𝐿 = P /0- 1 𝑑/ log ℎ 𝑡/ + log 𝑆 𝑡/ log 𝐿 = P /0- 1 𝑑/ log 𝜆 − 𝜆𝑡/ ⾒ log 𝐿 = 0 ,-# . 𝑑, log 𝛼𝑒𝒙& '𝜷 − 𝛼𝑒𝒙& '𝜷 𝑡,
  10. l l brier_survival() l ROC-AUC roc_auc_survival() l Concordance index concordance_survival()

    l l 𝑠 𝑖 𝑤/4 𝑑/4 S 𝑆/ 𝑠 𝑠 BrierScore4 = 1 ∑/0- 1 𝑤/4 P /0- 1 𝑤/4 𝑑/4 − S 𝑆/ 𝑠 5
  11. • Dobson, Annette J., and Adrian G. Barnett. An introduction

    to generalized linear models. Chapman and Hall/CRC, 2018. • Allison, Paul D( ), ( ). . . 2021. • , . . . 2022-2023. 52 . 2 . p.69-112. • , , . R tidymodels[ ] . . 2023. • Fitting and Predicting with censored. https://censored.tidymodels.org/index.html • Dynamic Performance Metrics for Event Time Data. https://www.tidymodels.org/learn/statistics/survival-metrics/ • Accounting for Censoring in Performance Metrics for Event Time Data. https://www.tidymodels.org/learn/statistics/survival-metrics-details/ • How long until building complaints are dispositioned? A survival analysis case study. https://www.tidymodels.org/learn/statistics/survival-case-study/