MyNixOS website logo
Description

Prediction Intervals.

An implementation of prediction intervals for overdispersed count data, for overdispersed binomial data and for linear random effects models.

predint

CRANdownloads

CRANdownloads

In many pharmaceutical and biomedical applications such as assay validation, assessment of historical control data or the detection of anti-drug antibodies, prediction intervals are of use. The package predint provides functions to calculate bootstrap calibrated prediction intervals (or limits) for one or more future observations based on overdispersed binomial data, overdispersed Poisson data, as well as data that is modeled by linear random effects models fitted with lme4::lmer(). The main functions are:

  • beta_bin_pi() for beta-binomial observations (overdispersion differs between clusters)

  • quasi_bin_pi() for quasi-binomial observations (constant overdispersion between clusters)

  • neg_bin_pi() for negative_binomial observations (overdispersion differs between clusters)

  • quasi_pois_pi() for quasi-Poisson observations (constant overdispersion between clusters)

  • lmer_pi_futmat() for data that is modeled by a linear random effects model. This function takes the experimental design of the future observations into account if computed for $M>1$ observations.

For all of these functions, it is assumed that the historical, as well as the future (or current) observations descend from the same data generating process.

Installation

You can install the released version of predint from CRAN with:

install.packages("predint")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("MaxMenssen/predint")

Example

The following example is based on the scenario described in Menssen and Schaarschmidt 2019: Based on historical control data for the mortality of male B6C3F1-mice obtained in long term studies at the National Toxicology Program (NTP 2017), prediction intervals (PI) can be computed in order to validate the observed mortality in one concurrent (or future) control group.

Similarly to Menssen and Schaarschmidt 2019, it is assumed, that the data is overdispersed binomial. Hence, the quasi_bin_pi() function will be used in the following two examples.

Evaluation of one future control group

In this example, the validation of one control group the is comprised of 30 mice is of interest. For this purpose, a pointwise 95 % prediction interval for one future observation is computed based on the historical data. Since the underlying distribution is skewed, the lower and the upper prediction limit are calibrated independently from each other (by setting algorithm="MS22mod").

# load predint
library(predint)
#> Loading required package: ggplot2
#> Loading required package: lme4
#> Loading required package: Matrix
#> Loading required package: MASS
#> 
#> Attaching package: 'predint'
#> The following object is masked from 'package:stats':
#> 
#>     rnbinom

# Data set 
# see Table 1 of the supplementary material of Menssen and Schaarschmidt 2019
mortality_HCD
#>    dead alive
#> 1    15    35
#> 2    10    40
#> 3    12    38
#> 4    12    38
#> 5    13    37
#> 6    11    39
#> 7    19    31
#> 8    11    39
#> 9    14    36
#> 10   21    29

# PI for one future control group comprised of 30 mice
pi_m1 <- quasi_bin_pi(histdat=mortality_HCD, 
                      newsize=30,
                      traceplot = FALSE, 
                      alpha=0.05,
                      algorithm="MS22mod")

pi_m1
#> Pointwise 95 % prediction interval for one future observation 
#>  
#>      lower    upper newsize
#> 1 2.288892 15.39607      30

The mortality of a concurrent control group is in line with the historical knowledge, if it is not lower than 2.289 or higher than 2.289.

A graphical overview about the prediction interval can be given with

plot(pi_m1)

References

Menssen, M., Schaarschmidt, F.: Prediction intervals for all of M future observations based on linear random effects models. Statistica Neerlandica. 2022. DOI: 10.1111/stan.12260

Menssen M, Schaarschmidt F.: Prediction intervals for overdispersed binomial data with application to historical controls. Statistics in Medicine. 2019;38:2652-2663. DOI:10.1002/sim.8124

NTP 2017: Tables of historical controls: pathology tables by route/vehicle., Accessed May 17, 2017.

Metadata

Version

2.2.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