Description Usage Arguments Value
This a modified flexsurv summary function which takes the coefficients of the model, and the number of ancillary parameters as the first arguments of function to facilitate compatibility with numDeriv. It is intended primarily for internal useage. Please use the summary.flexsurv function unless computation of a standard error is required via the delta method.
1 2 3 |
var |
Coefficients from a flexsurvspline model |
sl |
The number of ancillary (gamma) covariates |
object |
Output from flexsurvspline, representing a fitted survival model object. |
newdata |
Data frame containing covariate values to produce fitted values for. Or a list that can be coerced to such a data frame. There must be a column for every covariate in the model formula, and one row for every combination of covariates the fitted values are wanted for. These are in the same format as the original data, with factors as a single variable, not 0/1 contrasts. |
X |
Alternative way of defining covariate values to produce fitted values for. Since version 0.4, newdata is an easier way that doesn't require the user to create factor contrasts, but X has been kept for backwards compatibility. |
type |
"survival" for survival probabilities. |
fn |
Custom function of the parameters to summarise against time. This has optional first two arguments t representing time, and start representing left-truncation points, and any remaining arguments must be parameters of the distribution. It should return a vector of the same length as t. |
t |
Times to calculate fitted values for. By default, these are the sorted unique observation (including censoring) times in the data - for left-truncated datasets these are the "stop" times. |
start |
Optional left-truncation time or times. The returned survival, hazard or cumulative hazard will be conditioned on survival up to this time. |
ci |
Set to FALSE to omit confidence intervals. |
B |
Number of simulations from the normal asymptotic distribution of the estimates used to calculate confidence intervals. Decrease for greater speed at the expense of accuracy, or set B=0 to turn off calculation of CIs. |
cl |
Width of symmetric confidence intervals, relative to 1. |
tidy |
If TRUE, then the results are returned as a tidy data frame instead of a list. This can help with using the ggplot2 package to compare summaries for different covariate values. |
... |
Further arguments passed to or from other methods. Currently unused. |
If tidy=FALSE, a list with one component for each unique covariate value (if there are only categorical covariates) or one component (if there are no covariates or any continuous covariates). Each of these components is a matrix with one row for each time in t, giving the estimated survival (or cumulative hazard, or hazard) and 95% confidence limits. These list components are named with the covariate names and values which define them.
If tidy=TRUE, a data frame is returned instead. This is formed by stacking the above list components, with additional columns to identify the covariate values that each block corresponds to.
If there are multiple summaries, an additional list component named X contains a matrix with the exact values of contrasts (dummy covariates) defining each summary.
The plot.flexsurvreg function can be used to quickly plot these model-based summaries against empirical summaries such as Kaplan-Meier curves, to diagnose model fit.
Confidence intervals are obtained by random sampling from the asymptotic normal distribution of the maximum likelihood estimates (see, e.g. Mandel (2013)).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.