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
- 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://euromomonetwork.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()
Delay correction | Description |
---|---|
original | ??? |
sincos | original+sin52+cos52 |
richard | Interacts WR with categorical YoDi, includes closed, sin52, and cos52nb2 ~ WRXX*as.factor(YoDi) + closed + sin52 + cos52 |
???
???
nb2 ~ WRXX*as.factor(YoDi) + closed + sin52 + cos52