This is a full port of A-MOMOpack (the code used to analyze mortality data for the EuroMOMO project) from Stata to R.
- There are now more options for extracting data from inside your MoMo run. Previously only
momo::dataExport$toSave
was available, however, now there is alsomomo::dataExport$aggr
,momo::dataExport$aggr_fullDelay
, andmomo::dataExport$aggr_delay
- The new delay correction that Jens developed in December 2017 is now available. This can be chosen by
delayVersion="2017-12"
, or the original delay correction can be chosen bydelayVersion="original"
(default).
- This is a full port of A-MOMOpack (the code used to analyze mortality data for the EuroMOMO project) from Stata to R.
Please use my drat repository to install this package from, as the drat repository only contains package versions that have passed testing.
install.packages("momo", repos="https://raubreywhite.github.io/drat/")
SetOpts(
DoA=as.Date("2013-12-31"),
DoPR=as.Date("2008-1-1"),
WStart=1,
WEnd=52,
country = "Denmark",
source = "SSI",
MFILE = "DoD_DoR.txt",
HFILE = "holidays.txt",
INPUTDIR = system.file("testdata",package="momo"),
WDIR = tempdir(),
back = 3,
WWW = 290,
Ysum = 2013,
Wsum = 40,
USEglm2 = TRUE,
useAUTOMN = TRUE,
datesISO = FALSE,
plotGraphs = TRUE,
delayVersion = "2017-12",
MOMOgroups = list(
"0to4" = "age >= 0 & age <=4",
"5to14" = "age >= 5 & age <=14",
"15to64" = "age >= 15 & age <=64",
"65P" = "age >= 65 | is.na(age)",
"Total" = "age >= 0 | is.na(age)"
),
MOMOmodels = c(
"0to4" = "LINE",
"5to14" = "LINE",
"15to64" = "LINE_SIN",
"65P" = "LINE_SIN",
"Total" = "LINE_SIN"
))
RunMoMo()
MDATA <- as.data.frame(data.table::fread(file.path(system.file("testdata",package="momo"),"DoD_DoR.txt")))
HDATA <- as.data.frame(data.table::fread(file.path(system.file("testdata",package="momo"),"holidays.txt")))
SetOpts(
DoA=as.Date("2013-12-31"),
DoPR=as.Date("2008-1-1"),
WStart=1,
WEnd=52,
country = "Denmark",
source = "SSI",
MDATA = MDATA,
HDATA = HDATA,
WDIR = tempdir(),
back = 3,
WWW = 290,
Ysum = 2013,
Wsum = 40,
USEglm2 = TRUE,
useAUTOMN = TRUE,
datesISO = FALSE,
plotGraphs = TRUE,
delayVersion = "2017-12",
MOMOgroups = list(
"0to4" = "age >= 0 & age <=4",
"5to14" = "age >= 5 & age <=14",
"15to64" = "age >= 15 & age <=64",
"65P" = "age >= 65 | is.na(age)",
"Total" = "age >= 0 | is.na(age)"
),
MOMOmodels = c(
"0to4" = "LINE",
"5to14" = "LINE",
"15to64" = "LINE_SIN",
"65P" = "LINE_SIN",
"Total" = "LINE_SIN"
))
RunMoMo()