Skip to content

Repository files navigation

Summary

This repository is a documentation repository that accompanies the FSSgam software paper: Fisher R, Wilson SK, Sin TM, Lee AC, Langlois TJ. A simple function for full-subsets multiple regression in ecology with R, published in the journal Ecology and Evolution in 2018 (2018;8:6104–6113).

Here we provide documentation, FAQs, R code to run the case studies outlined in the original publication, as well as some additional examples of usage.

Project website & documentation:
https://beckyfisher.github.io/FSSgam

R package source code:
https://github.com/beckyfisher/FSSgam_package

Full function-level documentation is available at https://beckyfisher.github.io/FSSgam_package/reference/.

Installation

The FSSgam package depends on a number of standard R packages for generalised additive modelling and model selection.

All examples on this site are built and tested using current versions of R and the package dependencies via continuous integration.

To install the latest version from github use:

if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}
remotes::install_github("beckyfisher/FSSgam_package")

That installs the default branch of the package repository, which is dev. The vignettes on this site are built against that same branch, so what you install is what produced the results shown here. To install a specific state instead, name a branch or a tag:

remotes::install_github("beckyfisher/FSSgam_package", ref = "master")

Check which version you have with packageVersion("FSSgam"), and see the package's NEWS for what changed between versions. Results can differ between versions: the case study 2 vignette records one such change and its cause.

Fitting through gamm4, by way of MuMIn::uGamm(lme4 = TRUE), needs one further step. As of FSSgam 1.1.0 gamm4 is a suggested rather than an imported package, so installing FSSgam no longer installs gamm4 and lme4 with it. Install gamm4 separately if you need that route, as the extra examples vignette does:

install.packages("gamm4")

Citation

If you use FSSgam or results derived from it, please cite:

Fisher R, Wilson SK, Sin TM, Lee AC, Langlois TJ (2018).
A simple function for full-subsets multiple regression in ecology with R.
Ecology and Evolution, 8(12), 6104–6113.
https://doi.org/10.1002/ece3.4134

Bug reports

If you find a bug, have a question, or would like to suggest an improvement,
please report it via the GitHub issue tracker.

Background

Full subsets information theoretic approaches are becoming an increasingly popular tool for exploring predictive power and variable importance where a wide range of candidate predictors are being considered.

This repository contains a set of functions in the statistical programming language R that can be used to construct, fit and compare a complete model set of possible ecological or environmental predictors, given a response variable of interest. The function is based on Generalized Additive Models (GAM) and builds on the MuMIn package.

These functions have since been moved to an R package FSSgam, that can be easily installed from github (see below, [https://github.com/beckyfisher/FSSgam_package]).

Advantages include the capacity to fit more predictors than there are replicates, automatic removal of models with correlated predictors, and model sets that include interactions between factors and smooth predictors, as well as smooth interactions with other smooths (via t2).

The function(s) take a range of arguments that allow control over the model set being constructed, including specifying cyclic and linear continuous predictors, specification of the smoothing algorithm used and the maximum complexity allowed for smooth terms.

The use of the package is demonstrated via case studies that highlight how appropriate model sets can be easily constructed, and the broader utility of the approach for exploratory ecology.

known issues

This package assumes you know what you are doing. Non-gaussian mixed model gamm resorts to PQL meaning that AICc calls will not return the AIC of the actual model. Please thoroughly read the help files contained within the gamm4 and mgcv packages, including information under details.

GAMM is highly sensitive to the spread of your predictors, so please check those carefully ensuring a robust range of values and that there are no gaps.

License

The code is released under the Apache License 2.0

Copyright 2020 Australian Institute of Marine Science

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at 

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

The contents of publication/ are not covered by the Apache License. They are reproduced from the published article and its supporting information:

Fisher R, Wilson SK, Sin TM, Lee AC, Langlois TJ (2018). A simple function for full-subsets multiple regression in ecology with R. Ecology and Evolution, 8(12), 6104–6113. https://doi.org/10.1002/ece3.4134

© 2018 The Authors. Ecology and Evolution published by John Wiley & Sons Ltd. The article is open access under the terms of the Creative Commons Attribution 4.0 International License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited. These files are redistributed here under that licence, with attribution given above.

About

Code for full subsets model fitting using GA(M)M

Resources

Stars

17 stars

Watchers

6 watching

Forks

Releases

Packages

Contributors

Languages