Hierarchical generalized additive models: an introduction with mgcv
A peer-reviewed article of this Preprint also exists.
Author and article information
Abstract
In this paper, we discuss an extension to two popular approaches to modelling complex structures in ecological data: the generalized additive model (GAM) and the hierarchical model (HGLM). The hierarchical GAM (HGAM), allows modelling of nonlinear functional relationships between covariates and outcomes where the shape of the function itself varies between different grouping levels. We describe the theoretical connection between these models, HGLMs and GAMs, explain how to model different assumptions about the degree of inter-group variability in functional response, and show how HGAMs can be readily fitted using existing GAM software, the mgcv package in R. We also discuss computational and statistical issues with fitting these models, and demonstrate how to fit HGAMs on example data.
Cite this as
2018. Hierarchical generalized additive models: an introduction with mgcv. PeerJ Preprints 6:e27320v1 https://doi.org/10.7287/peerj.preprints.27320v1Author comment
This is a submission to PeerJ for review.
Sections
Supplemental Information
Supplementary tutorial code to reproduce examples in text
Additional Information
Competing Interests
Eric Pedersen is an employee of Fisheries and Oceans Canada, and Noam Ross is employed by Ecohealth Alliance, a non-profit organization.
Author Contributions
Eric J Pedersen conceived and designed the experiments, performed the experiments, analyzed the data, prepared figures and/or tables, authored or reviewed drafts of the paper, approved the final draft.
David L. Miller conceived and designed the experiments, prepared figures and/or tables, authored or reviewed drafts of the paper, approved the final draft.
Gavin L. Simpson conceived and designed the experiments, prepared figures and/or tables, authored or reviewed drafts of the paper, approved the final draft.
Noam Ross conceived and designed the experiments, prepared figures and/or tables, authored or reviewed drafts of the paper, approved the final draft.
Data Deposition
The following information was supplied regarding data availability:
All data and code for this paper are available via Github at:
Funding
This work was partially funded by Fisheries and Oceans Canada, National Science and Engineering Research Council of Canada (NSERC) Discovery Grant (RGPIN-2014-04032) and by OPNAV N45 and the SURTASS LFA Settlement Agreement, managed by the U.S. Navy's Living Marine Resources program under Contract No. N39430-17-C-1982. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.