AUTHOR=Santon Matteo , Korner-Nievergelt Fränzi , Michiels Nico K. , Anthes Nils TITLE=A versatile workflow for linear modelling in R JOURNAL=Frontiers in Ecology and Evolution VOLUME=11 YEAR=2023 URL=https://www.frontiersin.org/journals/ecology-and-evolution/articles/10.3389/fevo.2023.1065273 DOI=10.3389/fevo.2023.1065273 ISSN=2296-701X ABSTRACT=

Linear models are applied widely to analyse empirical data. Modern software allows implementation of linear models with a few clicks or lines of code. While convenient, this increases the risk of ignoring essential assessment steps. Indeed, inappropriate application of linear models is an important source of inaccurate statistical inference. Despite extensive guidance and detailed demonstration of exemplary analyses, many users struggle to implement and assess their own models. To fill this gap, we present a versatile R-workflow template that facilitates (Generalized) Linear (Mixed) Model analyses. The script guides users from data exploration through model formulation, assessment and refinement to the graphical and numerical presentation of results. The workflow accommodates a variety of data types, distribution families, and dependency structures that arise from hierarchical sampling. To apply the routine, minimal coding skills are required for data preparation, naming of variables of interest, linear model formulation, and settings for summary graphs. Beyond that, default functions are provided for visual data exploration and model assessment. Focused on graphs, model assessment offers qualitative feedback and guidance on model refinement, pointing to more detailed or advanced literature where appropriate. With this workflow, we hope to contribute to research transparency, comparability, and reproducibility.