spbp: spbp: The BP Based Survival Analysis Function

Description Usage Arguments Details Value See Also Examples

View source: R/spbp.R

Description

Semiparametric Survival Analysis Using Bernstein Polynomial

Usage

1

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'.

Details

Fits Bernstein Polynomial based Proportional regression to survival data.

Value

An object of class 'spbp'.

See Also

spbp.default

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

spsurv documentation built on April 14, 2020, 7:20 p.m.