knitr::opts_chunk$set(fig=TRUE, warning=FALSE, message=FALSE, eval=TRUE, cache=FALSE, comment = '#>', collapse=TRUE, dev='png')
MRSea
stands for Marine Renewables Strategic Environmental Assessment. and the package was developed for analysing data that was collected for assessing potential impacts of renewable developments on marine wildlife, although the methods are applicable to any studies where you wish to fit uni or bivariate smooths.
The package enables the fitting of spatially adaptive regression splines using two Spatially Adaptive Local Smoothing Algorithms (SALSA):
For additional information regarding the methods see the Publications Page
The main modelling functions are runSALSA1D
and runSALSA2D
, which implement the methods for univariate and then bivariate smoothing and these produce models of the class gamMRSea
.
Other functions include diagnostics (to assess residual correlation: runACF
, smooth relationships: runPartialPlots
and model selection (ANOVA) for robust standard errors: anova.gamMRSea
) and inference (do.bootstrap.cress
).
Example of the modelling process using MRSea
. Packages with functions to run certain parts are given in oval boxes. To complete the modelling process, other packages may be used at certain stages. These are coded light blue, whilst MRSea
functions are in red.
For information on using the package see here for a list of examples and tutorials.
knitr::include_url("https://lindesaysh.github.io/MRSea/articles/website_examples.html")
glm
to gamMRSea
glm
model into an gamMRSea
objectThis can be done using the make.gamMRSea
function. Here we use the fullmodel
which is a glm
model with family='poisson'
library(MRSea) data("nysted.analysisdata") fit <- glm(response ~ season + depth, family="quasipoisson", data = nysted.analysisdata)
fullModel.gamMRSea <- make.gamMRSea(fit, gamMRSea = TRUE)
summary(fullModel.gamMRSea)
Note that there is an extra column for robust standard errors but that they are the same as the raw ones. No panel structure has been specified and this is shown at the bottom of the output Max Panel Size = 1
.
Additionally, if you choose to fit the SALSA or GLM models without a panel structure, the make.gamMRSea
function can be used to add a panel structure afterwards. Note that now in the summary output, the robust standard error column is different to the raw standard errors as they have been adjusted for any correlation seen in the panels. The output shows that the maximum panel size is now 54 and there are 208 panels.
fit.robustse <- make.gamMRSea(fit, gamMRSea = TRUE, panelid = nysted.analysisdata$transect.id)
summary(fit.robustse)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.