Posts

flexsurv 2

Previously, I started discussing the flexsurv package. I used it to fit a Weibull model. This is implemented as an accelerated failure …

flexsurv

I’m going to write about some of my favourite R packages. I’ll start with flexsurv (https://github.com/chjackson/flexsurv-dev) by Chris …

Longitudinal hurdle models 3

In the last post on longitudinal hurdle models, I had just taken samples from the marginal mean \[\begin{align} g(\theta; x) & = …

Longitudinal hurdle models 2

In a previous post I fit a longitudinal hurdle model using the brms package. library(brms) summary(fit_hurdle) ## Family: …

Longitudinal hurdle models

Data Recently, I have been modelling data that is longitudinal, contains excess zeros, and where the non-zero data is right-skewed and …

How to calculate the log-rank statistic

Suppose we have the following data. df <- dplyr::tibble(patient_id = as.character(1:12), treatment = rep(c("C", …