Skip to contents

Collects the fitted coefficients, the fit measures and a summary of the residuals into a compact object for printing, and rounds them to digits. The fit measures cover the fit window (the ages fitted and the ages reported), the optimisation (method used, optimiser outcome), the deviance with its degrees of freedom and dispersion, and the R-squared and RMSE of the fit. For a likelihood-based fit the maximised log-likelihood with its information criteria is included. When more than four curves were fitted only the first and the last two are kept in the printed coefficients and fit measures, so the output fits on one screen.

Usage

# S3 method for class 'MortalityLaw'
summary(object, ..., digits = max(3L, getOption("digits") - 3L))

Arguments

object

An object of class "MortalityLaw".

...

Additional arguments affecting the summary produced.

digits

Number of significant digits to display.

Value

An object of class "summary.MortalityLaw", a list holding the model information, the matched call, the rounded coefficients, the goodness-of-fit measures, the deviance and the degrees of freedom, the R-squared and RMSE of the fit, the optimisation outcome, the fit window and the residual summaries on the raw and the deviance scale.

See also

MortalityLaw to fit a law; coef and fitted for the extracted values.

Examples

x  <- 45:75
M1 <- MortalityLaw(x = x, Dx = ahmd$Dx[as.character(x), "1950"],
                   Ex = ahmd$Ex[as.character(x), "1950"], law = "makeham")
summary(M1)
#> Makeham model: mu[x] = A exp[Bx] + C
#> Fitted values: mx  |  ages 45-75  |  fitted on 45-75 (31 of 31 ages)
#> 
#> Call:
#> MortalityLaw(x = x, Dx = ahmd$Dx[as.character(x), "1950"], Ex = ahmd$Ex[as.character(x), 
#>     "1950"], law = "makeham")
#> 
#> Coefficients:
#>   estimate
#> A   0.0019
#> B   0.1127
#> C   0.0017
#> 
#> Fit:
#>   method LF2  |  optimiser converged in 21 iterations
#>   deviance 117.3 on 28 degrees of freedom  |  dispersion 4.18
#>   R-squared 0.9977  |  RMSE 0.000815
#> 
#> Residuals:
#>             Min. 1st Qu. Median   Mean 3rd Qu.   Max.
#> raw      -0.0019 -0.0002  0e+00 0.0001  0.0003 0.0032
#> deviance -4.3099 -1.1418 -9e-04 0.0204  1.3164 4.5737