RePsychLing Kliegl, Kuschela, & Laubrock (2015)- Reduction of Model Complexity

Author

Phillip Alday, Douglas Bates, and Reinhold Kliegl

Published

2026-02-09

1 Background

Kliegl et al. (2015) is a follow-up to Kliegl et al. (2011) (see also script kwdyz11.qmd) from an experiment looking at a variety of effects of visual cueing under four different cue-target relations (CTRs). In this experiment two rectangles are displayed (1) in horizontal orientation , (2) in vertical orientation, (3) in left diagonal orientation, or in (4) right diagonal orientation relative to a central fixation point. Subjects react to the onset of a small or a large visual target occurring at one of the four ends of the two rectangles. The target is cued validly on 70% of trials by a brief flash of the corner of the rectangle at which it appears; it is cued invalidly at the three other locations 10% of the trials each. This implies a latent imbalance in design that is not visible in the repeated-measures ANOVA, but we will show its effect in the random-effect structure and conditional modes.

There are a couple of differences between the first and this follow-up experiment, rendering it more a conceptual than a direct replication. First, the original experiment was carried out at Peking University and this follow-up at Potsdam University. Second, diagonal orientations of rectangles and large target sizes were not part of the design of Kliegl et al. (2011).

We specify three contrasts for the four-level factor CTR that are derived from spatial, object-based, and attractor-like features of attention. They map onto sequential differences between appropriately ordered factor levels. Replicating Kliegl et al. (2011), the attraction effect was not significant as a fixed effect, but yielded a highly reliable variance component (VC; i.e., reliable individual differences in positive and negative attraction effects cancel the fixed effect). Moreover, these individual differences in the attraction effect were negatively correlated with those in the spatial effect.

This comparison is of interest because a few years after the publication of Kliegl et al. (2011), the theoretically critical correlation parameter (CP) between the spatial effect and the attraction effect was determined as the source of a non-singular LMM in that paper. The present study served the purpose to estimate this parameter with a larger sample and a wider variety of experimental conditions.

Here we also include two additional experimental manipulations of target size and orientation of cue rectangle. A similar analysis was reported in the parsimonious mixed-model paper (Bates et al., 2015); it was also used in a paper of GAMEMs (Baayen et al., 2017). Data and R scripts of those analyses are also available in R-package RePsychLing.

The analysis is based on reaction times rt to maintain compatibility with Kliegl et al. (2011).

In this vignette we focus on the reduction of model complexity. And we start with a quote:

“Neither the [maximal] nor the [minimal] linear mixed models are appropriate for most repeated measures analysis. Using the [maximal] model is generally wasteful and costly in terms of statiscal power for testing hypotheses. On the other hand, the [minimal] model fails to account for nontrivial correlation among repeated measurements. This results in inflated [T]ype I error rates when non-negligible correlation does in fact exist. We can usually find middle ground, a covariance model that adequately accounts for correlation but is more parsimonious than the [maximal] model. Doing so allows us full control over [T]ype I error rates without needlessly sacrificing power.”

Stroup, W. W. (2012, p. 185). Generalized linear mixed models: Modern concepts, methods and applica?ons. CRC Press, Boca Raton.

2 Packages

Code
using AlgebraOfGraphics
using BoxCox
using CairoMakie
using CategoricalArrays
using Chain
using DataFrameMacros
using DataFrames
using MixedModels
using MixedModelsMakie
using Random
using StatsBase

using AlgebraOfGraphics: density
using SMLP2026: dataset

progress = isinteractive()

3 Read data, compute and plot means

dat = DataFrame(dataset(:kkl15))
describe(dat)
5×7 DataFrame
Row variable mean min median max nmissing eltype
Symbol Union… Any Union… Any Int64 DataType
1 Subj S001 S147 0 String
2 CTR dod val 0 String
3 rt 293.147 150.22 276.594 749.481 0 Float32
4 cardinal cardinal diagonal 0 String
5 size big small 0 String
dat_subj = combine(
  groupby(dat, [:Subj, :CTR]),
  nrow => :n,
  :rt => mean => :rt_m,
  :rt => (c -> mean(log, c)) => :lrt_m,
)
dat_subj.CTR = categorical(dat_subj.CTR, levels=levels(dat.CTR))
describe(dat_subj)
5×7 DataFrame
Row variable mean min median max nmissing eltype
Symbol Union… Any Union… Any Int64 DataType
1 Subj S001 S147 0 String
2 CTR val dod 0 CategoricalValue{String, UInt32}
3 n 156.294 49 64.0 448 0 Int64
4 rt_m 308.223 208.194 304.862 584.71 0 Float32
5 lrt_m 5.6908 5.33226 5.69848 6.36141 0 Float32
Code
boxplot(
  dat_subj.CTR.refs,
  dat_subj.lrt_m;
  orientation=:horizontal,
  show_notch=true,
  axis=(;
    yticks=(
      1:4,
      [
        "valid cue",
        "same obj/diff pos",
        "diff obj/same pos",
        "diff obj/diff pos",
      ]
    )
  ),
  figure=(; resolution=(800, 300)),
)
Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
@ Makie ~/.julia/packages/Makie/FUAHr/src/scenes.jl:238
Figure 1: Comparative boxplots of mean response time by subject under different conditions

Mean of reaction times for four cue-target relations. Targets appeared at (a) the cued position (valid) in a rectangle, (b) in the same rectangle cue, but at its other end, (c) on the second rectangle, but at a corresponding horizontal/vertical physical distance, or (d) at the other end of the second rectangle, that is \(\sqrt{2}\) of horizontal/vertical distance diagonally across from the cue, that is also at larger physical distance compared to (c).

4 Contrasts

contrasts = Dict(
  :CTR => SeqDiffCoding(; levels=["val", "sod", "dos", "dod"]),
  :cardinal => EffectsCoding(; levels=["cardinal", "diagonal"]),
  :size => EffectsCoding(; levels=["big", "small"])
)
Dict{Symbol, StatsModels.AbstractContrasts} with 3 entries:
  :CTR      => SeqDiffCoding(["val", "sod", "dos", "dod"])
  :size     => EffectsCoding(nothing, ["big", "small"])
  :cardinal => EffectsCoding(nothing, ["cardinal", "diagonal"])

5 Maximum LMM

This is the maximum LMM for the design; size is a between-subject factor, ignoring other information such as trial number, age and gender of subjects.

m_max = let
  form = @formula rt ~ 1 + CTR * cardinal * size +
                           (1 + CTR * cardinal | Subj)
  fit(MixedModel, form, dat; contrasts)
end;
Minimizing 2    Time: 0:00:00 (83.69 ms/it)
   objective: 600847.121999814


Minimizing 1229    Time: 0:00:00 ( 0.47 ms/it)
issingular(m_max)
true
only(MixedModels.PCA(m_max))

Principal components based on correlation matrix
 (Intercept)                     1.0   …    .      .      .      .      .
 CTR: sod                        0.6        .      .      .      .      .
 CTR: dos                        0.44       .      .      .      .      .
 CTR: dod                        0.37      1.0     .      .      .      .
 cardinal: diagonal             -0.03      0.15   1.0     .      .      .
 CTR: sod & cardinal: diagonal   0.32  …   0.02   0.26   1.0     .      .
 CTR: dos & cardinal: diagonal   0.41     -0.06   0.23   0.45   1.0     .
 CTR: dod & cardinal: diagonal   0.15      0.89   0.11   0.27   0.05   1.0

Normalized cumulative variances:
[0.3579, 0.5916, 0.7446, 0.8635, 0.9441, 1.0, 1.0, 1.0]

Component loadings
                                  PC1  …    PC4    PC5    PC6    PC7    PC8
 (Intercept)                    -0.43     -0.17  -0.31   0.45  -0.19   0.47
 CTR: sod                       -0.36     -0.43  -0.0   -0.22  -0.12  -0.59
 CTR: dos                       -0.38      0.35  -0.11  -0.75  -0.06   0.17
 CTR: dod                       -0.45      0.23  -0.19   0.11   0.7    0.04
 cardinal: diagonal             -0.12  …  -0.56  -0.47  -0.18  -0.13   0.1
 CTR: sod & cardinal: diagonal  -0.32     -0.39   0.73   0.0    0.26   0.15
 CTR: dos & cardinal: diagonal  -0.22      0.21  -0.17   0.33   0.05  -0.6
 CTR: dod & cardinal: diagonal  -0.41      0.32   0.29   0.17  -0.61  -0.0
VarCorr(m_max)
Column Variance Std.Dev Corr.
Subj (Intercept) 2918.87498 54.02661
CTR: sod 454.39523 21.31655 +0.60
CTR: dos 57.61066 7.59017 +0.44 +0.18
CTR: dod 192.54158 13.87594 +0.37 +0.54 +0.28
cardinal: diagonal 262.22439 16.19334 -0.03 -0.01 -0.00 +0.15
CTR: sod & cardinal: diagonal 30.02031 5.47908 +0.32 +0.20 +0.34 +0.02 +0.26
CTR: dos & cardinal: diagonal 1.56757 1.25203 +0.41 -0.38 +0.55 -0.06 +0.23 +0.45
CTR: dod & cardinal: diagonal 13.84915 3.72145 +0.15 +0.29 +0.25 +0.89 +0.11 +0.27 +0.05
Residual 3972.14087 63.02492

The LMM m_max is overparameterized but it is not immediately apparent why.

6 Reduction strategy 1

6.1 Zero-correlation parameter LMM (1)

Force CPs to zero. Reduction strategy 1 is more suited for reducing model w/o theoretical expectations about CPs. The better reduction strategy for the present experiment with an a priori interest in CPs is described as Reduction strategy 2.

m_zcp1 = let
  form = @formula rt ~ 1 + CTR * cardinal * size +
                   zerocorr(1 + CTR * cardinal | Subj)
  fit(MixedModel, form, dat; contrasts)
end;
issingular(m_zcp1)
true
only(MixedModels.PCA(m_zcp1))

Principal components based on correlation matrix
 (Intercept)                    1.0  .    .    .    .    .    .    .
 CTR: sod                       0.0  1.0  .    .    .    .    .    .
 CTR: dos                       0.0  0.0  1.0  .    .    .    .    .
 CTR: dod                       0.0  0.0  0.0  1.0  .    .    .    .
 cardinal: diagonal             0.0  0.0  0.0  0.0  1.0  .    .    .
 CTR: sod & cardinal: diagonal  0.0  0.0  0.0  0.0  0.0  1.0  .    .
 CTR: dos & cardinal: diagonal  0.0  0.0  0.0  0.0  0.0  0.0  0.0  .
 CTR: dod & cardinal: diagonal  0.0  0.0  0.0  0.0  0.0  0.0  0.0  1.0

Normalized cumulative variances:
[0.1429, 0.2857, 0.4286, 0.5714, 0.7143, 0.8571, 1.0, 1.0]

Component loadings
                                 PC1  …   PC3   PC4   PC5   PC6   PC7   PC8
 (Intercept)                    1.0      0.0   0.0   0.0   0.0   0.0   0.0
 CTR: sod                       0.0      0.0   0.0   0.0   0.0   0.0   0.0
 CTR: dos                       0.0      1.0   0.0   0.0   0.0   0.0   0.0
 CTR: dod                       0.0      0.0   1.0   0.0   0.0   0.0   0.0
 cardinal: diagonal             0.0   …  0.0   0.0   1.0   0.0   0.0   0.0
 CTR: sod & cardinal: diagonal  0.0      0.0   0.0   0.0   1.0   0.0   0.0
 CTR: dos & cardinal: diagonal  0.0      0.0   0.0   0.0   0.0   0.0   1.0
 CTR: dod & cardinal: diagonal  0.0      0.0   0.0   0.0   0.0   1.0   0.0
VarCorr(m_zcp1)
Column Variance Std.Dev Corr.
Subj (Intercept) 2875.69108 53.62547
CTR: sod 483.07349 21.97893 .
CTR: dos 79.94268 8.94107 . .
CTR: dod 216.92632 14.72842 . . .
cardinal: diagonal 250.29167 15.82061 . . . .
CTR: sod & cardinal: diagonal 35.92486 5.99373 . . . . .
CTR: dos & cardinal: diagonal 0.00000 0.00000 . . . . . .
CTR: dod & cardinal: diagonal 6.89404 2.62565 . . . . . . .
Residual 3972.37959 63.02682

The LMM m_zcp1 is also overparameterized, but now there is clear evidence for absence of evidence for the VC of one of the interactions and the other two interaction-based VCs are also very small.

6.2 Reduced zcp LMM

Take out VCs for interactions.

m_zcp1_rdc = let
  form = @formula rt ~ 1 + CTR * cardinal * size +
                   zerocorr(1 + CTR + cardinal | Subj)
  fit(MixedModel, form, dat; contrasts)
end;
issingular(m_zcp1_rdc)
false
only(MixedModels.PCA(m_zcp1_rdc))

Principal components based on correlation matrix
 (Intercept)         1.0  .    .    .    .
 CTR: sod            0.0  1.0  .    .    .
 CTR: dos            0.0  0.0  1.0  .    .
 CTR: dod            0.0  0.0  0.0  1.0  .
 cardinal: diagonal  0.0  0.0  0.0  0.0  1.0

Normalized cumulative variances:
[0.2, 0.4, 0.6, 0.8, 1.0]

Component loadings
                      PC1   PC2   PC3   PC4   PC5
 (Intercept)         1.0   0.0   0.0   0.0   0.0
 CTR: sod            0.0   0.0   0.0   0.0   1.0
 CTR: dos            0.0   1.0   0.0   0.0   0.0
 CTR: dod            0.0   0.0   1.0   0.0   0.0
 cardinal: diagonal  0.0   0.0   0.0   1.0   0.0
VarCorr(m_zcp1_rdc)
Column Variance Std.Dev Corr.
Subj (Intercept) 2881.04431 53.67536
CTR: sod 484.37607 22.00855 .
CTR: dos 79.50010 8.91628 . .
CTR: dod 216.59504 14.71717 . . .
cardinal: diagonal 244.93719 15.65047 . . . .
Residual 3980.87978 63.09421

LMM m_zcp_rdc is ok . We add in CPs.

6.3 Parsimonious LMM (1)

Extend zcp-reduced LMM with CPs

m_prm1 = let
  form = @formula rt ~ 1 + CTR * cardinal * size +
                           (1 + CTR + cardinal | Subj)
  fit(MixedModel, form, dat; contrasts)
end;
issingular(m_prm1)
false
only(MixedModels.PCA(m_prm1))

Principal components based on correlation matrix
 (Intercept)          1.0     .      .      .      .
 CTR: sod             0.6    1.0     .      .      .
 CTR: dos             0.45   0.19   1.0     .      .
 CTR: dod             0.37   0.54   0.3    1.0     .
 cardinal: diagonal  -0.1   -0.05  -0.09   0.13   1.0

Normalized cumulative variances:
[0.4492, 0.6674, 0.8309, 0.9439, 1.0]

Component loadings
                       PC1    PC2    PC3    PC4    PC5
 (Intercept)         -0.55  -0.16   0.01   0.58  -0.57
 CTR: sod            -0.54   0.09  -0.49   0.16   0.66
 CTR: dos            -0.4   -0.25   0.8   -0.12   0.34
 CTR: dod            -0.49   0.36  -0.09  -0.71  -0.35
 cardinal: diagonal   0.05   0.88   0.32   0.34   0.07

LMM m_zcp_rdc is ok . We add in CPs.

VarCorr(m_prm1)
Column Variance Std.Dev Corr.
Subj (Intercept) 2926.21980 54.09455
CTR: sod 454.68079 21.32325 +0.60
CTR: dos 56.66506 7.52762 +0.45 +0.19
CTR: dod 188.40644 13.72612 +0.37 +0.54 +0.30
cardinal: diagonal 245.31847 15.66265 -0.10 -0.05 -0.09 +0.13
Residual 3981.71885 63.10086

We note that the critical correlation parameter between spatial (sod) and attraction (dod) is now estimated at .54 – not that close to the 1.0 boundary that caused singularity in Kliegl et al. (2011).

6.4 Model comparison 1

gof_summary = let
  nms = [:m_zcp1_rdc, :m_prm1, :m_max]
  mods = eval.(nms)
  lrt = MixedModels.likelihoodratiotest(m_zcp1_rdc, m_prm1, m_max)
  DataFrame(;
    name = nms,
    dof=dof.(mods),
    deviance=round.(deviance.(mods), digits=0),
    AIC=round.(aic.(mods),digits=0),
    AICc=round.(aicc.(mods),digits=0),
    BIC=round.(bic.(mods),digits=0),
    χ²=vcat(:., round.(Int, diff(collect(lrt.lrt.deviance)))),
    χ²_dof=vcat(:., diff(collect(lrt.lrt.dof))),
    # StatsBase.PValue includes some pretty-printing methods
    pvalue=vcat(:., StatsBase.PValue.(collect(lrt.lrt.pval[2:end])))
  )
end
3×9 DataFrame
Row name dof deviance AIC AICc BIC χ² χ²_dof pvalue
Symbol Int64 Float64 Float64 Float64 Float64 Any Any Any
1 m_zcp1_rdc 22 599486.0 599530.0 599530.0 599725.0 . . .
2 m_prm1 32 599418.0 599482.0 599482.0 599766.0 -68 10 <1e-09
3 m_max 53 599359.0 599465.0 599465.0 599936.0 -59 21 <1e-04

AIC prefers LMM m_prm1 over m_zcp1_rdc; BIC LMM m_zcp1_rdc. As the CPs were one reason for conducting this experiment, AIC is the criterion of choice.

7 Reduction strategy 2

7.1 Complex LMM

Relative to LMM m_max, first we take out interaction VCs and associated CPs, because these VCs are very small. This is the same as LMM m_prm1 above.

m_cpx = let
  form = @formula rt ~ 1 + CTR * cardinal * size +
                      (1 + CTR + cardinal | Subj)
  fit(MixedModel, form, dat; contrasts)
end;

7.2 Zero-correlation parameter LMM (2)

Now we check the significance of ensemble of CPs.

m_zcp2 = let
  form = @formula rt ~ 1 + CTR * cardinal * size  +
              zerocorr(1 + CTR + cardinal | Subj)
  fit(MixedModel, form, dat; contrasts)
end;
VarCorr(m_zcp2)
Column Variance Std.Dev Corr.
Subj (Intercept) 2881.04431 53.67536
CTR: sod 484.37607 22.00855 .
CTR: dos 79.50010 8.91628 . .
CTR: dod 216.59504 14.71717 . . .
cardinal: diagonal 244.93719 15.65047 . . . .
Residual 3980.87978 63.09421

7.3 Parsimonious LMM (2)

The cardinal-related CPs are quite small. Do we need them?

m_prm2 = let
  form = @formula(rt ~ 1 + CTR * cardinal * size  +
                      (1 + CTR | Subj) + (0 + cardinal | Subj))
  fit(MixedModel, form, dat; contrasts)
end;
VarCorr(m_prm2)
Column Variance Std.Dev Corr.
Subj (Intercept) 2923.98107 54.07385
CTR: sod 454.50137 21.31904 +0.60
CTR: dos 56.41684 7.51111 +0.45 +0.19
CTR: dod 187.87023 13.70658 +0.37 +0.54 +0.30
cardinal: diagonal 245.09445 15.65549 . . . .
Residual 3981.74412 63.10106

7.4 Model comparison 2

gof_summary = let
  nms = [:m_zcp2, :m_prm2, :m_cpx, :m_max]
  mods = eval.(nms)
  lrt = MixedModels.likelihoodratiotest(m_zcp2, m_prm2, m_cpx, m_max)
  DataFrame(;
    name = nms,
    dof=dof.(mods),
    deviance=round.(deviance.(mods), digits=0),
    AIC=round.(aic.(mods),digits=0),
    AICc=round.(aicc.(mods),digits=0),
    BIC=round.(bic.(mods),digits=0),
    χ²=vcat(:., round.(Int, diff(collect(lrt.lrt.deviance)))),
    χ²_dof=vcat(:., diff(collect(lrt.lrt.dof))),
    # StatsBase.PValue includes some pretty-printing methods
    pvalue=vcat(:., StatsBase.PValue.(collect(lrt.lrt.pval[2:end])))
  )
end
4×9 DataFrame
Row name dof deviance AIC AICc BIC χ² χ²_dof pvalue
Symbol Int64 Float64 Float64 Float64 Float64 Any Any Any
1 m_zcp2 22 599486.0 599530.0 599530.0 599725.0 . . .
2 m_prm2 28 599420.0 599476.0 599476.0 599725.0 -65 6 <1e-11
3 m_cpx 32 599418.0 599482.0 599482.0 599766.0 -2 4 0.6521
4 m_max 53 599359.0 599465.0 599465.0 599936.0 -59 21 <1e-04

The cardinal-related CPs could be removed w/o loss of goodness of fit. However, there is no harm in keeping them in the LMM. The data support both LMM m_prm2 and m_cpx (same as: m_prm1). We keep the slightly more complex LMM m_cpx (m_prm1).

8 Diagnostic plots of LMM residuals

Do model residuals meet LMM assumptions? Classic plots are

  • Residual over fitted
  • Quantiles of model residuals over theoretical quantiles of normal distribution

8.1 Residual-over-fitted plot

The slant in residuals show a lower and upper boundary of reaction times, that is we have have too few short and too few long residuals. Not ideal, but at least width of the residual band looks similar across the fitted values, that is there is no evidence for heteroskedasticity.

Code
CairoMakie.activate!(; type="png")
scatter(fitted(m_prm1), residuals(m_prm1); alpha=0.3)
Figure 2: Residuals versus fitted values for model m1

With many observations the scatterplot is not that informative. Contour plots or heatmaps may be an alternative.

Code
set_aog_theme!()
draw(
  data((; f=fitted(m_prm1), r=residuals(m_prm1))) *
  mapping(
    :f => "Fitted values from m1", :r => "Residuals from m1"
  ) *
  density();
)
Figure 3: Heatmap of residuals versus fitted values for model m1

8.2 Q-Q plot

The plot of quantiles of model residuals over corresponding quantiles of the normal distribution should yield a straight line along the main diagonal.

Code
CairoMakie.activate!(; type="png")
qqnorm(
  residuals(m_prm1);
  qqline=:none,
  axis=(;
    xlabel="Standard normal quantiles",
    ylabel="Quantiles of the residuals from model m1",
  ),
)
Figure 4: Quantile-quantile plot of the residuals for model m1 versus a standard normal

9 Conditional modes

9.1 Caterpillar plot

Code
cm1 = only(ranefinfo(m_prm1))
caterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=2)
Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
@ Makie ~/.julia/packages/Makie/FUAHr/src/scenes.jl:238
Figure 5: Prediction intervals of the subject random effects in model m1

9.2 Shrinkage plot

Code
shrinkageplot!(Figure(; resolution=(1000, 1200)), m_prm1)
Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
@ Makie ~/.julia/packages/Makie/FUAHr/src/scenes.jl:238
Figure 6: Shrinkage plots of the subject random effects in model m1L

10 Parametric bootstrap

Here we

  • generate a bootstrap sample
  • compute shortest covergage intervals for the LMM parameters
  • plot densities of bootstrapped parameter estimates for residual, fixed effects, variance components, and correlation parameters

10.1 Generate a bootstrap sample

We generate 2500 samples for the 15 model parameters (4 fixed effect, 7 VCs, 15 CPs, and 1 residual).

samp = parametricbootstrap(MersenneTwister(1234321), 2500, m_prm1;
                           optsum_overrides=(; ftol_rel=1e-8));
tbl = samp.tbl
Table with 48 columns and 2500 rows:
      obj        β01      β02      β03      β04       β05      β06      ⋯
    ┌────────────────────────────────────────────────────────────────────
 1  │ 5.99129e5  318.147  26.2933  13.9267  6.72826   5.98036  27.219   ⋯
 2  │ 5.99217e5  315.163  21.7182  13.9029  1.39714   4.28655  26.2124  ⋯
 3  │ 5.99389e5  304.787  22.8431  14.4504  1.31035   5.97908  28.3136  ⋯
 4  │ 5.98761e5  304.983  25.7377  14.2462  4.4688    7.367    25.5255  ⋯
 5  │ 599199.0   305.66   20.3554  11.7867  1.94645   7.55753  22.6487  ⋯
 6  │ 5.99825e5  303.204  20.6372  11.9585  3.01003   3.64935  14.052   ⋯
 7  │ 5.98851e5  308.688  26.401   14.9291  4.31688   9.43639  28.0381  ⋯
 8  │ 599047.0   308.728  22.06    14.0047  2.05118   2.35723  21.4565  ⋯
 9  │ 5.99527e5  300.775  22.2808  10.5473  4.47365   4.40581  21.3018  ⋯
 10 │ 5.99094e5  314.717  27.6055  12.8172  1.94913   5.65716  24.3917  ⋯
 11 │ 5.99564e5  313.364  25.409   11.5892  4.60811   9.92582  28.7776  ⋯
 12 │ 599318.0   312.306  22.975   15.0662  0.257364  8.85711  25.8753  ⋯
 13 │ 5.99503e5  310.986  23.8338  14.7234  1.71097   9.73031  25.533   ⋯
 14 │ 599700.0   317.858  25.1794  13.9615  4.47923   8.08311  36.8895  ⋯
 15 │ 600081.0   309.607  24.4872  13.223   2.8043    3.88044  24.2747  ⋯
 16 │ 6.00049e5  308.47   24.8437  10.4014  3.39775   6.34872  28.8358  ⋯
 17 │ 5.98987e5  313.966  24.6609  12.7281  3.89523   7.20792  27.1059  ⋯
 ⋮  │     ⋮         ⋮        ⋮        ⋮        ⋮         ⋮        ⋮     ⋱

10.2 Shortest coverage interval

confint(samp)
DictTable with 2 columns and 32 rows:
 par   lower      upper
 ────┬────────────────────
 β01 │ 297.127    319.557
 β02 │ 18.7833    28.3189
 β03 │ 10.2022    15.9616
 β04 │ -1.01229   6.55107
 β05 │ 3.25535    9.79408
 β06 │ 14.052     37.0221
 β07 │ 1.86496    5.39255
 β08 │ -0.970276  3.77171
 β09 │ -2.88505   1.78204
 β10 │ 3.91211    13.6572
 β11 │ -3.30776   2.46574
 β12 │ 3.90977    11.1278
 β13 │ -1.06851   5.61773
 β14 │ -2.48112   1.07623
 β15 │ -2.50288   2.28101
 β16 │ 1.7751     6.48975
 ρ01 │ 0.39413    0.749412
  ⋮  │     ⋮         ⋮

We can also visualize the shortest coverage intervals for fixed effects with the ridgeplot() command:

Code
ridgeplot(samp; show_intercept=false)
Figure 7: Ridge plot of fixed-effects bootstrap samples from model m1L

10.3 Comparative density plots of bootstrapped parameter estimates

10.3.1 Residual

Code
draw(
  data(tbl) *
  mapping(:σ => "Residual") *
  density();
  figure=(; resolution=(800, 400)),
)
Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
@ Makie ~/.julia/packages/Makie/FUAHr/src/scenes.jl:238
Figure 8: Kernel density estimate from bootstrap samples of the residual standard deviation for model m_prm1

10.3.2 Fixed effects and associated variance components (w/o GM)

The shortest coverage interval for the GM ranges from x to x ms and the associate variance component from .x to .x. To keep the plot range small we do not include their densities here.

Code
rn = renamer([
  "(Intercept)" => "GM",
  "CTR: sod" => "spatial effect",
  "CTR: dos" => "object effect",
  "CTR: dod" => "attraction effect",
  "(Intercept), CTR: sod" => "GM, spatial",
  "(Intercept), CTR: dos" => "GM, object",
  "CTR: sod, CTR: dos" => "spatial, object",
  "(Intercept), CTR: dod" => "GM, attraction",
  "CTR: sod, CTR: dod" => "spatial, attraction",
  "CTR: dos, CTR: dod" => "object, attraction",
])
draw(
  data(tbl) *
  mapping(
    [:β02, :β03, :β04] .=> "Experimental effect size [ms]";
    color=dims(1) =>
    renamer(["spatial effect", "object effect", "attraction effect"]) =>
    "Experimental effects",
  ) *
  density();
  figure=(; resolution=(800, 350)),
)
Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
@ Makie ~/.julia/packages/Makie/FUAHr/src/scenes.jl:238
Figure 9: Kernel density estimate from bootstrap samples of the fixed effects for model m_prm1

The densitiies correspond nicely with the shortest coverage intervals.

Code
draw(
  data(tbl) *
  mapping(
    [:σ2, :σ3, :σ4] .=> "Standard deviations [ms]";
    color=dims(1) =>
    renamer(["spatial effect", "object effect", "attraction effect"]) =>
    "Variance components",
  ) *
  density();
  figure=(; resolution=(800, 350)),
)
Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
@ Makie ~/.julia/packages/Makie/FUAHr/src/scenes.jl:238
Figure 10: Kernel density estimate from bootstrap samples of the standard deviations for model m1L (excluding Grand Mean)

The VC are all very nicely defined.

10.3.3 Correlation parameters (CPs)

Code
draw(
  data(tbl) *
  mapping(
    [:ρ01, :ρ02, :ρ03, :ρ04, :ρ05, :ρ06] .=> "Correlation";
    color=dims(1) =>
    renamer(["GM, spatial", "GM, object", "spatial, object",
    "GM, attraction", "spatial, attraction", "object, attraction"]) =>
    "Correlation parameters",
  ) *
  density();
  figure=(; resolution=(800, 350)),
)
Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
@ Makie ~/.julia/packages/Makie/FUAHr/src/scenes.jl:238
Figure 11: Kernel density estimate from bootstrap samples of the standard deviations for model m1L

Three CPs stand out positively, the correlation between GM and the spatial effect, GM and attraction effect, and the correlation between spatial and attraction effects. The second CP was positive, but not significant in the first study. The third CP replicates a CP that was judged questionable in script kwdyz11.jl. The three remaining CPs are not well defined for reaction times.

11 References

Baayen, H., Vasishth, S., Kliegl, R., & Bates, D. (2017). The cave of shadows: Addressing the human factor with generalized additive mixed models. Journal of Memory and Language, 94, 206–234. https://doi.org/10.1016/j.jml.2016.11.006
Bates, D., Kliegl, R., Vasishth, S., & Baayen, H. (2015). Parsimonious mixed models. arXiv. https://doi.org/10.48550/ARXIV.1506.04967
Kliegl, R., Kushela, J., & Laubrock, J. (2015). Object orientation and target size modulate the speed of visual attention. Department of Psychology, University of Potsdam.
Kliegl, R., Wei, P., Dambacher, M., Yan, M., & Zhou, X. (2011). Experimental effects and individual differences in linear mixed models: Estimating the relationship between spatial, object, and attraction effects in visual attention. Frontiers in Psychology. https://doi.org/10.3389/fpsyg.2010.00238

This page was rendered from git revision f875caa using Quarto 1.8.26.

Back to top