I am trying to understand how to estimate survival curves using brms weibull regression. Using the kidney example, I fit the following model:
fit1 <- brm(time | cens(censored) ~ age + sex + disease,
data = kidney, family = weibull, inits = “0”)
Based on my understanding the brms parameterization, I need to transform the log-link linear model into a scale parameter with the following: scale = exp( linear predictors ) / gamma( 1 + 1/shape). brms provides the shape parameter.
The survival curve is then: S(t) = exp(-scale * t^shape). However, my results look totally wonky when I try to plot this curve. What am I doing wrong?
- Operating System: Ubuntu
- brms Version: 2.5.0