Number of observations contributing to a fitted flexible survival model
Source:R/flexsurvreg.R
nobs.flexsurvreg.RdNumber of observations contributing to a fitted flexible survival model
Usage
# S3 method for class 'flexsurvreg'
nobs(object, cens = TRUE, ...)Arguments
- object
Output from
flexsurvregorflexsurvspline, representing a fitted survival model object.- cens
Include censored observations in the number.
TRUEby default. IfFALSEthen the number of observed events is returned. SeeBIC.flexsurvregfor a discussion of the issues with defining the sample size for censored data.- ...
Further arguments passed to or from other methods. Currently unused.
Value
This returns the mod$N component of the fitted
model object mod. See flexsurvreg,
flexsurvspline for full documentation of all components.
Details
By default, this matches the behaviour of the nobs method for survreg objects, including both censored and uncensored observations.
If a weighted flexsurvreg analysis was done, then this function returns the sum of the weights.
Author
C. H. Jackson chris.jackson@mrc-bsu.cam.ac.uk