-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.Rmd
executable file
·93 lines (65 loc) · 3.8 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
output: github_document
bibliography: ./inst/REFERENCES.bib
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
out.width = "100%"
)
devtools::load_all(".")
```
# metagam <img src="man/figures/logo.png" height=200 align="right"/>
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/metagam)](https://CRAN.R-project.org/package=metagam)
[![R-CMD-check](https://github.com/Lifebrain/metagam/workflows/R-CMD-check/badge.svg)](https://github.com/Lifebrain/metagam/actions)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Codecov test coverage](https://codecov.io/gh/Lifebrain/metagam/branch/master/graph/badge.svg)](https://app.codecov.io/gh/Lifebrain/metagam?branch=master)
[![R-CMD-check](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
## 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 @Sorensen2021, extending upon previous works by @Schwarz2000 and @Crippa2018.
Currently, GAMs objects created with the following functions are supported:
- From package [mgcv](https://cran.r-project.org/package=mgcv): `bam()`, `gam()` and `gamm()`.
- From package [gamm4](https://cran.r-project.org/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](https://github.com/lifebrain/metagam/issues) or opening a [Pull Request](https://github.com/lifebrain/metagam/pulls).
## Installation
Install the current release of metagam from [CRAN](https://cran.r-project.org/) with:
```{r,eval=FALSE}
install.packages("metagam")
```
Install the current development version of `metagam` from [GitHub](https://github.com/) with:
```{r,eval=FALSE}
# install.packages("remotes")
remotes::install_github("lifebrain/metagam")
```
## Application Example
```{r}
library("metagam")
library("mgcv")
```
Simulate three datasets and fit a GAM to each of them. Then use `strip_rawdata()` from metagam to remove individual participant data.
```{r}
## 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()`.
```{r}
meta_analysis <- metagam(models)
summary(meta_analysis)
```
For further documentation and vignettes, please visit the [package website](https://lifebrain.github.io/metagam/).
## Code of Conduct
Please note that the metagam project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html). By contributing to this project, you agree to abide by its terms.
## References