Skip to main navigation Skip to search Skip to main content

A versatile workflow for linear modelling in R

  • Matteo Santon*
  • , Fränzi Korner-Nievergelt
  • , Nico K. Michiels
  • , Nils Anthes
  • *Corresponding author for this work

Research output: Contribution to journal › Article (Academic Journal) › peer-review

56 Citations (Scopus)

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 (Generalised) Linear (Mixed) Model analyses using the glmmTMB package. 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. Focussed 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.
Original languageEnglish
Article number1065273
JournalFrontiers in Ecology and Evolution
Volume11
DOIs
Publication statusPublished - 24 Apr 2023

Bibliographical note

Funding Information:
This work was supported by the Engineering and Physical Sciences Research Council [grant number EP/X020819/1 awarded to MS].

Funding Information:
The development of this workflow has greatly profited from students and researchers who shared their unpublished datasets and provided feedback on the routine: Fabian Anger, Jonathan Bauder, Felix Deiss, Leonie John, Thomas Kimmich, Stefanie Krais, Franziska Lehle, Laura-Sophia Limmer, Franziska Mück, Katharina Peschke, Federica Poli, Anaelle Regen, and Bram van der Schoot. We further thank Xavier Harrison, Jakob Katzenberger, Roger Mundry, and Eric Jason Pedersen for insightful comments that improved the quality of this work.

Publisher Copyright:
Copyright © 2023 Santon, Korner-Nievergelt, Michiels and Anthes.

Keywords

  • GLMM
  • glmmTMB
  • linear models
  • model assessment
  • residual analysis
  • data simulation

Fingerprint

Dive into the research topics of 'A versatile workflow for linear modelling in R'. Together they form a unique fingerprint.

Cite this