summary.flexrsurv {flexrsurv} | R Documentation |
Summarizing Flexible Relative Survival Model Fits
Description
summary
methods for class flexrsurv
.
Produces and prints summaries of the results of a fitted Relative Survival Model
Usage
## S3 method for class 'flexrsurv'
summary(object, correlation = FALSE, symbolic.cor = FALSE, ...)
## S3 method for class 'summary.flexrsurv'
print(x, digits = max(3L, getOption("digits") - 3L),
symbolic.cor = x$symbolic.cor,
signif.stars = getOption("show.signif.stars"), ...)
Arguments
object |
an object of class "flexrsurv", usually, a result of a call to |
x |
an object of class |
correlation |
logical; if |
symbolic.cor |
logical. If |
digits |
the number of significant digits to use when printing. |
signif.stars |
logical. If TRUE,'significance stars' are printed for each coefficient. |
... |
further arguments passed to or from other methods. |
Details
print.summary.glm
tries to be smart about formatting the coefficients, standard errors, etc.
and additionally gives ‘significance stars’ if signif.stars
is TRUE
.
Correlations are printed to two decimal places (or symbolically): to see the actual correlations
print summary(object)$correlation
directly.
The dispersion of a GLM is not used in the fitting process, but it is needed to find standard errors. If dispersion is not supplied or NULL, the dispersion is taken as 1 for the binomial and Poisson families, and otherwise estimated by the residual Chisquared statistic (calculated from cases with non-zero weights) divided by the residual degrees of freedom.
Value
The function summary.flexrsurv computes and returns a list of summary statistics of the fitted flexible relative survival model given in object
.
The returned value is an object of class "summary.flexrsurv
", which a list with components:
call |
the " |
terms |
the " |
coefficients |
the matrix of coefficients, standard errors, z-values and p-values. |
cov |
the estimated covariance matrix of the estimated coefficients. |
correlation |
(only if |
symbolic.cor |
(only if |
loglik |
the " |
df.residual |
the " |
See Also
summary
, flexrsurv
, flexrsurvclt
.
Examples
if (requireNamespace("relsurv", quietly = TRUE)) {
# data from package relsurv
data(rdata, package="relsurv")
# rate table from package relsurv
data(slopop, package="relsurv")
# get the death rate at event (or end of followup) from slopop for rdata
rdata$iage <- findInterval(rdata$age*365.24+rdata$time, attr(slopop, "cutpoints")[[1]])
rdata$iyear <- findInterval(rdata$year+rdata$time, attr(slopop, "cutpoints")[[2]])
therate <- rep(-1, dim(rdata)[1])
for( i in 1:dim(rdata)[1]){
therate[i] <- slopop[rdata$iage[i], rdata$iyear[i], rdata$sex[i]]
}
rdata$slorate <- therate
# change sex coding
rdata$sex01 <- rdata$sex -1
# fit a relative survival model with a non linear effetc of age
fit <- flexrsurv(Surv(time,cens)~sex01+NLL(age, Knots=60, Degree=3),
rate=slorate, data=rdata,
knots.Bh=1850, # one interior knot at 5 years
degree.Bh=3,
Spline = "b-spline",
initbyglm=TRUE,
initbands=seq(from=0, to=5400, by=200),
int_meth= "CAV_SIM",
step=50
)
summary(fit)
}