MyNixOS website logo
Description

Model Infectious Disease Parameters from Serosurveys.

An easy-to-use and efficient tool to estimate infectious diseases parameters using serological data. Implemented models include SIR models (basic_sir_model(), static_sir_model(), mseir_model(), sir_subpops_model()), parametric models (polynomial_model(), fp_model()), nonparametric models (lp_model()), semiparametric models (penalized_splines_model()), hierarchical models (hierarchical_bayesian_model()). The package is based on the book "Modeling Infectious Disease Parameters Based on Serological and Social Contact Data: A Modern Statistical Perspective" (Hens, Niel & Shkedy, Ziv & Aerts, Marc & Faes, Christel & Damme, Pierre & Beutels, Philippe., 2013) <doi:10.1007/978-1-4614-4072-7>.

serosv

Codecov testcoverage R-CMD-check

serosv is an easy-to-use and efficient tool to estimate infectious diseases parameters (seroprevalence and force of infection) using serological data. The current version is based on the book “Modeling Infectious Disease Parameters Based on Serological and Social Contact Data – A Modern Statistical Perspective” by Hens et al., 2012 Springer.

Installation

You can install the development version of serosv with:

# install.packages("devtools")
devtools::install_github("OUCRU-Modelling/serosv")

Feature overview

Datasets

serosv contains 15 built-in serological datasets as provided by Hens et al., 2012 Springer. Simply call the name to load a dataset, for example:

rubella <- rubella_uk_1986_1987

Methods

The following methods are available to estimate seroprevalence and force of infection.

Parametric approaches:

  • Polynomial models:
    • Muench’s model
    • Griffiths’ model
    • Grenfell and Anderson’s model
  • Nonlinear models:
    • Farrington’s model
    • Weibull model
  • Fractional polynomial models

Nonparametric approaches:

  • Local estimation by polynomials

Demo

Load the rubella in UK dataset.

library(serosv)

Find the power for the best second degree fractional polynomial with monotonicity constraint and a logit link function. The power appears to be (-0.9,-0.9).

rubella <- rubella_uk_1986_1987

best_2d_mn <- find_best_fp_powers(
  rubella$age, rubella$pos, rubella$tot,
  p=seq(-2,3,0.1), mc = T, degree=2, link="logit"
)

best_2d_mn
#> $p
#> [1] -0.9 -0.9
#> 
#> $deviance
#> [1] 37.57966
#> 
#> $model
#> 
#> Call:  glm(formula = as.formula(formulate(p_cur)), family = binomial(link = link))
#> 
#> Coefficients:
#>               (Intercept)                I(age^-0.9)  
#>                     4.342                     -4.696  
#> I(I(age^-0.9) * log(age))  
#>                    -9.845  
#> 
#> Degrees of Freedom: 43 Total (i.e. Null);  41 Residual
#> Null Deviance:       1369 
#> Residual Deviance: 37.58     AIC: 210.1

Finally, fit the second degree fractional polynomial.

fpmd <- fp_model(
  rubella$age, rubella$pos, rubella$tot,
  p=c(-0.9, -0.9), link="logit")

plot(fpmd)
Metadata

Version

1.0.1

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • 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