yppe {YPPE} | R Documentation |
Fits the Yang and Prentice model with baseline distribution modelled by the piecewise exponential distribution.
Description
Fits the Yang and Prentice model with baseline distribution modelled by the piecewise exponential distribution.
Usage
yppe(
formula,
data,
n_int = NULL,
rho = NULL,
tau = NULL,
hessian = TRUE,
approach = c("mle", "bayes"),
hyper_parms = list(h1_gamma = 0, h2_gamma = 4, mu_psi = 0, sigma_psi = 4, mu_phi = 0,
sigma_phi = 4, mu_beta = 0, sigma_beta = 4),
...
)
Arguments
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 yppe is called. |
n_int |
number of intervals of the PE distribution. If NULL, default value (square root of n) is used. |
rho |
the time grid of the PE distribution. If NULL, the function timeGrid is used to compute rho. |
tau |
the maximum time of follow-up. If NULL, tau = max(time), where time is the vector of observed survival times. |
hessian |
logical; If TRUE (default), the hessian matrix is returned when approach="mle". |
approach |
approach to be used to fit the model (mle: maximum likelihood; bayes: Bayesian approach). |
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' . |
Value
yppe returns an object of class "yppe" containing the fitted model.
Examples
# ML approach:
library(YPPE)
mle <- yppe(Surv(time, status)~arm, data=ipass, approach="mle")
summary(mle)
# Bayesian approach:
bayes <- yppe(Surv(time, status)~arm, data=ipass, approach="bayes")
summary(bayes)