MyNixOS website logo
Description

Meta-Analysis of Generalized Additive Models.

Meta-analysis of generalized additive models and generalized additive mixed models. A typical use case is when data cannot be shared across locations, and an overall meta-analytic fit is sought. 'metagam' provides functionality for removing individual participant data from models computed using the 'mgcv' and 'gamm4' packages such that the model objects can be shared without exposing individual data. Furthermore, methods for meta-analysing these fits are provided. The implemented methods are described in Sorensen et al. (2020), <doi:10.1016/j.neuroimage.2020.117416>, extending previous works by Schwartz and Zanobetti (2000) and Crippa et al. (2018) <doi:10.6000/1929-6029.2018.07.02.1>.

metagam

CRANstatus R-CMD-check Lifecycle:experimental Codecov testcoverage

Overview

metagam is an R-package for meta-analysis of generalized additive models (GAMs). Its main application is cases in which raw data are located in multiple locations, and cannot be shared due to ethical or regulatory restrictions. metagam provides functions for removing all individual participant data from from GAMs fitted separately at each location, such that the resulting object can be shared to a central location. Next, metagam provides functions for meta-analysing these fitted GAMs using pointwise meta-analysis, as well as plotting and summary methods for analyzing the meta-analytic fits. The methods implemented are described in Sorensen et al. (2021), extending upon previous works by Schwartz and Zanobetti (2000) and Crippa, Thomas, and Orsini (2018).

Currently, GAMs objects created with the following functions are supported:

  • From package mgcv: bam(), gam() and gamm().
  • From package gamm4: gamm4().

This package is under development, so changes to the interface can be expected. Suggestions for improvements and bug reports are warmly welcome, either by filing an Issue or opening a Pull Request.

Installation

Install the current release of metagam from CRAN with:

install.packages("metagam")

Install the current development version of metagam from GitHub with:

# install.packages("remotes")
remotes::install_github("lifebrain/metagam")

Application Example

library("metagam")
library("mgcv")
#> Loading required package: nlme
#> This is mgcv 1.8-38. For overview type 'help("mgcv-package")'.

Simulate three datasets and fit a GAM to each of them. Then use strip_rawdata() from metagam to remove individual participant data.

## Set seed for reproducible random numbers
set.seed(8562957)
## Simulate using mgcv::gamSim
datasets <- lapply(1:3, function(x) gamSim(verbose = FALSE))
## Fit a model to each dataset
models <- lapply(datasets, function(dat){
  ## Full gam with mgcv
  full_model <- gam(y ~ s(x2, bs = "cr"), data = dat)
  ## Strip rawdata
  strip_rawdata(full_model)
})

models now is a list containing three GAMs without individual participant data. We can then meta-analyze them using metagam().

meta_analysis <- metagam(models)
summary(meta_analysis)
#> Meta-analysis of GAMs from 3 cohorts, using method FE.
#> 
#> Smooth terms analyzed: s(x2).

For further documentation and vignettes, please visit the package website.

Code of Conduct

Please note that the metagam project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

References

Crippa, Alessio, Ilias Thomas, and Nicola Orsini. 2018. “A Pointwise Approach to Dose-Response Meta-Analysis of Aggregated Data.” International Journal of Statistics in Medical Research 7 (May): 25–32. https://doi.org/10.6000/1929-6029.2018.07.02.1.

Schwartz, Joel, and Antonella Zanobetti. 2000. “Using Meta-Smoothing to Estimate Dose-Response Trends Across Multiple Studies, with Application to Air Pollution and Daily Death.” Epidemiology 11 (6): 666–72.

Sorensen, Oystein, Andreas M. Brandmaier, Didac Macia, Klaus Ebmeier, Paolo Ghisletta, Rogier A. Kievit, Athanasia M. Mowinckel, Kristine B. Walhovd, Rene Westerhausen, and Anders Fjell. 2021. “Meta-Analysis of Generalized Additive Models in Neuroimaging Studies.” NeuroImage 224 (January): 117416. https://doi.org/10.1016/j.neuroimage.2020.117416.

Metadata

Version

0.4.0

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