| itsadug {itsadug} | R Documentation |
Interpreting Time Series, Autocorrelated Data Using GAMMs (itsadug)
Description
Itsadug provides a set of functions that facilitate the evaluation,
interpretation, and visualization of GAMM models that are implemented in
the package mgcv.
Tutorials
-
vignette('inspect', package='itsadug')- summarizes different functions for visualizing the model. -
vignette('test', package='itsadug')- summarizes different functions for significance testing. -
vignette('acf', package='itsadug')- summarizes how to check and account for autocorrelation in the residuals.
Also available online on https://www.jacolienvanrij.com.
Interpretation and visualization
Main functions that are provided in itsadug for interpretation and
visualization of GAMM models:
-
pvisgamplots partial interaction surfaces; it also allows for visualizing 3-way or higher interactions. -
fvisgamplots summed interaction surfaces, with the possibility to exclude random effects. -
plot_smoothplots 1D model estimates, and has the possibility to exclude random effects. -
plot_parametricplot group estimates. -
inspect_randomplots and optionally averages random smooths -
plot_dataplots the data -
plot_topoplots EEG topographies
Testing for significance
-
compareMLPerforms Chisquare test on two models -
plot_diffCalculates and visualizes the difference between two conditions within a model -
plot_diff2Calculates and visualizes the 2 dimensional difference between two conditions within a model
Evaluation of the model
-
check_residplots four different plots to inspect the distribution of and structure in the residuals -
plot_modelfitplots an overlay of the data and the modelfit for randomly selected trials -
diagnosticsproduces plots of the distributions of residuals and predictors in the model
Checking and handling autocorrelation
-
acf_residdifferent ways to inspect autocorrelation in the residuals -
start_eventcreates an AR.start column -
resid_gamreturns residuals corrected for the AR1 model
Predictions
Further, there are some wrappers around the predict.gam
function to facilitate the extraction of model predictions. These can be
used for customized plots. See for an example in the vignette
'plotfunctions'
(vignette('plotfunctions', package='itsadug')).
-
get_predictionsfor getting the estimates for given settings of some or all of the model predictors; -
get_differencefor extracting the difference between two conditions or two smooths or two surfaces. -
get_modeltermfor extracting the smooth term ( partial) estimates. -
inspect_randomandget_randomfor extracting random effects only.
Notes
Use
infoMessages(FALSE)to suppress all information messages for the current session. This may be helpful when creating knitr or R markdown reports.The vignettes are available via
browseVignettes(). When working on a server via the command line, usingssh -Xinstead ofsshmay make the HTML files available.A list of all available functions is provided in
help(package='itsadug').
Author(s)
Jacolien van Rij, Martijn Wieling, R.Harald Baayen, Hedderik van Rijn
Maintainer: Jacolien van Rij (vanrij.jacolien@gmail.com)
University of Groningen, The Netherlands