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

Author

Phillip Alday, Douglas Bates, and Reinhold Kliegl

Published

2024-09-13

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 AlgebraOfGraphics: density
using BoxCox
using CairoMakie
using CategoricalArrays
using Chain
using DataFrameMacros
using DataFrames
using MixedModels
using MixedModelsMakie
using Random
using SMLP2024: dataset
using StatsBase

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/WgbrE/src/scenes.jl:227
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 142    Time: 0:00:00 ( 0.70 ms/it)
  objective:  599458.051337806
Minimizing 876    Time: 0:00:00 ( 0.42 ms/it)

Minimizing 877    Time: 0:00:00 ( 0.44 ms/it)
  objective:  599358.9785788914
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.38      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.42     -0.02   0.24   0.43   1.0     .
 CTR: dod & cardinal: diagonal   0.14      0.88   0.11   0.26   0.07   1.0

Normalized cumulative variances:
[0.3611, 0.5905, 0.7428, 0.8638, 0.9457, 1.0, 1.0, 1.0]

Component loadings
                                  PC1  …    PC4    PC5    PC6    PC7    PC8
 (Intercept)                    -0.43     -0.15  -0.29   0.47  -0.19   0.46
 CTR: sod                       -0.35     -0.41  -0.03  -0.23  -0.12  -0.59
 CTR: dos                       -0.39      0.35  -0.1   -0.75  -0.08   0.19
 CTR: dod                       -0.45      0.22  -0.18   0.1    0.7    0.06
 cardinal: diagonal             -0.12  …  -0.56  -0.48  -0.16  -0.13   0.1
 CTR: sod & cardinal: diagonal  -0.31     -0.43   0.72  -0.01   0.26   0.14
 CTR: dos & cardinal: diagonal  -0.24      0.22  -0.15   0.33   0.06  -0.6
 CTR: dod & cardinal: diagonal  -0.41      0.3    0.31   0.17  -0.6    0.0
VarCorr(m_max)
Column Variance Std.Dev Corr.
Subj (Intercept) 2938.44786 54.20745
CTR: sod 455.44655 21.34119 +0.60
CTR: dos 56.85753 7.54039 +0.44 +0.18
CTR: dod 192.63470 13.87929 +0.38 +0.54 +0.30
cardinal: diagonal 261.91287 16.18372 -0.03 -0.01 +0.00 +0.15
CTR: sod & cardinal: diagonal 30.20533 5.49594 +0.32 +0.21 +0.33 +0.02 +0.26
CTR: dos & cardinal: diagonal 1.64655 1.28318 +0.42 -0.37 +0.58 -0.02 +0.24 +0.43
CTR: dod & cardinal: diagonal 13.89368 3.72742 +0.14 +0.28 +0.25 +0.88 +0.11 +0.26 +0.07
Residual 3972.11165 63.02469

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   PC2  …   PC4   PC5   PC6   PC7     PC8
 (Intercept)                    1.0   0.0      0.0   0.0   0.0   0.0     0.0
 CTR: sod                       0.0   1.0      0.0   0.0   0.0   0.0     0.0
 CTR: dos                       0.0   0.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   NaN
 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.43244 53.62306
CTR: sod 483.09089 21.97933 .
CTR: dos 79.93243 8.94049 . .
CTR: dod 216.91700 14.72810 . . .
cardinal: diagonal 250.32171 15.82156 . . . .
CTR: sod & cardinal: diagonal 35.91784 5.99315 . . . . .
CTR: dos & cardinal: diagonal 0.00000 0.00000 . . . . . .
CTR: dod & cardinal: diagonal 6.88389 2.62372 . . . . . . .
Residual 3972.38114 63.02683

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)         0.0   0.0   0.0   0.0   1.0
 CTR: sod            1.0   0.0   0.0   0.0   0.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.45052 53.67914
CTR: sod 484.31679 22.00720 .
CTR: dos 79.54961 8.91906 . .
CTR: dod 216.59820 14.71728 . . .
cardinal: diagonal 244.93991 15.65056 . . . .
Residual 3980.87777 63.09420

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.29   1.0     .
 cardinal: diagonal  -0.1   -0.05  -0.09   0.13   1.0

Normalized cumulative variances:
[0.4488, 0.6668, 0.8307, 0.9437, 1.0]

Component loadings
                       PC1    PC2    PC3    PC4    PC5
 (Intercept)         -0.55  -0.16   0.01   0.58  -0.58
 CTR: sod            -0.54   0.09  -0.49   0.17   0.66
 CTR: dos            -0.4   -0.25   0.8   -0.13   0.34
 CTR: dod            -0.49   0.36  -0.1   -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.39374 54.09615
