MyNixOS website logo
Description

Building Augmented Data to Run Multi-State Models with 'msm' Package.

A fast and general method for restructuring classical longitudinal data into augmented ones. The reason for this is to facilitate the modeling of longitudinal data under a multi-state framework using the 'msm' package.

Building augmented data for multi-state models: the msmtools package

lifecycle release CRAN_Status_Badge


msmtools introduces a fast and general method for restructuring classical longitudinal datasets into augmented ones. The reason for this is to facilitate the modeling of longitudinal data under a multi-state framework using the msm package.

Installation

# Install the released version from CRAN:
install.packages("msmtools")

# Install the development version from GitHub:
devtools::install_github("contefranz/msmtools")

Overview

msmtools comes with 4 functions:

  • augment(): the main function of the package. This is the workhorse which takes care of the data reshaping. It is very efficient and fast so highly dimensional datasets can be processed with ease;

  • polish(): it helps in find and remove those transition which occur at the same time but lead to different states within a given subject;

  • prevplot(): this is a plotting function which mimics the usage of msm() function plot.prevalence.msm(), but with more things. Once you ran a multi-state model, use this function to plot a comparison between observed and expected prevalences;

  • survplot(): the aims of this function are double. You can use survplot() as a plotting tool for comparing the empirical and the fitted survival curves. Or you can use it to build and get the datasets used for the plot. The function is based on msmplot.survfit.msm(), but does more things and it is considerably faster.

For more information about msmtools, please check out the vignette with vignette( "msmtools" ).

Bugs and issues can be reported at https://github.com/contefranz/msmtools/issues.

Breaking changes from version 2.0.0

msmtools has received a lot of improvements in the plotting functions. In particular, from version 2.0.0 both survplot() and prevplot() support ggplot2. This inevitably introduces several breaking changes. Overall, both functions have been greatly simplified, but I encourage to go over each function's documentation and the vignette to get a correct understanding on how they work.


Metadata

Version

2.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows