Source-linked AI summary
Autocorrelated errors in experimental data in the language sciences: Some solutions offered by Generalized Additive Mixed Models
R. Harald Baayen, Jacolien van Rij, Cecile de Cat, Simon N. Wood
TL;DR
Autocorrelated errors in language-science experiments can make predictor significance tests anti-conservative. This paper illustrates GAMM factor smooths and AR(1) error modeling across three kinds of time-series data. In the word-naming data factor smooths account for most autocorrelation, while pitch and EEG data require a high AR(1) value for approximate whitening.
Problem
Experimental responses often form time series, so autocorrelated errors can make tests of predictor significance potentially anti-conservative.
Source: §1 · p. 1Method
The paper illustrates GAMM factor smooths for random effects and AR(1) error models as tools for addressing autocorrelation.
Source: §1 · p. 1, §3 · p. 4, §6 · p. 16Results
In word-naming data, factor smooths account for most autocorrelation and ρ = 0.3 further whitens residuals; pitch and EEG data require a high AR(1) value for approximate whitening.
Source: §6 · pp. 16–17Takeaways & Limitations
Whitening errors can protect against anti-conservative p-values, and the analyses show it can change predictor significance and functional-form interpretations.
Source: §6 · p. 18
Abstract
from arXiv · showhide
A problem that tends to be ignored in the statistical analysis of experimental data in the language sciences is that responses often constitute time series, which raises the problem of autocorrelated errors. If the errors indeed show autocorrelational structure, evaluation of the significance of predictors in the model becomes problematic due to potential anti-conservatism of p-values. This paper illustrates two tools offered by Generalized Additive Mixed Models (GAMMs) (Lin and Zhang, 1999; Wood, 2006, 2011, 2013) for dealing with autocorrelated errors, as implemented in the current version of the fourth author's mgcv package (1.8.9): the possibility to specify an ar(1) error model for Gaussian models, and the possibility of using factor smooths for random-effect factors such as subject and item. These factor smooths are set up to have the same smoothing parameters, and are penalized to yield the non-linear equivalent of random intercepts and random slopes in the classical linear framework. Three case studies illustrate these issues.
1 Introduction
Experimental responses in the language sciences can form time series, leaving autocorrelated errors that may make predictor p-values anti-conservative. The paper presents GAMM tools for modeling these errors and illustrates them in three case studies.
1 Introduction
- Responses in sequential experiments may be dependent across time, creating autocorrelated errors that complicate significance tests through potentially anti-conservative p-values.Source: §1 · p. 1
- The paper illustrates GAMM tools for autocorrelated errors: Gaussian AR(1) errors and factor smooths for random-effect factors, penalized as nonlinear counterparts of random intercepts and slopes.Source: §1 · p. 1
- Three case studies cover word naming, English compound pitch contours, and electrophysiological responses to compound words; the pitch reanalysis reaches substantially different conclusions from the original analysis.Source: §1 · p. 1
2 Generalized additive mixed models
GAMMs extend generalized linear mixed models with smooth terms for nonlinear relationships. Their smooths are penalized to balance fit and wiggliness, and factor smooths can model nonlinear variation across random-effect levels.
2 Generalized additive mixed models
- GAMMs extend generalized linear mixed models with tools for modeling nonlinear dependencies between a response and numeric predictors.Source: §2 · p. 1
- Thin plate regression splines approximate a smooth response with weighted basis functions and penalize wiggliness to balance undersmoothing against oversmoothing.Source: §2 · p. 2
- For multiple numeric predictors, thin plate splines model predictors on the same scale, while tensor product smooths are used when predictors are not isometric.Source: §2 · p. 2
- Factor smooths share a smoothing parameter across factor levels and use stronger penalization toward zero, providing nonlinear counterparts to random intercepts and slopes.Source: §2 · p. 2
- The paper specifies examples in R and explains extensions to model-formula notation from lme4 and mgcv where they are first used.Source: §2 · p. 2
3 Time series in a word naming task
In the word-naming data, participant-specific smooth curves account for much of the residual autocorrelation, and a mild AR(1) correction further reduces it. Replacing those curves with random intercepts and a larger AR(1) value fits worse.
3 Time series in a word naming task
- By-subject random regression lines eliminate prominent residual autocorrelation for subjects 17 and 10, while less prominent structure for other subjects remains nearly unchanged.Source: §3 · p. 4
- GAMM factor smooths for Trial yield residual autocorrelation patterns similar to the linear model’s by-subject straight lines.Source: §3 · p. 4
- Nearly all residual autocorrelation in the word-naming example is eliminated with factor smooths and a mild AR(1) correction of ρ = 0.3.The final row of Figure 1 shows the residual autocorrelation after this correction.Source: Figure 1 · p. 3, §3 · p. 5
- The by-subject curves capture changes in both intercept and performance over time, which are negligible for some participants but substantial and nonlinear for others.Source: §3 · p. 5, Figure 2 · p. 6
- An alternative model provides inferior fit, with adjusted R-squared of 0.07 (compared with 0.36) and fREML score of 2655 (compared with 684), suggesting distinct processes in this data set.Source: §3 · p. 5
- The linear mixed-effects model does not support an inflectional-entropy effect (t = −1.87), whereas the GAMM offers more confidence in that covariate (t = −2.16).Source: §3 · p. 5
4 Pitch contours as time series
Pitch contours in English three-constituent compounds show stronger autocorrelation than naming latencies, and crossed participant and compound curves alone do not fully remove it. Adding an AR(1) correction substantially, but not completely, whitens residuals; the analysis also finds little support for branching-condition differences once compound-level wiggly curves are included.
4 Pitch contours as time series
- Adding AR(1) correction with ρ = 0.98 to participant and compound wiggly curves substantially, but not completely, whitens pitch-model residuals.Random intercepts and slopes for time do not consistently reduce the autocorrelation; adding the wiggly curves improves it before the AR(1) correction.Source: §4 · p. 7, Figure 3 · p. 7
- Modeling each of the 480 subject–compound time series with its own penalized factor smooth was computationally prohibitive, so the model used crossed subject and compound curves.This specification assumes pitch-contour structure can be factored into orthogonal subject and compound contributions.Source: §4 · p. 8
- A single shared ρ cannot fit every event equally: some residual autocorrelation functions flatten at moderate values, while others retain dependence across several lags.The authors identify the joint specification of one autoregressive parameter for all events as a limitation.Source: §4 · p. 8
- For events with little initial autocorrelation, increasing ρ can create strong negative autocorrelation at lag 1.The paper cautions that a value that removes persistent autocorrelation in some events may introduce artificial structure in others.Source: §4 · p. 8, Figure 5 · p. 10
- The branching-condition difference curves provide little support for pitch-contour differences, and a time-only spline fits just as well.The authors attribute the original branching-condition effect’s absence to the variability in individual compound contours captured by random wiggly curves.Source: §4 · pp. 10–11, Figure 6 · p. 11
- Compound-by-sex coefficients show different pitch-raising directions across compounds, with a possible inverse association between the sexes (r = −0.31, t(38) = 0.049).The authors suggest this pattern may reflect subtle differences in which topics the groups find exciting or unexciting.Source: §4 · pp. 11–12
5 Time series in EEG registration
The EEG analysis models amplitude over time and stimulus properties while allowing subject-specific smooth trajectories and AR(1) residual dependence. Increasing ρ reduces residual autocorrelation but also changes estimated effects and their uncertainty.
5 Time series in EEG registration
- The analysis is restricted to native English speakers’ EEG at channel C1, and removes data points above 15 µV to obtain an approximately Gaussian response.The removed points constitute approximately 2.6% of the data.Source: §5 · p. 12
- The model combines time and order-specific smooths, constituent-frequency tensor surfaces, compound effects, and subject-level smooths for time and trial.The model uses ρ=0.85 and an AR start indicator; the table describes the fitted EEG GAMM at channel C1.Source: §5 · pp. 12, 14, Table 3 · p. 14
- At ρ=0.85, increasing ρ was needed to remove thick residual autocorrelation and widened 95% confidence intervals, while frequency’s apparent nonlinear effect became linear.Figure 9 shows the residual diagnostics; Figure 10 shows the effect estimates as ρ changes.Source: §5 · p. 14, Figure 9 · p. 16
- Subject-level factor smooths contribute substantially to model wiggliness, but strongly penalized smooths do not capture spiky trends well.Figure 8 distinguishes average responses, the model fit, and individual subject smooths.Source: §5 · p. 14, Figure 8 · p. 15
- The constituent-frequency surface varied by constituent order, and at ρ=0.9 the difference surface became interpretable, with frequency effects largely absent in reversed order.At that ρ, amplitudes in reversed order are lower when both constituents are high-frequency and higher when both are low-frequency.Source: §5 · pp. 14–15
6 Concluding remarks
The paper demonstrates factor smooths and AR(1) error modeling across response-time, pitch, and EEG examples. Their usefulness varies by data type, and whitening can affect both inference and the shape of estimated effects.
6 Concluding remarks
- The three examples cover response latencies for reading aloud, pitch contours of three-constituent compounds, and brain responses to grammatical and ungrammatical compounds.Source: §6 · p. 16
- GAMMs offer factor smooths and an AR(1) parameter ρ; factor smooths relax the linearity assumption of random intercepts and slopes and can fit nonlinear random-effect patterns.They may provide tighter fits when random-effect factors behave nonlinearly.Source: §6 · p. 16
- Factor smooths accounted for most response-time autocorrelation, with ρ=0.3 sufficient for further whitening, but pitch and EEG required high ρ because factor smooths did not remove autocorrelation.The pitch and EEG examples used by-participant and by-item factor smooths.Source: §6 · pp. 16–17
- Whitening may guard against anti-conservative p-values and improve the quantitative account of the data, while changing nonlinear partial effects.In the examples, a pitch interaction became non-significant, and EEG effects became simpler or more interpretable after whitening.Source: §6 · p. 18