riskdiff: Risk Difference Estimation with Multiple Link Functions

Calculates risk differences (or prevalence differences for cross-sectional data) using generalized linear models with automatic link function selection. Provides robust model fitting with fallback methods, support for stratification and adjustment variables, inverse probability of treatment weighting (IPTW) for causal inference, and publication-ready output formatting. Handles model convergence issues gracefully and provides confidence intervals using multiple approaches. Methods are based on approaches described in Mark W. Donoghoe and Ian C. Marschner (2018) "logbin: An R Package for Relative Risk Regression Using the Log-Binomial Model" <doi:10.18637/jss.v086.i09> for robust GLM fitting, Peter C. Austin (2011) "An Introduction to Propensity Score Methods for Reducing the Effects of Confounding in Observational Studies" <doi:10.1080/00273171.2011.568786> for IPTW methods, and standard epidemiological methods for risk difference estimation as described in Kenneth J. Rothman, Sander Greenland and Timothy L. Lash (2008, ISBN:9780781755641) "Modern Epidemiology".

Version: 0.2.0
Depends: R (≥ 3.5.0)
Imports: dplyr (≥ 1.0.0), purrr, tibble, rlang, scales, stringr, stats
Suggests: kableExtra, testthat (≥ 3.0.0), knitr, rmarkdown, ggplot2, covr
Published: 2025-06-23
DOI: 10.32614/CRAN.package.riskdiff
Author: John D. Murphy ORCID iD [aut, cre] (MPH, PhD)
Maintainer: John D. Murphy <jackmurphy2351 at gmail.com>
BugReports: https://github.com/jackmurphy2351/riskdiff/issues
License: MIT + file LICENSE
URL: https://github.com/jackmurphy2351/riskdiff
NeedsCompilation: no
Materials: README NEWS
CRAN checks: riskdiff results [issues need fixing before 2025-07-08]

Documentation:

Reference manual: riskdiff.pdf
Vignettes: complete-example (source, R code)
Causal Inference with IPTW in riskdiff (source, R code)
Getting Started with Risk Differences (source, R code)
technical-details (source, R code)

Downloads:

Package source: riskdiff_0.2.0.tar.gz
Windows binaries: r-devel: riskdiff_0.2.0.zip, r-release: riskdiff_0.2.0.zip, r-oldrel: riskdiff_0.2.0.zip
macOS binaries: r-release (arm64): riskdiff_0.2.0.tgz, r-oldrel (arm64): riskdiff_0.2.0.tgz, r-release (x86_64): riskdiff_0.2.0.tgz, r-oldrel (x86_64): riskdiff_0.2.0.tgz
Old sources: riskdiff archive

Linking:

Please use the canonical form https://CRAN.R-project.org/package=riskdiff to link to this page.