Learn R Programming

spsurv (version 1.0.0)

spbp: spbp: The BP Based Survival Analysis Function

Description

Semiparametric Survival Analysis Using Bernstein Polynomial

Usage

spbp(formula, ...)

Arguments

formula

a Surv object with time to event, status and explanatory terms.

...

Arguments passed to `rstan::sampling` (e.g. iter, chains) or `rstan::optimizing`.

Value

An object of class 'spbp'.

Details

Fits Bernstein Polynomial based Proportional regression to survival data.

See Also

spbp.default

spbp.default, bpph, bppo, bpaft, https://mc-stan.org/users/documentation/

Examples

Run this code
# NOT RUN {
library("spsurv")
data("veteran") ## imports from survival package

fit_mle <- spbp(Surv(time, status) ~ karno + factor(celltype),
 data = veteran, model = "po")
summary(fit_mle)

fit_bayes <- spbp(Surv(time, status) ~ karno + factor(celltype),
                  data = veteran, model = "po", approach = "bayes",
                   cores = 1, iter = 300, chains = 1,
                    priors = list(beta = c("normal(0,4)"),
                     gamma = "lognormal(0,4)"))

summary(fit_bayes)

# }

Run the code above in your browser using DataLab