Function to fit Yang and Prentice (YP) models.
ypreg(formula, data, baseline = "weibull", dist = NULL, init = 0, ...)
ypreg returns an object of class "ypreg" containing the fitted model.
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 function is called.
the chosen baseline distribution; options currently available are: exponential, weibull, lognormal, loglogistic and Birnbaum-Saunders (fatigue) distributions.
alternative way to specify the baseline distribution (for compatibility with the survreg
function); default is NULL.
initial values specification (default value is 0); see the detailed documentation for init
in optimizing
.
further arguments passed to other methods.
# \donttest{
library(survstan)
fit <- ypreg(Surv(futime, fustat) ~ ecog.ps + rx, data = ovarian, baseline = "weibull")
summary(fit)
# }
Run the code above in your browser using DataLab