GraphPad PRISM requires a very specific input format for lifespan analysis. In this tutorial, we show how the pivot_prism() function can be used to easily convert data for PRISM.

Setup

# Load libraries
library(ggbulksurv)
# Load data
data(sample_data)
dat <- sample_data # using the fictional dataset

# Load your data for your analysis
# dat <- read.csv("your-sample-data.csv")

What conditions are present? Use this to check for any accidental typos:

unique(dat$condition) 
#> [1] "WT"    "Drug1" "Drug2"

Pivot to PRISM

df_prism <- pivot_prism(dat)

head(df_prism) # quick look
#> # A tibble: 6 × 4
#>   day   Drug1    WT Drug2
#>   <chr> <dbl> <dbl> <dbl>
#> 1 1         1     1    NA
#> 2 1         1     1    NA
#> 3 1         1     0    NA
#> 4 1         1    NA    NA
#> 5 1         1    NA    NA
#> 6 2         1     1    NA

Export

That looks great! Let’s export it:

write.csv(df_prism, file = "df_prism.csv")

You should see a df_prism.csv file appear in your folder. Copy and paste this into GraphPad PRISM, and run a survival analysis in PRISM.