DOI: 10.15482/usda.adc/1529826
title: Data and code from: Stem borer herbivory dependent on interactions of sugarcane variety, associated traits, and presence of prior borer damage

description: This dataset contains all the data and code needed to reproduce the analyses in the manuscript:
Penn, H. J., & Read, Q. D. (2023). Stem borer herbivory dependent on interactions of sugarcane variety, associated traits, and presence of prior borer damage. Pest Management Science. https://doi.org/10.1002/ps.7843
Included are two .Rmd notebooks containing all code required to reproduce the analyses in the manuscript, two .html file of rendered notebook output, three .csv data files that are loaded and analyzed, and a .zip file of intermediate R objects that are generated during the model fitting and variable selection process.
Notebook files

01_boring_analysis.Rmd: This RMarkdown notebook contains R code to read and process the raw data, create exploratory data visualizations and tables, fit a Bayesian generalized linear mixed model, extract output from the statistical model, and create graphs and tables summarizing the model output including marginal means for different varieties and contrasts between crop years.
02_trait_covariate_analysis.Rmd: This RMarkdown notebook contains R code to read raw variety-level trait data, perform feature selection based on correlations between traits, fit another generalized linear mixed model using traits as predictors, and create graphs and tables from that model output including marginal means by categorical trait and marginal trends by continuous trait.

HTML files
These HTML files contain the rendered output of the two RMarkdown notebooks. They were generated by Quentin Read on 2023-08-30 and 2023-08-15.

01_boring_analysis.html
02_trait_covariate_analysis.html

CSV data files
These files contain the raw data. To recreate the notebook output the CSV files should be at the file path project/data/ relative to where the notebook is run. Columns are described below.

BoredInternodes_26April2022_no format.csv: primary data file with sugarcane borer (SCB) damage

Columns A-C are the year, date, and location. All location values are the same.
Column D identifies which experiment the data point was collected from.
Column E, Stubble, indicates the crop year (plant cane or first stubble)
Column F indicates the variety
Column G indicates the plot (integer ID)
Column H indicates the stalk within each plot (integer ID)
Column I, # Internodes, indicates how many internodes were on the stalk
Columns J-AM are numbered 1-30 and indicate whether SCB damage was observed on that internode (0 if no, 1 if yes, blank cell if that internode was not present on the stalk)
Column AN indicates the experimental treatment for those rows that are part of a manipulative experiment
Column AO contains notes


variety_lookup.csv: summary information for the 16 varieties analyzed in this study

Column A is the variety name
Column B is the total number of stalks assessed for SCB damage for that variety across all years
Column C is the number of years that variety is present in the data
Column D, Stubble, indicates which crop years were sampled for that variety ("PC" if only plant cane, "PC, 1S" if there are data for both plant cane and first stubble crop years)
Column E, SCB resistance, is a categorical designation with four values: susceptible, moderately susceptible, moderately resistant, resistant
Column F is the literature reference for the SCB resistance value


Select_variety_traits_12Dec2022.csv: variety-level traits for the 16 varieties analyzed in this study

Column A is the variety name
Column B is the SCB resistance designation as an integer
Column C is the categorical SCB resistance designation (see above)
Columns D-I are continuous traits from year 1 (plant cane), including sugar (Mg/ha), biomass or aboveground cane production (Mg/ha), TRS or theoretically recoverable sugar (g/kg), stalk weight of individual stalks (kg), stalk population density (stalks/ha), and fiber content of stalk (percent).
Columns J-O are the same continuous traits from year 2 (first stubble)
Columns P-V are categorical traits (in some cases continuous traits binned into categories): maturity timing, amount of stalk wax, amount of leaf sheath wax, amount of leaf sheath hair, tightness of leaf sheath, whether leaf sheath becomes necrotic with age, and amount of collar hair.



ZIP file of intermediate R objects
To recreate the notebook output without having to run computationally intensive steps, unzip the archive. The fitted model objects should be at the file path project/ relative to where the notebook is run.

intermediate_R_objects.zip: This file contains intermediate R objects that are generated during the model fitting and variable selection process. You may use the R objects in the .zip file if you would like to reproduce final output including figures and tables without having to refit the computationally intensive statistical models.

binom_fit_intxns_updated_only5yrs.rds: fitted brms model object for the main statistical model
binom_fit_reduced.rds: fitted brms model object for the trait covariate analysis
marginal_trends.RData: calculated values of the estimated marginal trends with respect to year and previous damage
marginal_trend_trs.rds: calculated values of the estimated marginal trend with respect to TRS
marginal_trend_fib.rds: calculated values of the estimated marginal trend with respect to fiber content