Tidy summarizes information about the components of the model into a tidy data frame.
# S3 method for flexsurvreg
tidy(
x,
conf.int = FALSE,
conf.level = 0.95,
pars = "all",
transform = "none",
...
)
A tibble
containing the columns: term
, estimate
, std.error
, statistic
, p.value
, conf.low
, and conf.high
, by default.
statistic
and p.value
are only provided for covariate effects (NA
for baseline distribution parameters). These are computed as Wald-type test statistics with p-values from a standard normal distribution.
Output from flexsurvreg
or flexsurvspline
, representing a fitted survival model object.
Logical. Should confidence intervals be returned? Default is FALSE
.
The confidence level to use for the confidence interval if conf.int = TRUE
. Default is 0.95
.
One of "all"
, "baseline"
, or "coefs"
for all parameters, baseline distribution parameters, or covariate effects (i.e. regression betas), respectively. Default is "all"
.
Character vector of transformations to apply to requested pars
. Default is "none"
, which returns pars
as-is.
Users can specify one or both types of transformations:
"baseline.real"
which transforms the baseline distribution parameters to the real number line used for estimation.
"coefs.exp"
which exponentiates the covariate effects.
See Details
for a more complete explanation.
Not currently used.
flexsurvreg
models estimate two types of coefficients, baseline distribution parameters, and covariate effects which act on the baseline distribution. By design, flexsurvreg
returns distribution parameters on the same scale as is found in the relevant d/p/q/r
functions. Covariate effects are returned on the log-scale, which represents either log-time ratios (accelerated failure time models) or log-hazard ratios for proportional hazard models. By default, tidy()
will return baseline distribution parameters on their natural scale and covariate effects on the log-scale.
To transform the baseline distribution parameters to the real-value number line (the scale used for estimation), pass the character argument "baseline.real"
to transform
. To get time ratios or hazard ratios, pass "coefs.exp"
to transform
. These transformations may be done together by submitting both arguments as a character vector.
fitg <- flexsurvreg(formula = Surv(futime, fustat) ~ age, data = ovarian, dist = "gengamma")
tidy(fitg)
tidy(fitg, pars = "coefs", transform = "coefs.exp")
Run the code above in your browser using DataLab