CTR: sod 454.10921 21.30984 +0.60
CTR: dos 56.75233 7.53341 +0.45 +0.19
CTR: dod 188.74621 13.73849 +0.37 +0.54 +0.29
cardinal: diagonal 245.27143 15.66114 -0.10 -0.05 -0.09 +0.13
Residual 3981.71306 63.10082

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.(lrt.tests.deviancediff, digits=0)),
    χ²_dof=vcat(:., round.(lrt.tests.dofdiff, digits=0)),
    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
  )
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.0 10.0 0.0
3 m_max 53 599359.0 599465.0 599465.0 599936.0 59.0 21.0 0.0

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.45052 53.67914
CTR: sod 484.31679 22.00720 .
CTR: dos 79.54961 8.91906 . .
CTR: dod 216.59820 14.71728 . . .
cardinal: diagonal 244.93991 15.65056 . . . .
Residual 3980.87777 63.09420

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.32186 54.06775
CTR: sod 454.38842 21.31639 +0.60
CTR: dos 56.46065 7.51403 +0.45 +0.19
CTR: dod 187.89792 13.70759 +0.37 +0.54 +0.30
cardinal: diagonal 245.16943 15.65789 . . . .
Residual 3981.74285 63.10105

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.(lrt.tests.deviancediff, digits=0)),
    χ²_dof=vcat(:., round.(lrt.tests.dofdiff, digits=0)),
    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
  )
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.0 6.0 0.0
3 m_cpx 32 599418.0 599482.0 599482.0 599766.0 2.0 4.0 0.652
4 m_max 53 599359.0 599465.0 599465.0 599936.0 59.0 21.0 0.0

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/WgbrE/src/scenes.jl:227
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/WgbrE/src/scenes.jl:227
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.98897e5  301.101  22.1122  11.2895  0.876659  5.29574  20.7015  ⋯
 2  │ 5.9964e5   314.198  23.9774  13.0657  3.54125   6.27177  26.0213  ⋯
 3  │ 5.99601e5  313.482  25.8522  12.6864  2.6665    5.99473  26.2079  ⋯
 4  │ 5.99422e5  307.342  21.8929  14.5687  5.14975   6.46233  21.4816  ⋯
 5  │ 5.9891e5   303.107  22.0525  13.8717  1.22361   9.06571  27.3694  ⋯
 6  │ 5.99241e5  304.327  20.6646  12.9426  3.01194   5.19863  31.4934  ⋯
 7  │ 599535.0   315.078  26.3107  13.0825  6.77259   6.14113  18.2759  ⋯
 8  │ 5.99182e5  306.15   23.4631  12.4967  4.0268    6.32004  27.5211  ⋯
 9  │ 6.0014e5   304.214  22.5889  10.4741  3.78498   6.67903  23.2066  ⋯
 10 │ 5.994e5    307.004  25.5547  14.8672  1.09287   3.08337  18.9497  ⋯
 11 │ 5.98984e5  302.778  20.5811  12.5438  3.28193   7.46265  28.1793  ⋯
 12 │ 5.99649e5  313.379  26.6914  10.9561  1.26339   4.65612  32.3437  ⋯
 13 │ 5.99031e5  304.034  22.6971  12.175   2.1841    7.84183  36.4001  ⋯
 14 │ 5.9947e5   309.43   22.6176  15.1642  -0.58606  3.62731  32.418   ⋯
 15 │ 5.99092e5  319.095  24.0423  14.1444  5.27404   8.75307  29.1921  ⋯
 16 │ 5.99633e5  310.267  22.907   15.5719  3.72037   8.71994  25.3559  ⋯
 17 │ 5.99831e5  307.412  21.8683  13.7834  2.23826   9.10737  30.2628  ⋯
 ⋮  │     ⋮         ⋮        ⋮        ⋮        ⋮         ⋮        ⋮     ⋱

10.2 Shortest coverage interval

confint(samp)
DictTable with 2 columns and 32 rows:
 par   lower      upper
 ────┬────────────────────
 β01 │ 296.443    318.781
 β02 │ 18.3734    27.7957
 β03 │ 10.3257    16.0712
 β04 │ -1.18121   6.18787
 β05 │ 3.44619    10.2913
 β06 │ 14.9788    37.9644
 β07 │ 1.80928    5.35864
 β08 │ -0.998456  3.73246
 β09 │ -2.53041   2.20858
 β10 │ 3.72405    13.3908
 β11 │ -3.54059   2.37317
 β12 │ 3.72117    11.1719
 β13 │ -1.5557    5.11338
 β14 │ -2.46016   1.04481
 β15 │ -2.68508   2.1626
 β16 │ 1.70393    6.52866
 ρ01 │ 0.336762   0.792209
  ⋮  │     ⋮         ⋮

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/WgbrE/src/scenes.jl:227
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/WgbrE/src/scenes.jl:227
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/WgbrE/src/scenes.jl:227
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/WgbrE/src/scenes.jl:227
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
Back to top