Coder Social home page Coder Social logo

momopack-for-r's Introduction

MOMOpack for R

Build Status codecov

This is a full port of A-MOMOpack (the code used to analyze mortality data for the EuroMOMO project) from Stata to R.

News

momo 2018.08.24

  • There are now more options for extracting data from inside your MoMo run. Previously only momo::dataExport$toSave was available, however, now there is also momo::dataExport$aggr, momo::dataExport$aggr_fullDelay, and momo::dataExport$aggr_delay

momo 2018.08.23

  • 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 by delayVersion="original" (default).

momo 2017.12.14

  • This is a full port of A-MOMOpack (the code used to analyze mortality data for the EuroMOMO project) from Stata to R.

How to install

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/")

Basic example

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()

Another example using MDATA and HDATA instead of MFILE and HFILE

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()

momopack-for-r's People

Contributors

thlytras avatar fhi-infectious avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.