smooth_mortality_law: Function to smooth mortality rates using MortalityLaw package

View source: R/smooth_mortality_law.R

smooth_mortality_lawR Documentation

Function to smooth mortality rates using MortalityLaw package

Description

This smoothing function allows smoothing of a variable in a vital object using the MortalityLaw package. The vital object is returned along with some additional columns containing information about the smoothed variable: .smooth containing the smoothed values, and .smooth_se containing the corresponding standard errors.

Usage

smooth_mortality_law(.data, .var, law = "gompertz", ...)

Arguments

.data

A vital object

.var

name of variable to smooth. This should contain mortality rates.

law

name of mortality law. For available mortality laws, users can check the availableLaws. Argument ignored if a custom law supplied. function to learn about the available options.

...

Additional arguments are passed to MortalityLaw.

Value

vital with added columns containing smoothed values and their standard errors

Author(s)

Sixian Tang and Rob J Hyndman

Examples

norway_mortality |> smooth_mortality_law(Mortality)

vital documentation built on Aug. 21, 2025, 5:34 p.m.