Learn R Programming

brms (version 0.1.0)

kidney: Infections in kidney patients

Description

This dataset, originally discussed in McGilchrist and Aisbett (1991), describes the first and second (possibly left censored) recurrence time of infection in kideny patients using portable dialysis equipment. In addition, information on the risk variables age, sex and disease type is provided.

Usage

kidney

Arguments

source

McGilchrist, C. A., & Aisbett, C. W. (1991). Regression with frailty in survival analysis. Biometrics, 47(2), 461-466.

Examples

Run this code
# performing surivival analysis using the "weibull" family
# time | cens indicates which values in variable time are left censored
fit_k1 <- brm(time | cens ~ age + sex + disease, data = kidney, family = "weibull")
brm.plot(fit_k1)
print(fit_k1)

# adding random intercepts over patients and using weakly informative priors
# for regression parameters and standard deviations of random effects
fit_k2 <- brm(time|cens ~ age + sex + disease + (1|patient), data = kidney,
           family = "weibull", prior = list(b = "normal(0,10)", sd = "uniform(0.1,20)"),
           n.iter = 5000)
brm.plot(fit_k2)
print(fit_k2)

Run the code above in your browser using DataLab