StMoMoData: Create StMoMoData object from demogdata object

Description Usage Arguments Value Examples

View source: R/exportUtils.R

Description

Create StMoMoData object suitable for fitting a Stochastic Mortality Model using function fit.StMoMo.

Usage

1
2
StMoMoData(data, series = names(data$rate)[1], type = c("central",
  "initial"))

Arguments

data

demogdata object of type "mortality". It is either the output from functions read.demogdata or hmd.mx of package demography.

series

name of series within data to use.

type

the type of exposure that should be included in the output. The alternatives are "central" (default) and "initial". "central" exposures are suitable for fitting models under a log-Poisson framework while "initial" exposures are suitable under a logit-Binomial framework.

Value

A list with class "StMoMoData" with components:

Dxt

matrix of deaths data.

Ext

matrix of observed exposures.

ages

vector of ages corresponding to rows of Dxt and Ext.

years

vector of years corresponding to rows of Dxt and Ext.

type

the type of exposure in the data.

series

name of the extracted series.

label

label of the data.

Examples

1
2
3
4
5
6
7
8
## Not run: 
library(demography)
NZdata <- hmd.mx(country = "NZL_NP", username = username, password = password, 
label = "New Zealand")
NZStMoMo <- StMoMoData(NZdata, series = "male")
summary(NZStMoMo)

## End(Not run)

StMoMo documentation built on May 2, 2019, 11:42 a.m.