Description Usage Arguments Value Examples
Fits the Yang and Prentice model with either the baseline hazard hazard or the baseline odds modeled via Bernstein polynomials.
1 2 3 4 5 6 7 8 9 10 11 12 |
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. |
data |
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which ypbp is called. |
degree |
number of intervals of the PE distribution. If NULL, default value (square root of n) is used. |
tau |
the maximum time of follow-up. If NULL, tau = max(time), where time is the vector of observed survival times. |
approach |
approach to be used to fit the model (mle: maximum likelihood; bayes: Bayesian approach). |
baseline |
baseline function to be modeled. |
hessian |
logical; If TRUE (default), the hessian matrix is returned when approach="mle". |
hyper_parms |
a list containing the hyper-parameters of the prior distributions (when approach = "bayes"). If not specified, default values are used. |
... |
Arguments passed to either 'rstan::optimizing' or 'rstan::sampling' . |
ypbp returns an object of class "ypbp" containing the fitted model.
1 2 3 4 5 6 7 | library(YPBP)
mle1 <- ypbp(Surv(time, status)~trt, data=gastric, baseline = "hazard")
mle2 <- ypbp(Surv(time, status)~trt, data=gastric, baseline = "odds")
bayes1 <- ypbp(Surv(time, status)~trt, data=gastric, baseline = "hazard",
approach = "bayes", chains = 2, iter = 500)
bayes2 <- ypbp(Surv(time, status)~trt, data=gastric, baseline = "odds",
approach = "bayes", chains = 2, iter = 500)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.