MyNixOS website logo
Description

Mapping First Moment and C-Statistic to the Parameters of Distributions for Risk.

Provides a series of numerical methods for extracting parameters of distributions for risks based on knowing the expected value and c-statistics (e.g., from a published report on the performance of a risk prediction model). This package implements the methodology described in Sadatsafavi et al (2024) <doi:10.48550/arXiv.2409.09178>. The core of the package is mcmap(), which takes a pair of (mean, c-statistic) and the distribution type requested. This function provides a generic interface to more customized functions (mcmap_beta(), mcmap_logitnorm(), mcmap_probitnorm()) for specific distributions.

mcmapper

The goal of mcmapper is to enable estimating the parameters of two-parameter distributions for risks (e.g., beta, logit-normal) based on the expected value and c-statistic of the distribution. The theory behind this approach is explained in Sadatsafavi et al.

Some of the recent developments in predictive analytics, such as new methods for sample size calculations for risk prediction models, require knowing the distribution of predicted risks. However, original reports seldom provide such information. On the other hand, prediction model development and validation studies most often report the expected values of predicted or observed risks, and the c-statistic of the model for predicting the outcome. For a given family of distributions, one can use this package to recover the parameters of such a distribution.

The uniqueness of the characterization is established in a forthcoming paper.

Installation

You can install the development version of mcmapper from GitHub with:

# install.packages("devtools")
devtools::install_github("resplab/mcmapper")

Example

Gupta et al validated their risk prediction model for the risk of deterioration in hospitalized patients with COVID-19 infection. In the external validation sample (from London, UK), the prevalence of deterioration was 43%, the model had a c-statistics of 0.77. Assuming that calibrated risks had a logit-normal distribution, we can recover the parameters:

library(mcmapper)

res <- mcmap(c(m=0.43, c=0.77), type="logitnorm")

print(res)
#> $type
#> [1] "logitnorm"
#> 
#> $value
#>         mu      sigma 
#> -0.3605462  1.1836304 
#> 
#> attr(,"class")
#> [1] "mcmapper_output"
Metadata

Version

0.0.11

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