I am not using Cox regression as the proportional hazards function is violated. Thus, I gave a try for brms, accelerated failure time regression, and this seems promising.
I have to compare the survival of sexes at different time points (1, 3, 6, 12 months). As, I do not feel confident with this, I provide an example with questions at the end.The example is on kidney data.
Data
library(survival)
library(brms)
kidney
Model
fit1 = brm(time | cens(censored) ~ age + sex + disease, data = kidney,
family = weibull, inits = "0")
fit1
Family: weibull
Links: mu = log; shape = identity
Formula: time | cens(censored) ~ age + sex + disease
Data: x (Number of observations: 76)
Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup samples = 4000
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 3.79 0.50 2.85 4.80 1.00 4445 3358
age -0.00 0.01 -0.02 0.02 1.00 2826 3191
sexfemale 1.59 0.34 0.92 2.25 1.00 3279 2648
diseaseGN -0.06 0.42 -0.88 0.80 1.00 2363 2701
diseaseAN -0.53 0.40 -1.31 0.25 1.00 2345 2473
diseasePKD 1.33 0.59 0.19 2.52 1.00 2329 2920
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
shape 0.98 0.10 0.79 1.18 1.00 3861 2565
Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
Survival of males and females
conditional_effects(fit1, effects = "sex")
Questions
- brms has several families for analysing survival. Which one to choose? Should I separate models, check their fit with pp_check() and compare them with loo() function, and choose the best?
- If I would like to get such plots at different time points. First, is such approach reasonable as the survival at different time points may vary between sexes? Second, should I run separate models or I should predict new data from the same model (fit1). How to code the newdata argument for brms survival model to get a prediction for 30 or 90 days?
- Are model summary estimates in log scale? If I exp() them, I will get time ratios?