Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

model.frame.flexsurvreg

Extract original data from flexsurvreg objects.


Description

Extract the data from a model fitted with flexsurvreg.

Usage

## S3 method for class 'flexsurvreg'
model.frame(formula, ...)

## S3 method for class 'flexsurvreg'
model.matrix(object, par = NULL, ...)

Arguments

formula

A fitted model object, as returned by flexsurvreg.

...

Further arguments (not used).

object

A fitted model object, as returned by flexsurvreg.

par

String naming the parameter whose linear model matrix is desired.

The default value of par=NULL returns a matrix consisting of the model matrices for all models in the object cbinded together, with the intercepts excluded. This is not really a “model matrix” in the usual sense, however, the columns directly correspond to the covariate coefficients in the matrix of estimates from the fitted model.

Value

model.frame returns a data frame with all the original variables used for the model fit.

model.matrix returns a design matrix for a part of the model that includes covariates. The required part is indicated by the "par" argument (see above).

Author(s)

See Also


flexsurv

Flexible Parametric Survival and Multi-State Models

v2.0
GPL (>= 2)
Authors
Christopher Jackson [aut, cre], Paul Metcalfe [ctb], Jordan Amdahl [ctb], Matthew T. Warkentin [ctb], Kevin Kunzmann [ctb]
Initial release
2021-02-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.