1 - Introduction

Survival analysis with tidymodels

Welcome!

Workshop policies

Who are you?

  • You can use the magrittr %>% or base R |> pipe

  • You are familiar with functions from dplyr, tidyr, ggplot2

  • You have exposure to basic concepts of survival analysis

  • You are familiar with the basic predictive modeling workflow

  • You do not need intermediate or expert familiarity with modeling or ML

Who are tidymodels?

  • Simon Couch
  • Hannah Frick
  • Emil Hvitfeldt
  • Max Kuhn

Many thanks to Davis Vaughan, Julia Silge, David Robinson, Julie Jung, Alison Hill, and DesirΓ©e De Leon for their role in creating these materials!

πŸ‘€

Plan for this workshop

  • Your data budget
  • What makes a model
  • Evaluating models
  • Tuning models

What is tidymodels?

library(tidymodels)
#> ── Attaching packages ──────────────────────────── tidymodels 1.3.0 ──
#> βœ” broom        1.0.8     βœ” rsample      1.3.0
#> βœ” dials        1.4.0     βœ” tibble       3.2.1
#> βœ” dplyr        1.1.4     βœ” tidyr        1.3.1
#> βœ” infer        1.0.8     βœ” tune         1.3.0
#> βœ” modeldata    1.4.0     βœ” workflows    1.2.0
#> βœ” parsnip      1.3.2     βœ” workflowsets 1.1.0
#> βœ” purrr        1.0.4     βœ” yardstick    1.3.2
#> βœ” recipes      1.3.1
#> ── Conflicts ─────────────────────────────── tidymodels_conflicts() ──
#> βœ– purrr::discard() masks scales::discard()
#> βœ– dplyr::filter()  masks stats::filter()
#> βœ– dplyr::lag()     masks stats::lag()
#> βœ– recipes::step()  masks stats::step()

The whole game

  • Roadmap for today
  • Minimal version of predictive modeling process
  • Feature engineering and tuning as iterative extensions

The whole game

The whole game

The whole game

The whole game

The whole game

The whole game

The whole game

Let’s install some packages


# Install the packages for the workshop
pkgs <- c("aorsf", "censored", "glmnet", "partykit", "pec", "rpart", "tidymodels")

install.packages(pkgs)

Our versions

R version 4.5.0 (2025-04-11), Quarto (1.7.31)

package version
aorsf 0.1.5
broom 1.0.8
censored 0.3.3
dials 1.4.0
dplyr 1.1.4
ggplot2 3.5.2
glmnet 4.1-8
package version
libcoin 1.0-10
modeldata 1.4.0
mvtnorm 1.3-3
parsnip 1.3.2
partykit 1.2-24
pec 2023.04.12
prodlim 2025.04.28
package version
purrr 1.0.4
recipes 1.3.1
rpart 4.1.24
rsample 1.3.0
scales 1.4.0
survival 3.8-3
tibble 3.2.1
package version
tidymodels 1.3.0
tidyr 1.3.1
tune 1.3.0
workflows 1.2.0
workflowsets 1.1.0
yardstick 1.3.2