linear mixed-effects models

Done with convergence warnings? Publications that used allFit to compare optimisers

Post

A convergence warning from lme4 does not by itself show that a model is wrong. One check that the lme4 authors recommend is to refit the model with every available optimiser through allFit and compare the estimates that matter. This post records the candidate publications found by a reproducible search of Scopus, Europe PMC and OpenAlex, and explains why the list can only be a starting point for screening.

depictr: One visual language from first look to final figure

Post

Figures often change their visual language as an analysis moves from exploration to reporting. This post uses depictr to examine a simulated lexical-decision experiment, plot its mixed-model estimates, audit a figure and correct the accessibility problems that the audit finds.

pilotr: Pilot the study before running it

Post

A simulated semantic-priming study shows how precision, sign errors, magnitude errors and singular fits can be examined alongside power before choosing a design.

pilotr: Simulate experimental and behavioural data from a portable design specification

Software Package Web application

Simulation-based design analysis from a portable R and Python specification.

FAQs on mixed-effects models

Post

Frequently asked questions about mixed-effects models, covering the necessity of random slopes, appropriate p-value calculation methods, parallelization limitations, convergence issues, and optimizer selection.

How to discretise the colour variable in sjPlot::plot_model into equally-sized intervals

Post

Custom functions that extend sjPlot to discretise continuous variables in interaction plots into equally-sized intervals (deciles or sextiles) that include minimum and maximum values, with legend counts showing sample sizes per level.

How to map more informative values onto fill argument of sjPlot::plot_model

Post

Custom function that extends sjPlot to display original categorical variable values in interaction plot legends instead of transformed values, facilitating clearer communication when using sum-coded or other transformed predictors.

How to visually assess the convergence of a mixed-effects model by plotting various optimizers

Post

A custom R function to create ggplot2 visualizations of fixed effects from models refitted with multiple optimizers using lme4's allFit function, enabling visual assessment of convergence validity in mixed-effects models.

A new function to plot convergence diagnostics from lme4::allFit()

Post

When a model has struggled to find enough information in the data to account for every predictor—especially for every random effect—, convergence warnings appear (Brauer & Curtin, 2018; Singmann & Kellen, 2019). In this article, I review the issue of convergence before presenting a new plotting function in R that facilitates the visualisation of the fixed effects fitted by different optimization algorithms (also dubbed optimizers).

Cannot open plots created with brms::mcmc_plot due to lack of discrete_range function

Post

I would like to ask for advice regarding some plots that were created using brms::mcmc_plot(), and cannot be opened in R now. The plots were created last year using brms 2.17.0, and were saved in RDS objects. The problem I have is that I cannot open the plots in R now because I get an error related to a missing function. I would be very grateful if someone could please advise me if they can think of a possible reason or solution.

Plotting two-way interactions from mixed-effects models using alias variables

Post

Custom function extending sjPlot that plots interactions between continuous and categorical variables while replacing categorical variables with alias variables to facilitate back-transformation of sum-coded predictors for clearer result communication.

Plotting two-way interactions from mixed-effects models using ten or six bins

Post

Custom functions extending sjPlot for plotting interactions between two continuous variables by dividing one into ten bins (deciles) or six bins (sextiles), with optional sample size display in legend for individual differences research.

Why can't we be friends? Plotting frequentist (lmerTest) and Bayesian (brms) mixed-effects models

Post

Frequentist and Bayesian statistics are sometimes regarded as fundamentally different philosophies. Indeed, can both qualify as philosophies or is one of them just a pointless ritual? Is frequentist statistics only about p values? Are frequentist estimates diametrically opposed to Bayesian posterior distributions? Are confidence intervals and credible intervals irreconcilable? Will R crash if lmerTest and brms are simultaneously loaded?

Bayesian workflow: Prior determination, predictive checks and sensitivity analyses

Post

This post presents a run-through of a Bayesian workflow in R. The content is closely based on Bernabeu (2022), which was in turn based on lots of other references, also cited here.

Language and vision in conceptual processing: Multilevel analysis and statistical power

Publication

Research has suggested that conceptual processing depends on both language-based and vision-based information. We tested this interplay at three levels of the experimental structure: individuals, words and tasks. To this end, we drew on three …

Language and sensorimotor simulation in conceptual processing: Multilevel analysis and statistical power

Publication

Multilevel analyses investigating the interplay between language-based and vision-based information in conceptual processing across semantic priming, semantic decision and lexical decision paradigms, with power analyses revealing sample size requirements for examining perceptual simulation and individual differences.

Preregistration: The interplay between linguistic and embodied systems in conceptual processing

Publication

This preregistration outlines a study that will investigate the dynamic nature of conceptual processing by examining the interplay between linguistic distributional systems—comprising word co-occurrence and word association—and embodied systems—comprising sensorimotor and emotional information. A set of confirmatory research questions are addressed using data from the Calgary Semantic Decision project, along with additional measures for the stimuli corresponding to distributional language statistics, embodied information, and individual differences in vocabulary size.

Mixed-effects models in R and a new tool for data simulation

Presentation

In this talk, I will look over the rationale for LMEMs, and demonstrate how to fit them in R (Brauer & Curtin, 2018; Luke, 2017). Challenges will also be covered. For instance, when using the widely-accepted ‘maximal’ approach, based on fitting all possible random effects for each fixed effect, models sometimes fail to find a solution, or ‘convergence’. Advice for the problem of nonconvergence will be demonstrated, based on the progressive lightening of the random effects structure (Singman & Kellen, 2017; for an alternative approach, especially with small samples, see Matuschek et al., 2017). At the end, on a different note, I will present a web application that facilitates data simulation for research and teaching (Bernabeu & Lynott, 2020).

Event-related potentials: Why and how I used them

Post

Overview of event-related potentials as a research method, covering electroencephalography fundamentals, ERP definitions and processing, and their application to studying the time course of cognitive processes like conceptual processing.

Modality switch effects emerge early and increase throughout conceptual processing: Evidence from ERPs

Publication

We tested whether conceptual processing is modality-specific by tracking the time course of the Conceptual Modality Switch effect. Forty-six participants verified the relation between property words and concept words. The conceptual modality of …