DOI: 10.5061/dryad.rv15dv4fv
title: Replicate analysis from: tinyVAST: R package with an expressive interface to specify lagged and simultaneous effects in multivariate spatio-temporal models

description: Aim Multivariate spatio-temporal models are widely applicable, but
 specifying their structure is complicated and may inhibit wider
 use.  We introduce the R package tinyVAST from two viewpoints:
 the software user and the statistician.  Innovation From the user
 viewpoint, tinyVAST adapts a widely used formula interface to specify
 generalized additive models, and combines this with arguments to specify
 spatial and spatio-temporal interactions among variables. These
 interactions are specified using arrow notation (from structural equation
 models), or an extended arrow-and-lag notation that allows simultaneous,
 lagged, and recursive dependencies among variables over time. 
 The user also specifies a spatial domain for areal (gridded), continuous
 (point-count), or stream-network data. From the statistician's
 viewpoint, tinyVAST constructs sparse precision matrices representing
 multivariate spatio-temporal variation, and parameters are estimated by
 specifying a generalized linear mixed model (GLMM).  This
 expressive interface encompasses vector autoregressive, empirical
 orthogonal functions, spatial factor analysis, and ARIMA models. 
 Main conclusion To demonstrate, we fit the data from two survey platforms
 sampling corals, sponges, rockfishes, and flatfishes in the Gulf of Alaska
 and Aleutian Islands. We then compare eight alternative model structures
 using different assumptions about habitat drivers and survey
 detectability. Model selection suggests that towed-camera and bottom trawl
 gears have spatial variation in detectability but sample the same
 underlying density of flatfishes and rockfishes, and that rockfishes are
 positively associated with sponges while flatfishes are negatively
 associated with corals.  We conclude that tinyVAST can be used to
 test complicated dependencies representing alternative structural
 assumptions for research and real-world policy evaluation. 
description: # Replicate analysis from: tinyVAST: R package with an expressive
 interface to specify lagged and simultaneous effects in multivariate
 spatio-temporal models
 [https://doi.org/10.5061/dryad.rv15dv4fv](https://doi.org/10.5061/dryad.rv15dv4fv) Code and data required to replicate analyses. ## Description of the data and file structure Data files include: 1. goaai_outline.xxx -- files with extensions ".shp", ".dbf", ".prj", and ".shx" representing a shapefile with the spatial domain for the case-study example using projection CRS "+proj=natearth +lon_0=-170 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs" 2. Formatted_data.csv -- A CSV containing all data used in the case study analysis. This contains the following columns: * Categorical variable "Year": with values "camera" (for when the camera survey was conducted), or "1990-2019" (indicating the calendar year for bottom trawl surveys) * Integer variable "Count": indicating the count of a given taxon in that sample * Categorical variable "Group4": with six levels, indicating whether the sample was "Coral" and "Sponge" (corals and sponges in the camera survey), "Flat" and "Rock" (aggregated flatfishes and rockfishes in the camera survey), or "Flat" and "Rock" (aggregated flatfishes and rockfishes in the bottom trawl survey) * Numeric variable "X": Location for sample in X coordinates using same projection as shapefile * Numeric variable "Y": Location for sample in Y coordinates using same projection as shapefile * Numeric variable "depth_km": Depth for the seafloor at the location of the sample, in km * Numeric variable "AreaSwept": Area swept by a sample in Hectares * Categorical variable "time": Dummy column with single level "constant" ## Sharing/Access information Code and data versions are publicly available: * See "Formatted_data.csv" described above. * See "Code/Software" section below. Data was derived from the following sources: * The Gulf of Alaska and Aleutian Islands bottom trawl survey conducted by the Alaska Fisheries Science Center * The Deep Sea Coral drop camera survey conducted by the Alaska Fisheries Science Center ## Code/Software Code files include: 1. Reprex_code_R1.R -- An R script that can replicate analyses 2. tinyVAST_1.0.0.zip -- A copy of the R-package required, which includes LICENCE information. Up to date versions are available via CRAN ([https://cran.r-project.org/web/packages/tinyVAST/index.html](https://cran.r-project.org/web/packages/tinyVAST/index.html)) and GitHub ([https://github.com/vast-lib/tinyVAST](https://github.com/vast-lib/tinyVAST))