| Contributors | Affiliation | Role |
|---|---|---|
| Nelson, James | University of Louisiana at Lafayette | Principal Investigator, Contact |
| Leavitt, Herbert | University of Louisiana at Lafayette | Student |
| Thomas, Alexander | University of Louisiana at Lafayette | Student |
| Soenen, Karen | Woods Hole Oceanographic Institution (WHOI BCO-DMO) | BCO-DMO Data Manager |
No raw data is included in this dataset. For collection methods of data used in this analysis, please refer to methods outlined in the linked datasets. The key for species codes can be found in the related dataset with DOI:10.26008/1912/bco-dmo.947784.1 (see related datasets section).
The data processing pipeline for this analysis begins with the preparation of input datasets, which include habitat data derived from satellite imagery and community composition data. The habitat data files, such as google2022_edge[edge]_buf[buffer].csv, contain spatial metrics including mangrove edge length, land-water ratios, and percent edge cover. The community composition data, PtFouSept2022count_ns.csv, provides site-specific counts for the target species (e.g., Litopenaeus setiferus, abbreviated as PENSET) along with environmental variables like salinity, temperature, and geographic coordinates. These datasets are merged using a common identifier (site_date_key) to align spatial and ecological information.
Once merged, all predictor variables, such as % mangrove edge and % land-water ratio, are standardized by subtracting the mean and dividing by the standard deviation to ensure consistent scaling. A correlation matrix is computed to identify and exclude highly correlated predictor pairs (correlation > 0.8) to reduce multicollinearity in subsequent models. The core modeling process is conducted by the model_compile function, which iterates over combinations of buffer radii (100–600 m or satscale, 20–150 m for smallscale) and edge distances (1, 3, 5 m) to assess species-habitat relationships. For each combination, spatial metrics are calculated, and generalized additive models (GAMs) are fitted using subsets of predictors. Knots for all GAM models were limited to k=4 to limit overfitting. Models with correlated variables are excluded, and the remaining models are ranked by Akaike Information Criterion (AIC). The best models within two AIC points of the top model are recorded, capturing their formula, AIC, buffer, and edge values.
For each candidate model retained within the AIC threshold, cross-validated predictive performance is assessed using the cv_gam_performance function. This function performs repeated k-fold cross-validation (k=5 folds, 10 repeats), randomly partitioning the data into training and test sets across each repeat. For each fold, the GAM is refitted on the training subset and predictions are generated on the held-out test set. Performance metrics—cross-validated mean squared error (cv_MSE), root mean squared error (cv_RMSE), mean absolute error (cv_MAE), and R² (cv_R²)—are computed by pooling predictions across all folds and repeats. These metrics are appended to the model results table alongside AIC and in-sample R².
Following model compilation, candidate models are subjected to DHARMa residual diagnostics via the check_dharma_rtab function to assess whether the chosen error distribution is appropriate. For each candidate model, the GAM is refitted and 500 simulated residual sets are generated using DHARMa's simulateResiduals. Three tests are then applied to the simulated residuals: a KS test for uniformity (testUniformity), a dispersion test (testDispersion), and a zero-inflation test (testZeroInflation). Any model for which one or more tests returns p < 0.05 is flagged as a failure. Models are initially fitted using a Tweedie distribution; if three or more candidate models fail DHARMa checks, the pipeline automatically falls back to a Negative Binomial distribution and reruns model compilation and DHARMa checking. Failing models are dropped from the candidate set prior to further analysis. If both distributions produce too many failures, the pipeline halts with an error. This process outputs several files.
The top model is then identified based on its frequency of selection across all scales, with cv_R² used as a tiebreaker when two models appear equally often, and is saved for further analysis. Using this top model, the univariate_edge function evaluates individual predictor performance across scales. Residuals are examined for spatial autocorrelation using Moran's I test, and the significance of predictors, including their interactions (e.g., mangrove edge × land-water ratio), is assessed. These results are consolidated and saved in outputs_over_scales.csv.
Visualization and diagnostics follow, with both in-sample R² and cross-validated R² plotted across buffer sizes and edge distances to identify the habitat scale with the strongest explanatory power. Key predictors, such as mangrove edge and percent edge cover, are visualized in relation to species abundance, with significance indicated by custom point shapes (determined using a threshold of p < 0.05). At the best scale, relationships between key variables and predicted species abundance are visualized, while residual and diagnostic plots (e.g., Cook's distance) are used to assess model fit. Predictions from the top model are compared to observed counts to validate performance.
The final outputs of this pipeline include several CSV files and visualizations. The species_aic files show the AIC scores for all the models considered for each species at each scale. The model_list files list all models that were within 2 points of the lowest AIC score for each set. The model_compare file shows how many times a particular model occurs within model_list along with its mean cv_R² value. The topmodel.txt file contains the formula for the GAM model that was ultimately selected for further analysis. The output_over_scales.csv file summarizes model results across scales, including R² values, p-values, and significant predictors. Visualizations include plots of both in-sample and cross-validated R² across scales, relationships between predictors and species abundance, and diagnostic plots for residuals and influential observations. This comprehensive pipeline rigorously evaluates the influence of spatial metrics on species abundance, identifying the optimal habitat scale for common species in Port Fourchon, LA.
This analysis was performed in R version 4.3.2. Relevant packages in this analysis are as follows: mgcv_1.9-0, nlme_3.1-163, gam_1.22-4, foreach_1.5.2, spdep_1.3-5, sf_1.0-16, spData_2.3.1, DHARMa_0.4.6, lubridate_1.9.3, forcats_1.0.0, stringr_1.5.1, dplyr_1.1.4, purrr_1.0.2, readr_2.1.4, tidyr_1.3.0, tibble_3.2.1, ggplot2_3.5.1, tidyverse_2.0.0, scales_1.3.0, statmod_1.5.0, pscl_1.5.9 loaded via a namespace (and not attached): gtable_0.3.4, lattice_0.21-9, tzdb_0.4.0, vctrs_0.6.5, tools_4.3.2, generics_0.1.3, proxy_0.4-27, fansi_1.0.5, pkgconfig_2.0.3, Matrix_1.6-1.1, KernSmooth_2.23-22, lifecycle_1.0.4, compiler_4.3.2, farver_2.1.1, deldir_2.0-4, munsell_0.5.0, codetools_0.2-19, class_7.3-22, pillar_1.9.0, crayon_1.5.2, MASS_7.3-60, classInt_0.4-10, wk_0.9.1, iterators_1.0.14, boot_1.3-28.1, tidyselect_1.2.1, stringi_1.8.2, labeling_0.4.3, grid_4.3.2, colorspace_2.1-0, cli_3.6.1, magrittr_2.0.3, utf8_1.2.4, e1071_1.7-14, withr_3.0.2, sp_2.1-3, timechange_0.2.0, hms_1.1.3, viridisLite_0.4.2, s2_1.1.6, rlang_1.1.2, Rcpp_1.0.11, glue_1.6.2, DBI_1.1.3, rstudioapi_0.15.0, R6_2.5.1, units_0.8-5
* Created zip files for submitted datasets
Version History - Version 2: Reviewers asked to calculate some additional metrics, mainly the cross-validated Rsq value, for each model. As such, model selection methods and model outputs changed, which inspired the update. There aren't any new datasets in the update, just a few new columns, and some different final model results.
| File |
|---|
species_aic.zip (ZIP Archive (ZIP), 146.19 KB) MD5:2e260c84109a662aaa71d9f6446c7fba AIC scores for all models tested at every permutation for every species. naming convention is: species code, "_", scale of analysis, "edge", edge distance (m), "buf", buffer distance (m). Parameterscolumn name,description,units,missing data identifierformula,formula of the candidate GAM model,no units,no missing valuesaic,Akaike Information Criterion value for the candidate model,no units,no missing valuesr.sq,adjusted R-squared from the fitted GAM,no units,no missing values |
output_over_scale.zip (ZIP Archive (ZIP), 33.96 KB) MD5:8163a84aa386addbeefdaaffb877158a Tables that show selected model (as seen in the top_model.txt file corresponding to the species and analysis) outputs over all scales in the analysis. naming convention follows: analysis scale, "_", species code, "output_over_scales.csv"Parameterscolumn name,description,units,missing data identifieredge,distance from the marsh edge in meters used to define edge habitat (1, 3, or 5),meters,no missing valuesbuffer,radius of habitat region around the sample site used to aggregate habitat data,meters,no missing valuessp,species code for the current analysis,no units,no missing valuesr_sq,the average adjusted GAM r-squared value over all scales,no units,no missing valuesdev_ex,deviance in response variable explained by the model,no units,no missing valuesmoran_p,p-value for Moran's I test of spatial autocorrelation in model residuals,no units,no missing valuescov,column indicating presence of covariance between variables; -Inf indicates no covariance,no units,no missing valuescv_R2,cross-validated R² computed from repeated k-fold cross-validation (k=5 folds repeated 10 times); values pooled across all folds and repeats,no units,no missing valuescv_RMSE,cross-validated root mean squared error from repeated k-fold cross-validation,response variable units,no missing valuescv_MAE,cross-validated mean absolute error from repeated k-fold cross-validation,response variable units,no missing valuescv_MSE,cross-validated mean squared error from repeated k-fold cross-validation,response variable units squared,no missing valuesp.edge_perc,p-value for the smooth term for % edge habitat,no units,no missing valuesp.edge_l.mangrove,p-value for the smooth term for % mangrove habitat,no units,no missing valuesp.land_water_ratio,p-value for the smooth term for % land-water ratio,no units,no missing valuesp.man_lwr,p-value for the tensor interaction of % mangrove and % land-water ratio,no units,no missing valuesp.man_edge,p-value for the tensor interaction of % mangrove and % edge,no units,no missing valuesedf.edge_perc,estimated degrees of freedom for the edge_perc smooth term; values near 1 indicate near-linear relationships,no units,no missing valuesedf.edge_l.mangrove,estimated degrees of freedom for the edge_l.mangrove smooth term; values near 1 indicate near-linear relationships,no units,no missing valuesedf.land_water_ratio,estimated degrees of freedom for the land_water_ratio smooth term; values near 1 indicate near-linear relationships,no units,no missing valuesedf.man_lwr,estimated degrees of freedom for the tensor interaction of % mangrove and % land-water ratio,no units,no missing valuesedf.man_edge,estimated degrees of freedom for the tensor interaction of % mangrove and % edge,no units,no missing values |
topmodel.zip (ZIP Archive (ZIP), 2.59 KB) MD5:063bcf3afa0a5c617c9535eddaea7e62 Text files with the formula of the top model chosen for the analysis for each species at each analysis scale. Naming convention is: analysis scale, species code, "_topmodel". |
model_comparison.zip (ZIP Archive (ZIP), 5.61 KB) MD5:3522b9bac3d3489cf9cfd7bde070463e Statistical intermediate that compares the number of times a given model was within 2AIC points of the lowest AIC score for that scale. The model that is selected as having the lowest AIC score most often is ultimately selected as the 'best' model and used to study variable effects over scale. Naming scheme is: scale of analysis, species code, "model_comparison". Parameterscolumn name,description,units,missing data identifierbest_model,formula of the candidate GAM model,no units,no missing valuescount,number of buffer/edge combinations for which this model was selected within 2 AIC points of the top model,no units,no missing valuescv_R2,mean cross-validated R² across all buffer/edge combinations where this model was selected,no units,no missing valuesmean_bufer,mean buffer radius across all buffer/edge combinations where this model was selected,meters,no missing values |
model_lists.zip (ZIP Archive (ZIP), 77.17 KB) MD5:b503e0ae664fe687aab7837d6876f330 List of models that were determined to be within 2 AIC points of the best model for each permutation of edge and buffer. Parameterscolumn name,description,units,missing data identifieredge,distance from the marsh edge in meters used to define edge habitat (1, 3, or 5),meters,no missing valuesbuffer,radius of habitat region around the sample site used to aggregate habitat data,meters,no missing valuessp,species code for the current analysis,no units,no missing valuesbest_model,formula of the candidate GAM model,no units,no missing valuesaic,Akaike Information Criterion value for the candidate model,no units,no missing valuesr.sq,adjusted R-squared from the fitted GAM,no units,no missing valuescv_MSE,cross-validated mean squared error from repeated k-fold cross-validation (k=5),response variable units squared,no missing valuescv_RMSE,cross-validated root mean squared error from repeated k-fold cross-validation (k=5),response variable units,no missing valuescv_MAE,cross-validated mean absolute error from repeated k-fold cross-validation (k=5),response variable units,no missing valuescv_R2,cross-validated R² from repeated k-fold cross-validation (k=5); values pooled across all folds and repeats,no units,no missing values |
spatial_analysis_across_scales.R (R Script, 147.02 KB) MD5:f762a9adc9ad42166cb7e4ecd30d2582 main code file, takes inputs from linked datasets and produces outputs shown here |
NSF Award Abstract:
Coastal marshes provide a suite of vital functions that support natural and human communities. Humans frequently take for granted and exploit these ecosystem services without fully understanding the ecological feedbacks, linkages, and interdependencies of these processes to the wider ecosystem. As demands on coastal ecosystem services have risen, marshes have experienced substantial loss due to direct and indirect impacts from human activity. The rapidly changing coastal ecosystems of Louisiana provide a natural experiment for understanding how coastal change alters ecosystem function. This project is developing new metrics and tools to assess food web variability and test hypotheses on biodiversity and ecosystem function in coastal Louisiana. The research is determining how changing habitat configuration alters the distribution of energy across the seascape in a multitrophic system. This work is engaging students from the University of Louisiana Lafayette and Dillard University in placed-based learning by immersing them in the research and local restoration efforts to address land loss and preserve critical ecosystem services. Students are developing a deeper understanding of the complex issues facing coastal regions through formal course work, directed field work, and outreach. Students are interacting with stakeholders and managers who are currently battling coastal change. Their directed research projects are documenting changes in coastal habitat and coupling this knowledge with the consequences to ecosystems and the people who depend on them. By participating in the project students are emerging with knowledge and training that is making them into informed citizens and capable stewards of the future of our coastal ecosystems, while also preparing them for careers in STEM. The project is supporting two graduate students and a post-doc.
The transformation and movement of energy through a food web are key links between biodiversity and ecosystem function. A major hurdle to testing biodiversity ecosystem function theory is a limited ability to assess food web variability in space and time. This research is quantifying changing seascape structure, species diversity, and food web structure to better understand the relationship between biodiversity and energy flow through ecosystems. The project uses cutting edge tools and metrics to test hypotheses on how the distribution, abundance, and diversity of key species are altered by ecosystem change and how this affects function. The hypotheses driving the research are: 1) habitat is a more important indirect driver of trophic structure than a direct change to primary trophic pathways; and 2) horizontal and vertical diversity increases with habitat resource index. Stable isotope analysis is characterizing energy flow through the food web. Changes in horizontal and vertical diversity in a multitrophic system are being quantified using aerial surveys and field sampling. To assess the spatial and temporal change in food web resources, the project is combining results from stable isotope analysis and drone-based remote sensing technology to generate consumer specific energetic seascape maps (E-scapes) and trophic niche metrics. In combination these new metrics are providing insight into species’ responses to changing food web function across the seascape and through time.
This project is jointly funded by Biological Oceanography and the Established Program to Stimulate Competitive Research (EPSCoR).
This award reflects NSF's statutory mission and has been deemed worthy of support through evaluation using the Foundation's intellectual merit and broader impacts review criteria.
| Funding Source | Award |
|---|---|
| NSF Division of Ocean Sciences (NSF OCE) |