diff --git a/.nojekyll b/.nojekyll index edb2ab2..75f19c1 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -e58db880 \ No newline at end of file +e6dec3c8 \ No newline at end of file diff --git a/arrow.html b/arrow.html index dfe5602..1f42c0a 100644 --- a/arrow.html +++ b/arrow.html @@ -399,7 +399,7 @@

2 The Emotikon da

The Arrow package for Julia does not export any function names, which means that the function to read an Arrow file must be called as Arrow.Table. It returns a column table, as described in the Tables package. This is like a read-only data frame, which can be easily converted to a full-fledged DataFrame if desired.

This arrangement allows for the Arrow package not to depend on the DataFrames package, which is a heavy-weight dependency, but still easily produce a DataFrame if warranted.

Load the packages to be used.

-
+
Code
using AlgebraOfGraphics
@@ -421,10 +421,10 @@ 

2 The Emotikon da

3 Downloading and importing the RDS file

This is similar to some of the code shown by Julius Krumbiegel on Monday. In the data directory of the emotikon project on osf.io under Data, the url for the rds data file is found to be [https://osf.io/xawdb/]. Note that we want version 2 of this file.

-
+
fn = Downloads.download("https://osf.io/xawdb/download?version=2");
-
+
dfrm = rcopy(R"readRDS($fn)")
525126×7 DataFrame
525101 rows omitted
@@ -718,7 +718,7 @@

3 Downloading and

Now write this file as a Arrow file and read it back in.

-
+
arrowfn = joinpath("data", "fggk21.arrow")
 Arrow.write(arrowfn, dfrm; compress=:lz4)
 tbl = Arrow.Table(arrowfn)
@@ -733,13 +733,13 @@

3 Downloading and :score Float64

-
+
filesize(arrowfn)
3077850
-
+
df = DataFrame(tbl)
525126×7 DataFrame
525101 rows omitted
@@ -1044,7 +1044,7 @@

4 Avoiding needle

5 Creating the smaller table

-
+
Child = unique(select(df, :Child, :School, :Cohort, :Sex, :age))
108295×5 DataFrame
108270 rows omitted
@@ -1281,13 +1281,13 @@

5 Creating the sm

-
+
length(unique(Child.Child))  # should be 108295
108295
-
+
filesize(
   Arrow.write("./data/fggk21_Child.arrow", Child; compress=:lz4)
 )
@@ -1295,7 +1295,7 @@

5 Creating the sm
1774946

-
+
filesize(
   Arrow.write(
     "./data/fggk21_Score.arrow",
@@ -1321,7 +1321,7 @@ 

5 Creating the sm

Now read the Arrow tables in and reassemble the original table.

-
+
Score = DataFrame(Arrow.Table("./data/fggk21_Score.arrow"))
525126×3 DataFrame
525101 rows omitted
@@ -1503,7 +1503,7 @@

5 Creating the sm

At this point we can create the z-score column by standardizing the scores for each Test. The code to do this follows Julius’s presentation on Monday.

-
+
@transform!(groupby(Score, :Test), :zScore = @bycol zscore(:score))
525126×4 DataFrame
525101 rows omitted
@@ -1712,7 +1712,7 @@

5 Creating the sm

-
+
Child = DataFrame(Arrow.Table("./data/fggk21_Child.arrow"))
108295×5 DataFrame
108270 rows omitted
@@ -1949,7 +1949,7 @@

5 Creating the sm

-
+
df1 = disallowmissing!(leftjoin(Score, Child; on=:Child))
525126×8 DataFrame
525101 rows omitted
@@ -2287,7 +2287,7 @@

5 Creating the sm

6 Discovering patterns in the data

One of the motivations for creating the Child table was to be able to bin the ages according to the age of each child, not the age of each Child-Test combination. Not all children have all 5 test results. We can check the number of results by grouping on :Child and evaluate the number of rows in each group.

-
+
nobsChild = combine(groupby(Score, :Child), nrow => :ntest)
108295×2 DataFrame
108270 rows omitted
@@ -2441,7 +2441,7 @@

6 Discovering pat

Now create a table of the number of children with 1, 2, …, 5 test scores.

-
+
combine(groupby(nobsChild, :ntest), nrow)
5×2 DataFrame
@@ -2491,7 +2491,7 @@

6 Discovering pat

A natural question at this point is whether there is something about those students who have few observations. For example, are they from only a few schools?

One approach to examining properties like is to add the number of observations for each child to the :Child table. Later we can group the table according to this :ntest to look at properties of :Child by :ntest.

-
+
gdf = groupby(
   disallowmissing!(leftjoin(Child, nobsChild; on=:Child)), :ntest
 )
@@ -3031,7 +3031,7 @@

6 Discovering pat

Are the sexes represented more-or-less equally?

-
+
combine(groupby(first(gdf), :Sex), nrow => :nchild)
2×2 DataFrame
@@ -3064,7 +3064,7 @@

6 Discovering pat

-
+
combine(groupby(last(gdf), :Sex), nrow => :nchild)
2×2 DataFrame
diff --git a/bootstrap.html b/bootstrap.html index 1605ee8..44aceb3 100644 --- a/bootstrap.html +++ b/bootstrap.html @@ -391,7 +391,7 @@

1 The parametric

A parametric bootstrap is used with a parametric model, m, that has been fit to data. The procedure is to simulate n response vectors from m using the estimated parameter values and refit m to these responses in turn, accumulating the statistics of interest at each iteration.

The parameters of a LinearMixedModel object are the fixed-effects parameters, β, the standard deviation, σ, of the per-observation noise, and the covariance parameter, θ, that defines the variance-covariance matrices of the random effects. A technical description of the covariance parameter can be found in the MixedModels.jl docs. Lisa Schwetlick and Daniel Backhaus have provided a more beginner-friendly description of the covariance parameter in the documentation for MixedModelsSim.jl. For today’s purposes – looking at the uncertainty in the estimates from a fitted model – we can simply use values from the fitted model, but we will revisit the parametric bootstrap as a convenient way to simulate new data, potentially with different parameter values, for power analysis.

Attach the packages to be used

-
+
Code
using AlgebraOfGraphics
@@ -414,9 +414,9 @@ 

1 The parametric

2 A model of moderate complexity

The kb07 data (Kronmüller & Barr, 2007) are one of the datasets provided by the MixedModels package.

-
+
kb07 = dataset(:kb07)
-
+
Arrow.Table with 1789 rows, 7 columns, and schema:
  :subj      String
  :item      String
@@ -428,10 +428,10 @@ 

2 A model of mode

Convert the table to a DataFrame for summary.

-
+
kb07 = DataFrame(kb07)
 describe(kb07)
-
+
7×7 DataFrame
@@ -533,7 +533,7 @@

2 A model of mode

The experimental factors; spkr, prec, and load, are two-level factors.

-
+
contrasts = Dict(:spkr => EffectsCoding(),
                  :prec => EffectsCoding(),
                  :load => EffectsCoding(),
@@ -543,16 +543,16 @@ 

2 A model of mode

The EffectsCoding contrast is used with these to create a ±1 encoding. Furthermore, Grouping constrasts are assigned to the subj and item factors. This is not a contrast per-se but an indication that these factors will be used as grouping factors for random effects and, therefore, there is no need to create a contrast matrix. For large numbers of levels in a grouping factor, an attempt to create a contrast matrix may cause memory overflow.

It is not important in these cases but a good practice in any case.

We can look at an initial fit of moderate complexity:

-
+
form = @formula(rt_trunc ~ 1 + spkr * prec * load +
                           (1 + spkr + prec + load | subj) +
                           (1 + spkr + prec + load | item))
 m0 = fit(MixedModel, form, kb07; contrasts)
-
Minimizing 799   Time: 0:00:01 ( 1.68 ms/it)
-  objective:  28637.123623229592
+
Minimizing 894   Time: 0:00:00 ( 0.15 ms/it)
+  objective:  28637.97101084821
-
+

@@ -577,79 +577,79 @@

2 A model of mode

- - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - + - - + + - + - - + + - + - - + + - + - + @@ -662,9 +662,9 @@

2 A model of mode

The default display in Quarto uses the pretty MIME show method for the model and omits the estimated correlations of the random effects.

The VarCorr extractor displays these.

-
+
VarCorr(m0)
-
+

(Intercept)2181.672977.313628.222181.642477.350528.20 <1e-99301.8062362.2579301.8688362.4643
spkr: old67.749118.26643.7167.749617.96043.77 0.000242.379540.680733.058241.1114
prec: maintain-333.920547.1558-333.920047.1534 -7.08 <1e-1161.9630246.915858.8506247.3123
load: yes78.770219.52984.0378.800619.72703.99 <1e-0464.975142.389066.961243.3929
spkr: old & prec: maintain-21.965515.8074-21.996015.8191 -1.390.16470.1644
spkr: old & load: yes18.383715.807418.383215.8191 1.160.24480.2452
prec: maintain & load: yes4.533315.80744.532715.8191 0.290.77430.7745
spkr: old & prec: maintain & load: yes23.607315.807423.637715.8191 1.490.13530.1351
Residual668.5542669.0519
@@ -690,8 +690,8 @@

2 A model of mode

- - + + @@ -699,35 +699,35 @@

2 A model of mode

- - - + + + - - - - + + + + - - + + + - - + - - + + @@ -735,35 +735,35 @@

2 A model of mode

- - - + + + - - + + - + - - - - - + + + + + - - + + @@ -773,12 +773,12 @@

2 A model of mode

None of the two-factor or three-factor interaction terms in the fixed-effects are significant. In the random-effects terms only the scalar random effects and the prec random effect for item appear to be warranted, leading to the reduced formula

-
+
# formula f4 from https://doi.org/10.33016/nextjournal.100002
 form = @formula(rt_trunc ~ 1 + spkr * prec * load + (1 | subj) + (1 + prec | item))
 
 m1 = fit(MixedModel, form, kb07; contrasts)
-
+

subj (Intercept)91087.0055301.806291124.7853301.8688
spkr: old1796.022142.3795+0.791092.846833.0582+1.00
prec: maintain3839.412661.9630-0.59+0.023463.397158.8506-0.62-0.62
load: yes4221.763864.97514483.799766.9612+0.36 +0.36+0.85+0.54+0.51
item (Intercept)131230.7914362.2579131380.3392362.4643
spkr: old1654.923240.6807+0.441690.146441.1114+0.42
prec: maintain60967.4037246.915861163.3893247.3123 -0.69+0.35+0.37
load: yes1796.828442.3890+0.32+0.16-0.141882.946343.3929+0.29+0.14-0.13
Residual 446964.7062668.5542447630.5113669.0519
@@ -886,9 +886,9 @@

2 A model of mode

-
+
VarCorr(m1)
-
+
@@ -903,7 +903,7 @@

2 A model of mode

- + @@ -933,9 +933,9 @@

2 A model of mode

These two models are nested and can be compared with a likelihood-ratio test.

-
+
MixedModels.likelihoodratiotest(m0, m1)
-
+

item (Intercept)133026.918133026.917 364.729
@@ -967,10 +967,10 @@

2 A model of mode

- + - +
rt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item) 292863728638 21 160.16500.1979
@@ -981,11 +981,14 @@

2 A model of mode

3 Bootstrap basics

To bootstrap the model parameters, first initialize a random number generator then create a bootstrap sample and extract the table of parameter estimates from it.

-
+
const RNG = MersenneTwister(42)
 samp = parametricbootstrap(RNG, 5_000, m1)
 tbl = samp.tbl
-
+
+
WARNING: redefinition of constant RNG. This may fail, cause incorrect answers, or produce other errors.
+
+
Table with 18 columns and 5000 rows:
       obj      β1       β2       β3        β4       β5        β6        ⋯
     ┌────────────────────────────────────────────────────────────────────
@@ -1016,29 +1019,29 @@ 

3 Bootstrap basic

An empirical density plot of the estimates of the residual standard deviation is obtained as

-
-
plt = data(tbl) * mapping(:σ) * AoG.density()
-draw(plt; axis=(;title="Parametric bootstrap estimates of σ"))
-
+
+
plt = data(tbl) * mapping(:σ) * AoG.density()
+draw(plt; axis=(;title="Parametric bootstrap estimates of σ"))
+

A density plot of the estimates of the standard deviation of the random effects is obtained as

-
-
plt = data(tbl) * mapping(
-  [:σ1, :σ2, :σ3] .=> "Bootstrap replicates of standard deviations";
-  color=dims(1) => renamer(["Item intercept", "Item speaker", "Subj"])
-) * AoG.density()
-draw(plt; figure=(;supertitle="Parametric bootstrap estimates of variance components"))
-
+
+
plt = data(tbl) * mapping(
+  [:σ1, :σ2, :σ3] .=> "Bootstrap replicates of standard deviations";
+  color=dims(1) => renamer(["Item intercept", "Item speaker", "Subj"])
+) * AoG.density()
+draw(plt; figure=(;supertitle="Parametric bootstrap estimates of variance components"))
+

The bootstrap sample can be used to generate intervals that cover a certain percentage of the bootstrapped values. We refer to these as “coverage intervals”, similar to a confidence interval. The shortest such intervals, obtained with the shortestcovint extractor, correspond to a highest posterior density interval in Bayesian inference.

We generate these for all random and fixed effects:

-
-
confint(samp)
-
+
+
confint(samp)
+
DictTable with 2 columns and 13 rows:
  par   lower      upper
  ────┬─────────────────────
@@ -1050,33 +1053,33 @@ 

3 Bootstrap basic β6 │ -11.3574 51.5299 β7 │ -27.1799 36.3332 β8 │ -9.28905 53.5917 - ρ1 │ -0.912778 -0.471128 + ρ1 │ -0.912778 -0.471124 σ │ 654.965 700.928 σ1 │ 265.276 456.967 - σ2 │ 179.402 321.016 - σ3 │ 232.096 359.744

+ σ2 │ 179.402 321.017 + σ3 │ 232.096 359.745

-
-
draw(
-  data(samp.β) * mapping(:β; color=:coefname) * AoG.density();
-  figure=(; resolution=(800, 450)),
-)
-
+
+
draw(
+  data(samp.β) * mapping(:β; color=:coefname) * AoG.density();
+  figure=(; resolution=(800, 450)),
+)
+

For the fixed effects, MixedModelsMakie provides a convenience interface to plot the combined coverage intervals and density plots

-
-
ridgeplot(samp)
-
+
+
ridgeplot(samp)
+

Often the intercept will be on a different scale and potentially less interesting, so we can stop it from being included in the plot:

-
-
ridgeplot(samp; show_intercept=false, xlabel="Bootstrap density and 95%CI")
-
+
+
ridgeplot(samp; show_intercept=false, xlabel="Bootstrap density and 95%CI")
+

@@ -1084,10 +1087,10 @@

3 Bootstrap basic

4 Singularity

Let’s consider the classic dysetuff dataset:

-
-
dyestuff = dataset(:dyestuff)
-mdye = fit(MixedModel, @formula(yield ~ 1 + (1 | batch)), dyestuff)
-
+
+
dyestuff = dataset(:dyestuff)
+mdye = fit(MixedModel, @formula(yield ~ 1 + (1 | batch)), dyestuff)
+
@@ -1120,30 +1123,30 @@

4 Singularity

-
-
sampdye = parametricbootstrap(MersenneTwister(1234321), 10_000, mdye)
-tbldye = sampdye.tbl
-
+
+
sampdye = parametricbootstrap(MersenneTwister(1234321), 10_000, mdye)
+tbldye = sampdye.tbl
+
Table with 5 columns and 10000 rows:
       obj      β1       σ        σ1        θ1
     ┌────────────────────────────────────────────────
  1  │ 339.022  1509.13  67.4315  14.312    0.212245
  2  │ 322.689  1538.08  47.9831  25.5673   0.53284
  3  │ 324.002  1508.02  50.1346  21.7622   0.434076
- 4  │ 331.887  1538.47  53.2238  41.0559   0.771383
+ 4  │ 331.887  1538.47  53.2238  41.0559   0.771382
  5  │ 317.771  1520.62  45.2975  19.1802   0.423428
  6  │ 315.181  1536.94  36.7556  49.1832   1.33812
  7  │ 333.641  1519.88  53.8161  46.712    0.867993
  8  │ 325.729  1528.43  47.8989  37.6367   0.785752
  9  │ 311.601  1497.46  41.4     15.1257   0.365355
  10 │ 335.244  1532.65  64.616   0.0       0.0
- 11 │ 327.935  1552.54  57.2036  0.485275  0.00848329
+ 11 │ 327.935  1552.54  57.2036  0.485281  0.00848339
  12 │ 323.861  1519.28  49.355   24.3703   0.493776
  13 │ 332.736  1509.04  59.6272  18.2905   0.306747
- 14 │ 328.243  1531.7   51.5431  32.4744   0.630043
+ 14 │ 328.243  1531.7   51.5431  32.4743   0.630042
  15 │ 336.186  1536.17  64.0205  15.243    0.238096
  16 │ 329.468  1526.42  58.6856  0.0       0.0
- 17 │ 320.086  1517.67  43.218   35.9663   0.832207
+ 17 │ 320.086  1517.67  43.218   35.9663   0.832206
  18 │ 325.887  1497.86  50.8753  25.9059   0.509205
  19 │ 311.31   1529.24  33.8976  49.6557   1.46487
  20 │ 309.404  1549.71  33.987   41.1105   1.20959
@@ -1153,28 +1156,28 @@ 

4 Singularity

-
-
plt = data(tbldye) * mapping(:σ1) * AoG.density()
-draw(plt; axis=(;title="Parametric bootstrap estimates of σ_batch"))
-
+
+
plt = data(tbldye) * mapping(:σ1) * AoG.density()
+draw(plt; axis=(;title="Parametric bootstrap estimates of σ_batch"))
+

Notice that this density plot has a spike, or mode, at zero. Although this mode appears to be diffuse, this is an artifact of the way that density plots are created. In fact, it is a pulse, as can be seen from a histogram.

-
-
plt = data(tbldye) * mapping(:σ1) * AoG.histogram(;bins=100)
-draw(plt; axis=(;title="Parametric bootstrap estimates of σ_batch"))
-
+
+
plt = data(tbldye) * mapping(:σ1) * AoG.histogram(;bins=100)
+draw(plt; axis=(;title="Parametric bootstrap estimates of σ_batch"))
+

A value of zero for the standard deviation of the random effects is an example of a singular covariance. It is easy to detect the singularity in the case of a scalar random-effects term. However, it is not as straightforward to detect singularity in vector-valued random-effects terms.

For example, if we bootstrap a model fit to the sleepstudy data

-
-
sleepstudy = dataset(:sleepstudy)
-msleep = fit(MixedModel, @formula(reaction ~ 1 + days + (1 + days | subj)),
-             sleepstudy)
-
+
+
sleepstudy = dataset(:sleepstudy)
+msleep = fit(MixedModel, @formula(reaction ~ 1 + days + (1 + days | subj)),
+             sleepstudy)
+
@@ -1215,43 +1218,43 @@

4 Singularity

-
-
sampsleep = parametricbootstrap(MersenneTwister(666), 10_000, msleep)
-tblsleep = sampsleep.tbl
-
+
+
sampsleep = parametricbootstrap(MersenneTwister(666), 10_000, msleep)
+tblsleep = sampsleep.tbl
+
Table with 10 columns and 10000 rows:
       obj      β1       β2       σ        σ1       σ2       ρ1          ⋯
     ┌────────────────────────────────────────────────────────────────────
  1  │ 1721.95  252.488  11.0328  22.4544  29.6185  6.33343  0.233383    ⋯
- 2  │ 1760.85  260.763  8.55352  27.3835  20.8063  4.32895  0.914676    ⋯
+ 2  │ 1760.85  260.763  8.55352  27.3835  20.8062  4.32893  0.914691    ⋯
  3  │ 1750.88  246.709  12.4613  25.9951  15.8702  6.33404  0.200358    ⋯
  4  │ 1777.33  247.683  12.9824  27.7966  27.5413  4.9878   0.121411    ⋯
- 5  │ 1738.05  245.649  10.5792  25.3596  21.5208  4.26131  0.0526768   ⋯
+ 5  │ 1738.05  245.649  10.5792  25.3596  21.5208  4.26131  0.0526769   ⋯
  6  │ 1751.25  255.669  10.1984  26.1432  22.5389  4.58209  0.225968    ⋯
  7  │ 1727.51  248.986  7.62095  24.6451  19.0858  4.34881  0.212916    ⋯
  8  │ 1754.18  246.075  11.0469  26.9407  19.8341  4.55961  -0.202146   ⋯
  9  │ 1757.47  245.407  13.7475  25.8265  20.0014  7.7647   -0.266385   ⋯
  10 │ 1752.8   253.911  11.4977  25.7077  20.6409  6.27298  0.171494    ⋯
- 11 │ 1707.8   248.887  10.1608  23.9684  10.5923  4.32048  1.0         ⋯
- 12 │ 1773.69  252.542  10.7379  26.8795  27.7959  6.2055   0.156476    ⋯
+ 11 │ 1707.8   248.887  10.1608  23.9684  10.5923  4.32039  1.0         ⋯
+ 12 │ 1773.69  252.542  10.7379  26.8795  27.7956  6.20553  0.156471    ⋯
  13 │ 1761.27  254.712  11.0373  25.7998  23.2005  7.30831  0.368175    ⋯
- 14 │ 1737.0   260.299  10.5659  24.6504  29.0113  4.26877  -0.0785722  ⋯
- 15 │ 1760.12  258.949  10.1464  27.2089  8.02971  7.01898  0.727216    ⋯
+ 14 │ 1737.0   260.299  10.5659  24.6504  29.0113  4.26877  -0.0785721  ⋯
+ 15 │ 1760.12  258.949  10.1464  27.2089  8.02793  7.01923  0.727289    ⋯
  16 │ 1723.7   249.204  11.7868  24.9861  18.6887  3.08433  0.633218    ⋯
  17 │ 1734.14  262.586  8.96611  24.0011  26.7969  5.37598  0.29709     ⋯
- 18 │ 1788.8   260.376  11.658   28.6099  26.1245  5.85586  0.0323584   ⋯
- 19 │ 1752.44  239.962  11.0195  26.2388  23.2242  4.45586  0.482518    ⋯
- 20 │ 1752.92  258.171  11.6339  25.7146  27.3026  4.87036  0.225691    ⋯
+ 18 │ 1788.8   260.376  11.658   28.6099  26.1245  5.85586  0.0323581   ⋯
+ 19 │ 1752.44  239.962  11.0195  26.2388  23.2242  4.45586  0.482511    ⋯
+ 20 │ 1752.92  258.171  11.6339  25.7146  27.3026  4.87036  0.22569     ⋯
  21 │ 1740.81  254.09   7.91985  25.2195  16.2247  6.08679  0.462549    ⋯
  22 │ 1756.6   245.791  10.3434  26.2627  23.289   5.50225  -0.143375   ⋯
- 23 │ 1759.01  256.131  9.10794  27.136   27.5008  3.51222  1.0         ⋯
+ 23 │ 1759.01  256.131  9.10794  27.136   27.501   3.51224  1.0         ⋯
  ⋮  │    ⋮        ⋮        ⋮        ⋮        ⋮        ⋮         ⋮       ⋱

the singularity can be exhibited as a standard deviation of zero or as a correlation of ±1.

-
-
confint(sampsleep)
-
+
+
confint(sampsleep)
+
DictTable with 2 columns and 6 rows:
  par   lower      upper
  ────┬───────────────────
@@ -1264,41 +1267,41 @@ 

4 Singularity

A histogram of the estimated correlations from the bootstrap sample has a spike at +1.

-
-
plt = data(tblsleep) * mapping(:ρ1) * AoG.histogram(;bins=100)
-draw(plt; axis=(;title="Parametric bootstrap samples of correlation of random effects"))
-
+
+
plt = data(tblsleep) * mapping(:ρ1) * AoG.histogram(;bins=100)
+draw(plt; axis=(;title="Parametric bootstrap samples of correlation of random effects"))
+

or, as a count,

-
-
count(tblsleep.ρ1  .≈ 1)
-
-
293
+
+
count(tblsleep.ρ1  .≈ 1)
+
+
291

Close examination of the histogram shows a few values of -1.

-
-
count(tblsleep.ρ1 .≈ -1)
-
+
+
count(tblsleep.ρ1 .≈ -1)
+
2

Furthermore there are even a few cases where the estimate of the standard deviation of the random effect for the intercept is zero.

-
-
count(tblsleep.σ1 .≈ 0)
-
-
7
+
+
count(tblsleep.σ1 .≈ 0)
+
+
6

There is a general condition to check for singularity of an estimated covariance matrix or matrices in a bootstrap sample. The parameter optimized in the estimation is θ, the relative covariance parameter. Some of the elements of this parameter vector must be non-negative and, when one of these components is approximately zero, one of the covariance matrices will be singular.

The issingular method for a MixedModel object that tests if a parameter vector θ corresponds to a boundary or singular fit.

This operation is encapsulated in a method for the issingular function that works on MixedModelBootstrap objects.

-
-
count(issingular(sampsleep))
-
-
302
+
+
count(issingular(sampsleep))
+
+
299
diff --git a/bootstrap_files/figure-html/cell-12-output-1.svg b/bootstrap_files/figure-html/cell-12-output-1.svg index 2307d3e..26a4283 100644 --- a/bootstrap_files/figure-html/cell-12-output-1.svg +++ b/bootstrap_files/figure-html/cell-12-output-1.svg @@ -2,183 +2,165 @@ - + - + - + - + + + + - + - + - + - + - + - - - - - - - - - - + - - - - - + + - - + + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -191,217 +173,217 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + diff --git a/bootstrap_files/figure-html/cell-13-output-1.svg b/bootstrap_files/figure-html/cell-13-output-1.svg index e82d903..1560f00 100644 --- a/bootstrap_files/figure-html/cell-13-output-1.svg +++ b/bootstrap_files/figure-html/cell-13-output-1.svg @@ -2,476 +2,476 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + - + - + - + - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - + + + + + + - - - - + + + + - + @@ -479,94 +479,94 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/bootstrap_files/figure-html/cell-16-output-1.svg b/bootstrap_files/figure-html/cell-16-output-1.svg index e235ba3..717682e 100644 --- a/bootstrap_files/figure-html/cell-16-output-1.svg +++ b/bootstrap_files/figure-html/cell-16-output-1.svg @@ -2,534 +2,534 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -544,652 +544,652 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1223,25 +1223,25 @@ - + - - - - + + + + - - + + - + diff --git a/bootstrap_files/figure-html/cell-17-output-1.svg b/bootstrap_files/figure-html/cell-17-output-1.svg index be05f3a..b564baa 100644 --- a/bootstrap_files/figure-html/cell-17-output-1.svg +++ b/bootstrap_files/figure-html/cell-17-output-1.svg @@ -2,429 +2,429 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -439,538 +439,538 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1000,24 +1000,24 @@ - + - - + + - - + + - - - - - + + + + + diff --git a/bootstrap_files/figure-html/cell-20-output-1.svg b/bootstrap_files/figure-html/cell-20-output-1.svg index 23e7e95..84279b7 100644 --- a/bootstrap_files/figure-html/cell-20-output-1.svg +++ b/bootstrap_files/figure-html/cell-20-output-1.svg @@ -2,153 +2,159 @@ - + - + - + - + - + - - - - + - + - + - + + + + + + + - + + + + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -160,208 +166,208 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + diff --git a/bootstrap_files/figure-html/cell-25-output-1.svg b/bootstrap_files/figure-html/cell-25-output-1.svg index e7c3972..6138f36 100644 --- a/bootstrap_files/figure-html/cell-25-output-1.svg +++ b/bootstrap_files/figure-html/cell-25-output-1.svg @@ -2,210 +2,207 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -214,387 +211,387 @@ - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -602,9 +599,9 @@ - - - + + + diff --git a/check_emotikon_transform.html b/check_emotikon_transform.html index 5124ad8..ebf1ec8 100644 --- a/check_emotikon_transform.html +++ b/check_emotikon_transform.html @@ -516,7 +516,7 @@

- + diff --git a/contrasts_fggk21.html b/contrasts_fggk21.html index 11da3d5..848716d 100644 --- a/contrasts_fggk21.html +++ b/contrasts_fggk21.html @@ -426,7 +426,7 @@

Mixed Models Tutorial: Contrast Coding

1 Setup

1.1 Packages and functions

-
+
Code
using AlgebraOfGraphics
@@ -469,7 +469,7 @@ 

1.3 Preprocessing

1.3.1 Read data

-
+
tbl = dataset(:fggk21)
Arrow.Table with 525126 rows, 7 columns, and schema:
@@ -482,7 +482,7 @@ 

-
+
df = DataFrame(tbl)
 describe(df)
@@ -590,7 +590,7 @@

1.3.2 Extract a stratified subsample

We extract a random sample of 500 children from the Sex (2) x Test (5) cells of the design. Cohort and School are random.

-
+
dat = @chain df begin
   @transform(:Sex = :Sex == "female" ? "Girls" : "Boys")
   @groupby(:Test, :Sex)
@@ -626,90 +626,90 @@ 

1

- - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + @@ -717,40 +717,40 @@

S20_r

- - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + @@ -766,121 +766,121 @@

4989

- - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + +
9 zScore-3.91914e-13-3.91921e-13 -3.1542 0.00031088 3.55078S20_r Boys2012S102763C0408478.416154.347832019S110668C0963358.884334.7619
2 S20_r Boys2015S104905C0669558.635184.347832013S102337C0396778.413424.44444
3 S20_r Boys2015S102817C0558548.547574.651162018S101424C0903378.854214.87805
4 S20_r Boys2019S100729C0756648.717324.76192012S102647C0408348.416153.92157
5 S20_r Boys2011S103627C0233438.251884.347832019S106422C0662688.632444.44444
6 S20_r Boys2017S101321C1156519.084194.76192019S103123C0955728.884334.65116
7 S20_r Boys2016S106392C1078568.996584.347832018S105004C0628818.60784.08163
8 S20_r Boys2016S101187C1070058.982894.545452014S111521C0644098.618754.44444
9 S20_r Boys2019S112525C0965018.884332013S101734C0870238.82683 5.0
Boys 2011S104796C0328598.33676S100997C0038258.0 4.87805
11 S20_r Boys2014S101205C0447278.457223.773582017S103615C0484598.479124.54545
12 S20_r Boys2012S102416C0408118.416154.545452019S110498C1060998.96924.44444
13 S20_r Boys2014S102891C0356578.375095.02013S101618C0024887.994524.44444
Run Girls2017S103536C0585288.5641107.02016S401470C0335128.350441224.0
4990 Run Girls2011S101850C0325128.33676766.02015S105028C0239798.2601927.0
4991 Run Girls2014S102416C0171358.20808830.02019S104760C0287058.3039900.0
4992 Run Girls2017S101953C0444928.45175864.02014S100341C0045298.038331116.0
4993 Run Girls2011S110929C1000168.917182018S105788C0630158.6078 990.0
4994 Run Girls2018S101771C0623488.60781080.02013S110504C0133688.16427758.0
4995 Run Girls2014S101023C0354078.37509972.02011S103690C0150268.16975910.0
4996 Run Girls2016S100833C0167008.19986864.02019S105170C0765898.717321080.0
4997 Run Girls2013S105454C0310268.33128964.02012S101527C0072318.08214918.0
4998 Run Girls2012S104425C0410588.41615846.02014S111650C0362098.37509999.0
4999 Run Girls2018S103068C0245858.273792019S100754C0469738.47091 801.0
5000 Run Girls2013S102817C0064998.07941195.02016S101758C0390508.399731025.0
@@ -890,7 +890,7 @@

1.3.3 Transformations

-
+
transform!(dat, :age, :age => (x -> x .- 8.5) => :a1) # centered age (linear)
 select!(groupby(dat, :Test), :, :score => zscore => :zScore) # z-score
@@ -927,157 +927,157 @@

1 S20_r Boys -2012 -S102763 -C040847 -8.41615 -4.34783 --0.0838467 --0.385904 +2019 +S110668 +C096335 +8.88433 +4.7619 +0.384326 +0.593648 2 S20_r Boys -2015 -S104905 -C066955 -8.63518 -4.34783 -0.135181 --0.385904 +2013 +S102337 +C039677 +8.41342 +4.44444 +-0.0865845 +-0.170993 3 S20_r Boys -2015 -S102817 -C055854 -8.54757 -4.65116 -0.0475702 -0.33109 +2018 +S101424 +C090337 +8.85421 +4.87805 +0.354209 +0.873395 4 S20_r Boys -2019 -S100729 -C075664 -8.71732 -4.7619 -0.217317 -0.59285 +2012 +S102647 +C040834 +8.41615 +3.92157 +-0.0838467 +-1.4304 5 S20_r Boys -2011 -S103627 -C023343 -8.25188 -4.34783 --0.248118 --0.385904 +2019 +S106422 +C066268 +8.63244 +4.44444 +0.132444 +-0.170993 6 S20_r Boys -2017 -S101321 -C115651 -9.08419 -4.7619 -0.584189 -0.59285 +2019 +S103123 +C095572 +8.88433 +4.65116 +0.384326 +0.326913 7 S20_r Boys -2016 -S106392 -C107856 -8.99658 -4.34783 -0.496578 --0.385904 +2018 +S105004 +C062881 +8.6078 +4.08163 +0.107803 +-1.04487 8 S20_r Boys -2016 -S101187 -C107005 -8.98289 -4.54545 -0.482888 -0.0812285 +2014 +S111521 +C064409 +8.61875 +4.44444 +0.118754 +-0.170993 9 S20_r Boys -2019 -S112525 -C096501 -8.88433 +2013 +S101734 +C087023 +8.82683 5.0 -0.384326 -1.15563 +0.326831 +1.16713 10 S20_r Boys 2011 -S104796 -C032859 -8.33676 +S100997 +C003825 +8.0 4.87805 --0.163244 -0.867378 +-0.5 +0.873395 11 S20_r Boys -2014 -S101205 -C044727 -8.45722 -3.77358 --0.0427789 --1.74323 +2017 +S103615 +C048459 +8.47912 +4.54545 +-0.0208761 +0.0723016 12 S20_r Boys -2012 -S102416 -C040811 -8.41615 -4.54545 --0.0838467 -0.0812285 +2019 +S110498 +C106099 +8.9692 +4.44444 +0.469199 +-0.170993 13 S20_r Boys -2014 -S102891 -C035657 -8.37509 -5.0 --0.124914 -1.15563 +2013 +S101618 +C002488 +7.99452 +4.44444 +-0.505476 +-0.170993 ⋮ @@ -1095,152 +1095,152 @@

4989 Run Girls -2017 -S103536 -C058528 -8.564 -1107.0 -0.0639973 -0.709804 +2016 +S401470 +C033512 +8.35044 +1224.0 +-0.149555 +1.45155 4990 Run Girls -2011 -S101850 -C032512 -8.33676 -766.0 --0.163244 --1.53402 +2015 +S105028 +C023979 +8.2601 +927.0 +-0.239904 +-0.485259 4991 Run Girls -2014 -S102416 -C017135 -8.20808 -830.0 --0.291923 --1.11289 +2019 +S104760 +C028705 +8.3039 +900.0 +-0.196099 +-0.661333 4992 Run Girls -2017 -S101953 -C044492 -8.45175 -864.0 --0.0482546 --0.889165 +2014 +S100341 +C004529 +8.03833 +1116.0 +-0.46167 +0.747257 4993 Run Girls -2011 -S110929 -C100016 -8.91718 +2018 +S105788 +C063015 +8.6078 990.0 -0.41718 --0.0600699 +0.107803 +-0.0744205 4994 Run Girls -2018 -S101771 -C062348 -8.6078 -1080.0 -0.107803 -0.532141 +2013 +S110504 +C013368 +8.16427 +758.0 +-0.335729 +-1.58735 4995 Run Girls -2014 -S101023 -C035407 -8.37509 -972.0 --0.124914 --0.178512 +2011 +S103690 +C015026 +8.16975 +910.0 +-0.330253 +-0.596121 4996 Run Girls -2016 -S100833 -C016700 -8.19986 -864.0 --0.300137 --0.889165 +2019 +S105170 +C076589 +8.71732 +1080.0 +0.217317 +0.512492 4997 Run Girls -2013 -S105454 -C031026 -8.33128 -964.0 --0.16872 --0.231153 +2012 +S101527 +C007231 +8.08214 +918.0 +-0.417864 +-0.543951 4998 Run Girls -2012 -S104425 -C041058 -8.41615 -846.0 --0.0838467 --1.00761 +2014 +S111650 +C036209 +8.37509 +999.0 +-0.124914 +-0.0157293 4999 Run Girls -2018 -S103068 -C024585 -8.27379 +2019 +S100754 +C046973 +8.47091 801.0 --0.226215 --1.30371 +-0.0290897 +-1.30694 5000 Run Girls -2013 -S102817 -C006499 -8.0794 -1195.0 --0.420602 -1.28886 +2016 +S101758 +C039050 +8.39973 +1025.0 +-0.100274 +0.153823

-
+
dat2 = combine(
   groupby(dat, [:Test, :Sex]),
   :score => mean,
@@ -1276,91 +1276,91 @@ 

1 S20_r Boys -4.59208 -0.420939 -0.191439 -0.99497 +4.57867 +0.424137 +0.152294 +1.02158 2 BPT Boys -4.0142 -0.711809 -0.365836 -0.966971 +3.9792 +0.696835 +0.328751 +0.995591 3 SLJ Boys -129.73 -18.2168 -0.228496 -0.967567 +129.246 +20.266 +0.186383 +1.04575 4 Star_r Boys -2.08087 -0.30591 -0.137967 -1.0496 +2.07038 +0.293227 +0.096337 +1.01924 5 Run Boys -1032.66 -159.495 -0.220651 -1.0495 +1036.2 +160.92 +0.226874 +1.0494 6 S20_r Girls -4.4301 -0.409872 --0.191439 -0.968811 +4.45221 +0.396463 +-0.152294 +0.954929 7 BPT Girls -3.4756 -0.657898 --0.365836 -0.893735 +3.519 +0.62376 +-0.328751 +0.891187 8 SLJ Girls -121.126 -18.4585 --0.228496 -0.980402 +122.022 +17.7489 +-0.186383 +0.915861 9 Star_r Girls -2.00045 -0.270627 --0.137967 -0.928543 +2.01495 +0.279605 +-0.096337 +0.971885 10 Run Girls -965.596 -136.182 --0.220651 -0.896095 +966.622 +136.951 +-0.226874 +0.89309 @@ -1394,7 +1394,7 @@

The levels were sorted such that these contrasts map onto four a priori hypotheses; in other words, they are theoretically motivated pairwise comparisons. The motivation also encompasses theoretically motivated interactions with Sex. The order of levels can also be explicitly specified during contrast construction. This is very useful if levels are in a different order in the dataframe. We recommend the explicit specification to increase transparency of the code.

The statistical disadvantage of SeqDiffCoding is that the contrasts are not orthogonal, that is the contrasts are correlated. This is obvious from the fact that levels 2, 3, and 4 are all used in two contrasts. One consequence of this is that correlation parameters estimated between neighboring contrasts (e.g., 2-1 and 3-2) are difficult to interpret. Usually, they will be negative because assuming some practical limitation on the overall range (e.g., between levels 1 and 3), a small “2-1” effect “correlates” negatively with a larger “3-2” effect for mathematical reasons.

Obviously, the tradeoff between theoretical motivation and statistical purity is something that must be considered carefully when planning the analysis.

-
+
contr1 = merge(
   Dict(nm => Grouping() for nm in (:School, :Child, :Cohort)),
   Dict(
@@ -1413,10 +1413,10 @@ 

-
+
f_ovi_1 = @formula zScore ~ 1 + Test + (1 | Child);
-
+
m_ovi_SeqDiff_1 = fit(MixedModel, f_ovi_1, dat; contrasts=contr1)
@@ -1433,47 +1433,47 @@

- + - - - + + + - - - - + + + + - - - - + + + + - + - - + + - - - - + + + + - + @@ -1485,7 +1485,7 @@

In this case, any differences between tests identified by the contrasts would be spurious because each test was standardized (i.e., M=0, \(SD\)=1). The differences could also be due to an imbalance in the number of boys and girls or in the number of missing observations for each test.

The primary interest in this study related to interactions of the test contrasts with and age and Sex. We start with age (linear) and its interaction with the four test contrasts.

-
+
m_ovi_SeqDiff_2 = let
   form = @formula zScore ~ 1 + Test * a1 + (1 | Child)
   fit(MixedModel, form, dat; contrasts=contr1)
@@ -1505,87 +1505,87 @@ 

- + - - - + + + - - - - + + + + - + - - + + - + - - + + - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + @@ -1598,7 +1598,7 @@

The difference between older and younger childrend is larger for Star_r than for Run (0.2473). S20_r did not differ significantly from Star_r (-0.0377) and SLJ (-0.0113) The largest difference in developmental gain was between BPT and SLJ (0.3355).

Please note that standard errors of this LMM are anti-conservative because the LMM is missing a lot of information in the RES (e..g., contrast-related VCs snd CPs for Child, School, and Cohort.

Next we add the main effect of Sex and its interaction with the four test contrasts.

-
+
m_ovi_SeqDiff_3 = let
   form = @formula zScore ~ 1 + Test * (a1 + Sex) + (1 | Child)
   fit(MixedModel, form, dat; contrasts=contr1)
@@ -1626,127 +1626,127 @@ 

- + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + @@ -1758,7 +1758,7 @@

The significant interactions with Sex reflect mostly differences related to muscle power, where the physiological constitution gives boys an advantage. The sex difference is smaller when coordination and cognition play a role – as in the Star_r test. (Caveat: SEs are estimated with an underspecified RES.)

The final step in this first series is to add the interactions between the three covariates. A significant interaction between any of the four Test contrasts and age (linear) x Sex was hypothesized to reflect a prepubertal signal (i.e., hormones start to rise in girls’ ninth year of life). However, this hypothesis is linked to a specific shape of the interaction: Girls would need to gain more than boys in tests of muscular power.

-
+
f_ovi = @formula zScore ~ 1 + Test * a1 * Sex + (1 | Child)
 m_ovi_SeqDiff = fit(MixedModel, f_ovi, dat; contrasts=contr1)
@@ -1784,167 +1784,167 @@

- - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + @@ -1972,7 +1972,7 @@

The justification for HeC3 is thatRun (1) and Star_r (2) draw more strongly on cardiosrespiratory Endurance than S20 (3) due to the longer duration of the runs compared to sprinting for 20 m which is a pure measure of the physical-fitness component Speed. Again, sports scientists are not very happy with this proposal.

Finally, HeC1 contrasts the fitness components Endurance, indicated best by Run (1), and Coordination, indicated by Star_r (2). Endurance (i.e., running for 6 minutes) is considered to be the best indicator of health-related status among the five tests because it is a rather pure measure of cardiorespiratory fitness. The Star_r test requires execution of a pre-instructed sequence of forward, sideways, and backward runs. This coordination of body movements implies a demand on working memory (i.e., remembering the order of these subruns) and executive control processes, but performats also depends on endurance. HeC1 yields a measure of Coordination “corrected” for the contribution of Endurance.

The statistical advantage of HelmertCoding is that the resulting contrasts are orthogonal (uncorrelated). This allows for optimal partitioning of variance and statistical power. It is also more efficient to estimate “orthogonal” than “non-orthogonal” random-effect structures.

-
+
contr2 = Dict(
   :School => Grouping(),
   :Child => Grouping(),
@@ -1983,7 +1983,7 @@ 

), );

-
+
m_ovi_Helmert = fit(MixedModel, f_ovi, dat; contrasts=contr2)

(Intercept)-0.0004-0.0013 0.0143-0.030.97830.7826-0.090.92820.7615
Test: Star_r-0.00140.0442-0.030.9756-0.01370.0441-0.310.7552
Test: S20_r0.00930.04400.210.83320.01640.04410.370.7096
Test: SLJ-0.0005-0.0048 0.0441-0.010.9911-0.110.9142
Test: BPT-0.00550.0442-0.120.9006-0.00100.0443-0.020.9829
Residual0.62280.6479
(Intercept)-0.0159-0.0224 0.0145-1.090.27550.7819-1.550.12170.7481
Test: Star_r-0.01160.0450-0.260.7974-0.01620.0446-0.360.7169
Test: S20_r0.00820.0101 0.04470.180.85460.230.8209
Test: SLJ0.0047-0.0049 0.04480.110.9160-0.110.9125
Test: BPT-0.0234-0.0265 0.0450-0.520.6037-0.590.5564
a10.25200.04955.09<1e-060.34800.04937.06<1e-11
Test: Star_r & a10.17960.15411.170.24380.00770.15380.050.9601
Test: S20_r & a10.03090.15430.200.84140.08030.15100.530.5948
Test: SLJ & a1-0.10540.1524-0.690.4892-0.00430.1508-0.030.9774
Test: BPT & a10.25690.15011.710.08710.40620.15432.630.0085
Residual0.61860.6535
(Intercept)-0.0151-0.0207 0.0141-1.070.28540.7457-1.470.14260.7208
Test: Star_r-0.01160.0438-0.260.7918-0.01580.0436-0.360.7164
Test: S20_r0.00800.04350.180.85450.00950.04380.220.8283
Test: SLJ0.00640.04350.150.8823-0.00560.0439-0.130.8981
Test: BPT-0.02240.0438-0.510.6097-0.02430.0440-0.550.5818
a10.23670.04804.93<1e-060.32050.04826.65<1e-10
Sex: Boys0.22660.013816.40<1e-590.19280.013913.90<1e-43
Test: Star_r & a10.15380.14991.030.30490.03940.15080.260.7940
Test: S20_r & a10.02720.15010.180.85620.07830.14800.530.5969
Test: SLJ & a1-0.13100.1483-0.880.3772-0.01270.1477-0.090.9313
Test: BPT & a10.25290.14611.730.08350.39630.15112.620.0087
Test: Star_r & Sex: Boys-0.08610.0428-2.010.0445-0.13310.0430-3.100.0020
Test: S20_r & Sex: Boys0.05550.04271.300.19320.05720.04301.330.1828
Test: SLJ & Sex: Boys0.03460.04270.810.41830.03190.04300.740.4586
Test: BPT & Sex: Boys0.13470.04293.140.00170.14050.04313.260.0011
Residual0.61730.6511
(Intercept)-0.01460.0141-1.030.30110.7441-0.02080.0142-1.470.14180.7220
Test: Star_r-0.01080.0438-0.250.8054-0.01730.0437-0.400.6928
Test: S20_r0.00900.04350.210.83620.01160.04380.260.7920
Test: SLJ0.00770.04350.180.8599-0.00570.0439-0.130.8958
Test: BPT-0.02520.0438-0.580.5644-0.02600.0440-0.590.5551
a10.23620.04804.92<1e-060.32120.04826.66<1e-10
Sex: Boys0.22980.014116.28<1e-580.19260.014213.60<1e-41
Test: Star_r & a10.15280.14981.020.30760.03980.15090.260.7920
Test: S20_r & a10.02790.15000.190.85230.07840.14790.530.5963
Test: SLJ & a1-0.13100.1483-0.880.3769-0.00900.1478-0.060.9514
Test: BPT & a10.25000.14611.710.08690.39330.15112.600.0093
Test: Star_r & Sex: Boys-0.09610.0438-2.200.0280-0.13770.0437-3.150.0016
Test: S20_r & Sex: Boys0.07050.04351.620.10480.06590.04381.500.1330
Test: SLJ & Sex: Boys0.03530.04350.810.41780.03220.04390.730.4634
Test: BPT & Sex: Boys0.12180.04382.780.00540.12900.04402.930.0034
a1 & Sex: Boys-0.05570.0480-1.160.24600.00140.04820.030.9761
Test: Star_r & a1 & Sex: Boys0.16380.14981.090.27420.08240.15090.550.5849
Test: S20_r & a1 & Sex: Boys-0.27110.1500-1.810.0707-0.14530.1479-0.980.3259
Test: SLJ & a1 & Sex: Boys0.00810.14830.050.9563-0.00680.1478-0.050.9633
Test: BPT & a1 & Sex: Boys0.21990.14611.510.13220.18920.15111.250.2105
Residual0.61800.6495
@@ -2008,167 +2008,167 @@

- - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + @@ -2192,7 +2192,7 @@

  • HyC3: Run_r - S20_r
  • HyC4: S20_r - SLJ
  • -
    +
    contr3 = Dict(
       :School => Grouping(),
       :Child => Grouping(),
    @@ -2210,7 +2210,7 @@ 

    ), );

    -
    +
    m_ovi_Hypo = fit(MixedModel, f_ovi, dat; contrasts=contr3)

    (Intercept)-0.01460.0141-1.030.30110.7441-0.02080.0142-1.470.14180.7220
    Test: Star_r-0.00540.0219-0.250.8054-0.00860.0218-0.400.6928
    Test: S20_r0.00120.01250.100.92380.00100.01260.080.9384
    Test: SLJ0.00250.00890.280.7774-0.00090.0090-0.110.9157
    Test: BPT-0.00350.0069-0.510.6086-0.00580.0070-0.830.4075
    a10.23620.04804.92<1e-060.32120.04826.66<1e-10
    Sex: Boys0.22980.014116.28<1e-580.19260.014213.60<1e-41
    Test: Star_r & a10.07640.07491.020.30760.01990.07540.260.7920
    Test: S20_r & a10.03480.04340.800.42270.03280.04230.770.4392
    Test: SLJ & a1-0.01540.0299-0.510.60790.01410.03060.460.6449
    Test: BPT & a10.04080.02321.760.07860.08710.02393.650.0003
    Test: Star_r & Sex: Boys-0.04810.0219-2.200.0280-0.06880.0218-3.150.0016
    Test: S20_r & Sex: Boys0.00750.01250.600.5508-0.00100.0126-0.080.9375
    Test: SLJ & Sex: Boys0.01260.00891.410.15910.00750.00900.840.3992
    Test: BPT & Sex: Boys0.03190.00694.62<1e-050.03030.00704.36<1e-04
    a1 & Sex: Boys-0.05570.0480-1.160.24600.00140.04820.030.9761
    Test: Star_r & a1 & Sex: Boys0.08190.07491.090.27420.04120.07540.550.5849
    Test: S20_r & a1 & Sex: Boys-0.06310.0434-1.450.1461-0.03470.0423-0.820.4124
    Test: SLJ & a1 & Sex: Boys-0.02950.0299-0.990.3244-0.01900.0306-0.620.5343
    Test: BPT & a1 & Sex: Boys0.02630.02321.130.25710.02640.02391.110.2686
    Residual0.61800.6495
    @@ -2235,167 +2235,167 @@

    - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + @@ -2407,7 +2407,7 @@

    With HypothesisCoding we must generate our own labels for the contrasts. The default labeling of contrasts is usually not interpretable. Therefore, we provide our own.

    Anyway, none of the interactions between age x Sex with the four Test contrasts was significant for these contrasts.

    -
    +
    contr1b = Dict(
       :School => Grouping(),
       :Child => Grouping(),
    @@ -2425,7 +2425,7 @@ 

    ), );

    -
    +
    m_ovi_SeqDiff_v2 = fit(MixedModel, f_ovi, dat; contrasts=contr1b)

    (Intercept)-0.01460.0141-1.030.30110.7441-0.02080.0142-1.470.14180.7220
    Test: BPT-other-0.07070.1381-0.510.6086-0.11540.1393-0.830.4075
    Test: Star-End-0.01080.0438-0.250.8054-0.01730.0437-0.400.6928
    Test: S20-Star0.00900.04350.210.83620.01160.04380.260.7920
    Test: SLJ-S200.00770.04350.180.8599-0.00570.0439-0.130.8958
    a10.23620.04804.92<1e-060.32120.04826.66<1e-10
    Sex: Boys0.22980.014116.28<1e-580.19260.014213.60<1e-41
    Test: BPT-other & a10.81590.46381.760.07861.74260.47763.650.0003
    Test: Star-End & a10.15280.14981.020.30760.03980.15090.260.7920
    Test: S20-Star & a10.02790.15000.190.85230.07840.14790.530.5963
    Test: SLJ-S20 & a1-0.13100.1483-0.880.3769-0.00900.1478-0.060.9514
    Test: BPT-other & Sex: Boys0.63780.13814.62<1e-050.60660.13934.36<1e-04
    Test: Star-End & Sex: Boys-0.09610.0438-2.200.0280-0.13770.0437-3.150.0016
    Test: S20-Star & Sex: Boys0.07050.04351.620.10480.06590.04381.500.1330
    Test: SLJ-S20 & Sex: Boys0.03530.04350.810.41780.03220.04390.730.4634
    a1 & Sex: Boys-0.05570.0480-1.160.24600.00140.04820.030.9761
    Test: BPT-other & a1 & Sex: Boys0.52560.46381.130.25710.52840.47761.110.2686
    Test: Star-End & a1 & Sex: Boys0.16380.14981.090.27420.08240.15090.550.5849
    Test: S20-Star & a1 & Sex: Boys-0.27110.1500-1.810.0707-0.14530.1479-0.980.3259
    Test: SLJ-S20 & a1 & Sex: Boys0.00810.14830.050.9563-0.00680.1478-0.050.9633
    Residual0.61800.6495
    @@ -2450,167 +2450,167 @@

    - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + @@ -2620,7 +2620,7 @@

    (Intercept)-0.01460.0141-1.030.30110.7441-0.02080.0142-1.470.14180.7220
    Test: Star-Run-0.01080.0438-0.250.8054-0.01730.0437-0.400.6928
    Test: S20-Star0.00900.04350.210.83620.01160.04380.260.7920
    Test: SLJ-S200.00770.04350.180.8599-0.00570.0439-0.130.8958
    Test: BPT-SLJ-0.02520.0438-0.580.5644-0.02600.0440-0.590.5551
    a10.23620.04804.92<1e-060.32120.04826.66<1e-10
    Sex: Boys0.22980.014116.28<1e-580.19260.014213.60<1e-41
    Test: Star-Run & a10.15280.14981.020.30760.03980.15090.260.7920
    Test: S20-Star & a10.02790.15000.190.85230.07840.14790.530.5963
    Test: SLJ-S20 & a1-0.13100.1483-0.880.3769-0.00900.1478-0.060.9514
    Test: BPT-SLJ & a10.25000.14611.710.08690.39330.15112.600.0093
    Test: Star-Run & Sex: Boys-0.09610.0438-2.200.0280-0.13770.0437-3.150.0016
    Test: S20-Star & Sex: Boys0.07050.04351.620.10480.06590.04381.500.1330
    Test: SLJ-S20 & Sex: Boys0.03530.04350.810.41780.03220.04390.730.4634
    Test: BPT-SLJ & Sex: Boys0.12180.04382.780.00540.12900.04402.930.0034
    a1 & Sex: Boys-0.05570.0480-1.160.24600.00140.04820.030.9761
    Test: Star-Run & a1 & Sex: Boys0.16380.14981.090.27420.08240.15090.550.5849
    Test: S20-Star & a1 & Sex: Boys-0.27110.1500-1.810.0707-0.14530.1479-0.980.3259
    Test: SLJ-S20 & a1 & Sex: Boys0.00810.14830.050.9563-0.00680.1478-0.050.9633
    Test: BPT-SLJ & a1 & Sex: Boys0.21990.14611.510.13220.18920.15111.250.2105
    Residual0.61800.6495
    -
    +
    m_zcp_SeqD = let
       form = @formula(
         zScore ~ 1 + Test * a1 * Sex + zerocorr(1 + Test | Child)
    @@ -2628,7 +2628,7 @@ 

    fit(MixedModel, form, dat; contrasts=contr1b) end

    -
    Minimizing 477   Time: 0:00:02 ( 4.34 ms/it)
    +
    Minimizing 499   Time: 0:00:00 ( 1.58 ms/it)
    @@ -2653,162 +2653,162 @@

    - + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - - + + + - - - + + - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - - - - + + + + - - - - + + + + @@ -2823,7 +2823,7 @@

    (Intercept)-0.0148-0.0205 0.0143-1.030.30120.8563-1.430.15160.7966
    Test: Star-Run-0.02820.0448-0.630.52890.5149-0.03980.0456-0.870.38250.5853
    Test: S20-Star0.02600.04150.630.53130.61370.02160.04230.510.60920.8205
    Test: SLJ-S200.00980.04090.240.81160.5623-0.00990.0410-0.240.80900.6129
    Test: BPT-SLJ-0.04600.0415-1.110.26790.2983-0.02140.0418-0.510.60890.3644
    a10.23770.04864.89<1e-060.32130.04886.59<1e-10
    Sex: Boys0.22980.1928 0.014316.08<1e-5713.47<1e-40
    Test: Star-Run & a10.0553 0.15810.15301.030.30140.350.7267
    Test: S20-Star & a10.01410.0715 0.14280.100.92120.500.6168
    Test: SLJ-S20 & a1-0.09370.1387-0.680.4995-0.00180.1382-0.010.9898
    Test: BPT-SLJ & a10.18490.13651.350.17550.40020.14382.780.0054
    Test: Star-Run & Sex: Boys-0.11860.0448-2.650.0081-0.13180.0456-2.890.0039
    Test: S20-Star & Sex: Boys0.08300.04152.000.04550.06860.04231.620.1044
    Test: SLJ-S20 & Sex: Boys0.03990.04090.970.33010.02850.04100.700.4862
    Test: BPT-SLJ & Sex: Boys0.11330.04152.730.00630.11520.04182.750.0059
    a1 & Sex: Boys-0.05500.0486-1.130.25790.00360.04880.070.9416
    Test: Star-Run & a1 & Sex: Boys0.12110.15300.790.42890.03120.15810.200.8436
    Test: S20-Star & a1 & Sex: Boys-0.2262-0.1196 0.1428-1.580.1131-0.840.4024
    Test: SLJ-S20 & a1 & Sex: Boys-0.01540.1387-0.110.9114-0.04780.1382-0.350.7296
    Test: BPT-SLJ & a1 & Sex: Boys0.19770.13651.450.14730.26690.14381.860.0634
    -
    +
    m_zcp_SeqD_2 = let
       form = @formula(
         zScore ~ 1 + Test * a1 * Sex + (0 + Test | Child)
    @@ -2831,7 +2831,7 @@ 

    fit(MixedModel, form, dat; contrasts=contr1b) end

    -
    Minimizing 3312      Time: 0:00:19 ( 5.77 ms/it)
    +
    Minimizing 2245      Time: 0:00:05 ( 2.34 ms/it)
    @@ -2856,162 +2856,162 @@

    - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + + - - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -3020,7 +3020,7 @@

    - + @@ -3028,7 +3028,7 @@

    - + @@ -3036,7 +3036,7 @@

    - + @@ -3044,7 +3044,7 @@

    - + @@ -3052,11 +3052,11 @@

    - + - + @@ -3066,7 +3066,7 @@

    (Intercept)-0.0140-0.0209 0.0141-0.990.3212-1.490.1371
    Test: Star-Run-0.01380.0433-0.320.7493-0.01160.0440-0.260.7924
    Test: S20-Star0.00330.04420.080.9399-0.00440.0447-0.100.9213
    Test: SLJ-S200.01520.04440.340.73150.00430.04480.100.9232
    Test: BPT-SLJ-0.02640.0438-0.600.5475-0.02840.0424-0.670.5038
    a10.23660.04794.94<1e-060.31840.04806.64<1e-10
    Sex: Boys0.22990.1946 0.014116.34<1e-5913.82<1e-42
    Test: Star-Run & a10.0531 0.15160.14831.020.30660.350.7262
    Test: S20-Star & a10.04310.15250.280.77740.08380.15040.560.5774
    Test: SLJ-S20 & a1-0.17040.1507-1.130.2581-0.00500.1504-0.030.9735
    Test: BPT-SLJ & a10.26090.14631.780.07450.38590.14562.650.0081
    Test: Star-Run & Sex: Boys-0.09210.0433-2.130.0335-0.13920.0440-3.160.0016
    Test: S20-Star & Sex: Boys0.06530.04421.480.13990.06690.04471.500.1344
    Test: SLJ-S20 & Sex: Boys0.03770.04440.850.39560.03840.04480.860.3915
    Test: BPT-SLJ & Sex: Boys0.11180.04382.550.01080.12090.04242.850.0044
    a1 & Sex: Boys-0.05630.0479-1.180.2392-0.00120.0480-0.020.9808
    Test: Star-Run & a1 & Sex: Boys0.13910.14830.940.34830.10220.15160.670.5005
    Test: S20-Star & a1 & Sex: Boys-0.27180.1525-1.780.0747-0.16440.1504-1.090.2743
    Test: SLJ-S20 & a1 & Sex: Boys0.01990.15070.130.8947-0.00790.1504-0.050.9581
    Test: BPT-SLJ & a1 & Sex: Boys0.21200.14631.450.14730.17340.14561.190.2339
    0.94240.9278
    Test: SLJ 0.98470.9719
    Test: Star_r 0.96670.9718
    Test: Run 0.93830.9706
    Test: S20_r 0.99511.0025
    Residual0.00000.0001
    -
    +
    m_cpx_0_SeqDiff = let
       f_cpx_0 = @formula(
         zScore ~ 1 + Test * a1 * Sex + (0 + Test | Child)
    @@ -3074,7 +3074,7 @@ 

    fit(MixedModel, f_cpx_0, dat; contrasts=contr1b) end

    -
    Minimizing 3312      Time: 0:00:19 ( 5.78 ms/it)
    +
    Minimizing 2245      Time: 0:00:05 ( 2.33 ms/it)
    @@ -3099,162 +3099,162 @@

    - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + + - - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -3263,7 +3263,7 @@

    - + @@ -3271,7 +3271,7 @@

    - + @@ -3279,7 +3279,7 @@

    - + @@ -3287,7 +3287,7 @@

    - + @@ -3295,11 +3295,11 @@

    - + - + @@ -3309,19 +3309,19 @@

    (Intercept)-0.0140-0.0209 0.0141-0.990.3212-1.490.1371
    Test: Star-Run-0.01380.0433-0.320.7493-0.01160.0440-0.260.7924
    Test: S20-Star0.00330.04420.080.9399-0.00440.0447-0.100.9213
    Test: SLJ-S200.01520.04440.340.73150.00430.04480.100.9232
    Test: BPT-SLJ-0.02640.0438-0.600.5475-0.02840.0424-0.670.5038
    a10.23660.04794.94<1e-060.31840.04806.64<1e-10
    Sex: Boys0.22990.1946 0.014116.34<1e-5913.82<1e-42
    Test: Star-Run & a10.0531 0.15160.14831.020.30660.350.7262
    Test: S20-Star & a10.04310.15250.280.77740.08380.15040.560.5774
    Test: SLJ-S20 & a1-0.17040.1507-1.130.2581-0.00500.1504-0.030.9735
    Test: BPT-SLJ & a10.26090.14631.780.07450.38590.14562.650.0081
    Test: Star-Run & Sex: Boys-0.09210.0433-2.130.0335-0.13920.0440-3.160.0016
    Test: S20-Star & Sex: Boys0.06530.04421.480.13990.06690.04471.500.1344
    Test: SLJ-S20 & Sex: Boys0.03770.04440.850.39560.03840.04480.860.3915
    Test: BPT-SLJ & Sex: Boys0.11180.04382.550.01080.12090.04242.850.0044
    a1 & Sex: Boys-0.05630.0479-1.180.2392-0.00120.0480-0.020.9808
    Test: Star-Run & a1 & Sex: Boys0.13910.14830.940.34830.10220.15160.670.5005
    Test: S20-Star & a1 & Sex: Boys-0.27180.1525-1.780.0747-0.16440.1504-1.090.2743
    Test: SLJ-S20 & a1 & Sex: Boys0.01990.15070.130.8947-0.00790.1504-0.050.9581
    Test: BPT-SLJ & a1 & Sex: Boys0.21200.14631.450.14730.17340.14561.190.2339
    0.94240.9278
    Test: SLJ 0.98470.9719
    Test: Star_r 0.96670.9718
    Test: Run 0.93830.9706
    Test: S20_r 0.99511.0025
    Residual0.00000.0001
    -
    +
    VarCorr(m_cpx_0_SeqDiff)
    -------+++++++ @@ -3339,8 +3339,8 @@

    - - + + @@ -3349,9 +3349,9 @@

    - - - + + + @@ -3359,38 +3359,38 @@

    - - + + + - - - - - - + + + + + - - - - - - + + + + + + - - + + @@ -3400,37 +3400,37 @@

    Child Test: Run0.880371460.938281120.9420260.970580
    Test: Star_r0.934479740.96668492+0.480.9443180.971760+0.11
    Test: S20_r0.990175050.995075401.0049911.002492+0.14 +0.44+0.40
    Test: SLJ0.969627480.98469664+0.27+0.03+0.730.9446510.971932+0.46+0.72-0.01
    Test: BPT0.888105220.94239335+0.03+0.75+0.64+0.200.8607480.927765+0.02+0.55-0.42+0.83
    Residual 0.000000000.000011650.0000000.000078
    -
    +
    m_cpx_0_SeqDiff.PCA
    (Child = 
     Principal components based on correlation matrix
    - Test: Run     1.0    .     .     .    .
    - Test: Star_r  0.48  1.0    .     .    .
    - Test: S20_r   0.44  0.4   1.0    .    .
    - Test: SLJ     0.27  0.03  0.73  1.0   .
    - Test: BPT     0.03  0.75  0.64  0.2  1.0
    + Test: Run      1.0     .      .      .      .
    + Test: Star_r   0.11   1.0     .      .      .
    + Test: S20_r    0.14   0.44   1.0     .      .
    + Test: SLJ      0.46   0.72  -0.01   1.0     .
    + Test: BPT      0.02   0.55  -0.42   0.83   1.0
     
     Normalized cumulative variances:
    -[0.5303, 0.7729, 0.9615, 0.9998, 1.0]
    +[0.4984, 0.7863, 0.9823, 0.9989, 1.0]
     
     Component loadings
                      PC1    PC2    PC3    PC4    PC5
    - Test: Run     -0.35   0.13  -0.83  -0.16   0.38
    - Test: Star_r  -0.46  -0.54  -0.2    0.49  -0.46
    - Test: S20_r   -0.55   0.28   0.17  -0.59  -0.48
    - Test: SLJ     -0.37   0.66   0.2    0.6    0.13
    - Test: BPT     -0.48  -0.41   0.45  -0.13   0.62,)
    + Test: Run -0.24 0.28 0.87 0.21 0.25 + Test: Star_r -0.52 0.31 -0.4 0.69 -0.05 + Test: S20_r -0.02 0.8 -0.23 -0.48 0.26 + Test: SLJ -0.62 -0.03 0.13 -0.43 -0.64 + Test: BPT -0.54 -0.42 -0.15 -0.25 0.67,)

    -
    +
    f_cpx_1 = @formula(
       zScore ~ 1 + Test * a1 * Sex + (1 + Test | Child)
     )
     m_cpx_1_SeqDiff =
     fit(MixedModel, f_cpx_1, dat; contrasts=contr1b)
    -
    Minimizing 2439      Time: 0:00:14 ( 5.80 ms/it)
    +
    Minimizing 2054      Time: 0:00:05 ( 2.47 ms/it)
    @@ -3455,167 +3455,167 @@

    - + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + @@ -3625,27 +3625,27 @@

    (Intercept)-0.0144-0.0208 0.0141-1.020.30650.7573-1.470.14030.7385
    Test: Star-Run-0.02160.0444-0.490.62700.6708-0.02620.0441-0.590.55270.7831
    Test: S20-Star0.01430.04400.320.74570.81100.00880.04420.200.84220.7505
    Test: SLJ-S200.00710.04330.160.87000.6998-0.00220.0440-0.050.96090.9735
    Test: BPT-SLJ-0.02910.0425-0.680.49390.7109-0.02630.0426-0.620.53780.5905
    a10.23670.04804.93<1e-060.32040.04816.66<1e-10
    Sex: Boys0.22970.1941 0.014116.28<1e-5813.73<1e-42
    Test: Star-Run & a10.16070.15171.060.28940.05830.15240.380.7019
    Test: S20-Star & a10.03230.15160.210.83100.06790.14910.460.6487
    Test: SLJ-S20 & a1-0.14950.1476-1.010.31110.00860.14820.060.9540
    Test: BPT-SLJ & a10.25290.14171.780.07430.39590.14642.700.0068
    Test: Star-Run & Sex: Boys-0.10160.0444-2.290.0220-0.13860.0441-3.150.0017
    Test: S20-Star & Sex: Boys0.07530.04401.710.08660.07100.04421.610.1079
    Test: SLJ-S20 & Sex: Boys0.03690.04330.850.39520.03230.04400.730.4636
    Test: BPT-SLJ & Sex: Boys0.11350.04252.670.00760.12200.04262.860.0042
    a1 & Sex: Boys-0.05550.0480-1.160.24760.00130.04810.030.9787
    Test: Star-Run & a1 & Sex: Boys0.12610.15170.830.40590.06520.15240.430.6685
    Test: S20-Star & a1 & Sex: Boys-0.25850.1516-1.710.0881-0.12860.1491-0.860.3886
    Test: SLJ-S20 & a1 & Sex: Boys0.00330.14760.020.9819-0.02430.1482-0.160.8697
    Test: BPT-SLJ & a1 & Sex: Boys0.20890.14171.470.14040.20040.14641.370.1709
    Residual0.00000.0004
    -
    +
    m_cpx_1_SeqDiff.PCA
    (Child = 
     Principal components based on correlation matrix
      (Intercept)      1.0     .      .      .      .
    - Test: Star-Run   0.54   1.0     .      .      .
    - Test: S20-Star  -0.12   0.68   1.0     .      .
    - Test: SLJ-S20   -0.09  -0.55  -0.13   1.0     .
    - Test: BPT-SLJ    0.08   0.09  -0.26  -0.57   1.0
    + Test: Star-Run   0.49   1.0     .      .      .
    + Test: S20-Star  -0.27   0.65   1.0     .      .
    + Test: SLJ-S20    0.17  -0.6   -0.62   1.0     .
    + Test: BPT-SLJ   -0.37   0.36   0.71  -0.43   1.0
     
     Normalized cumulative variances:
    -[0.4238, 0.7248, 0.9382, 1.0, 1.0]
    +[0.5431, 0.8399, 0.9476, 0.9966, 1.0]
     
     Component loadings
    -                   PC1    PC2    PC3    PC4    PC5
    - (Intercept)     -0.33   0.05  -0.84  -0.05   0.41
    - Test: Star-Run  -0.65  -0.24  -0.1   -0.02  -0.71
    - Test: S20-Star  -0.36  -0.6    0.37  -0.37   0.49
    - Test: SLJ-S20    0.52  -0.35  -0.33  -0.65  -0.28
    - Test: BPT-SLJ   -0.25   0.68   0.18  -0.67  -0.0,)
    + PC1 PC2 PC3 PC4 PC5 + (Intercept) -0.11 -0.79 0.22 0.22 0.52 + Test: Star-Run 0.45 -0.54 0.06 -0.13 -0.7 + Test: S20-Star 0.56 0.07 0.17 -0.67 0.45 + Test: SLJ-S20 -0.49 0.04 0.76 -0.36 -0.22 + Test: BPT-SLJ 0.48 0.28 0.58 0.6 0.03,)
    @@ -3659,7 +3659,7 @@

    +
    contr4 = Dict(
       :School => Grouping(),
       :Child => Grouping(),
    @@ -3677,10 +3677,10 @@ 

    ), );

    -
    +
    m_cpx_1_PC = fit(MixedModel, f_cpx_1, dat; contrasts=contr4)
    -
    Minimizing 1681      Time: 0:00:09 ( 5.78 ms/it)
    +
    Minimizing 1916      Time: 0:00:04 ( 2.46 ms/it)
    @@ -3705,162 +3705,162 @@

    - + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -3875,7 +3875,7 @@

    +
    VarCorr(m_cpx_1_PC)

    (Intercept)-0.0140-0.0206 0.0141-0.990.32170.7540-1.460.14460.7027
    Test: c5.1-0.02310.0432-0.530.59311.3977-0.04000.0434-0.920.35731.4474
    Test: c234.150.02510.16800.150.88111.35020.05040.16880.300.76540.8754
    Test: c2.34-0.03160.0764-0.410.67981.1365-0.01640.0774-0.210.83261.5834
    Test: c3.4-0.00480.0440-0.110.91241.07270.00310.04420.070.94491.2183
    a10.23740.04804.95<1e-060.31890.04816.63<1e-10
    Sex: Boys0.23000.1935 0.014116.32<1e-5913.70<1e-42
    Test: c5.1 & a10.28150.14581.930.05360.53230.14953.560.0004
    Test: c234.15 & a1-0.10490.5709-0.180.8543-0.92290.5784-1.600.1106
    Test: c2.34 & a10.07330.26100.280.7788-0.16330.2649-0.620.5375
    Test: c3.4 & a10.12840.14990.860.39150.01730.14850.120.9074
    Test: c5.1 & Sex: Boys0.12370.04322.870.00420.09040.04342.080.0374
    Test: c234.15 & Sex: Boys-0.62440.1680-3.720.0002-0.78580.1688-4.65<1e-05
    Test: c2.34 & Sex: Boys-0.18420.0764-2.410.0159-0.16570.0774-2.140.0323
    Test: c3.4 & Sex: Boys-0.03310.0440-0.750.4525-0.03360.0442-0.760.4471
    a1 & Sex: Boys-0.05460.0480-1.140.25540.00290.04810.060.9524
    Test: c5.1 & a1 & Sex: Boys0.09790.14580.670.50180.09360.14950.630.5311
    Test: c234.15 & a1 & Sex: Boys-0.48970.5709-0.860.3910-0.41440.5784-0.720.4737
    Test: c2.34 & a1 & Sex: Boys0.53150.26102.040.04170.30540.26491.150.2490
    Test: c3.4 & a1 & Sex: Boys-0.00540.1499-0.040.9714-0.00720.1485-0.050.9614
    @@ -3905,8 +3905,8 @@

    - - + + @@ -3915,9 +3915,9 @@

    - - - + + + @@ -3925,38 +3925,38 @@

    - - - - + + + + - - - - - + + + + + - - - - - + + + + + - + @@ -3966,31 +3966,31 @@

    +
    m_cpx_1_PC.PCA
    (Child = 
     Principal components based on correlation matrix
      (Intercept)     1.0     .      .      .      .
    - Test: c5.1     -0.03   1.0     .      .      .
    - Test: c234.15   0.88   0.03   1.0     .      .
    - Test: c2.34     0.18  -0.25   0.54   1.0     .
    - Test: c3.4     -0.01  -0.06   0.24   0.07   1.0
    + Test: c5.1     -0.04   1.0     .      .      .
    + Test: c234.15   0.93   0.2    1.0     .      .
    + Test: c2.34     0.16   0.11   0.36   1.0     .
    + Test: c3.4     -0.03  -0.03   0.07  -0.25   1.0
     
     Normalized cumulative variances:
    -[0.4324, 0.6616, 0.859, 1.0, 1.0]
    +[0.4162, 0.6571, 0.8573, 0.9971, 1.0]
     
     Component loadings
                       PC1    PC2    PC3    PC4    PC5
    - (Intercept)    -0.57  -0.33  -0.16  -0.44   0.59
    - Test: c5.1      0.1   -0.79   0.25   0.54   0.12
    - Test: c234.15  -0.67  -0.17   0.06   0.02  -0.72
    - Test: c2.34    -0.43   0.43  -0.18   0.71   0.3
    - Test: c3.4     -0.17   0.25   0.94  -0.08   0.17,)
    + (Intercept) -0.63 0.26 -0.2 0.27 -0.65 + Test: c5.1 -0.14 -0.28 0.91 0.22 -0.16 + Test: c234.15 -0.68 0.17 0.06 0.03 0.71 + Test: c2.34 -0.35 -0.54 -0.07 -0.74 -0.17 + Test: c3.4 0.06 0.73 0.36 -0.57 -0.12,)

    There is a numerical interaction with a z-value > 2.0 for the first PCA (i.e., BPT - Run_r). This interaction would really need to be replicated to be taken seriously. It is probably due to larger “unfitness” gains in boys than girls (i.e., in BPT) relative to the slightly larger health-related “fitness” gains of girls than boys (i.e., in Run_r).

    -
    +
    contr4b = merge(
       Dict(nm => Grouping() for nm in (:School, :Child, :Cohort)),
       Dict(
    @@ -4008,10 +4008,10 @@ 

    ), );

    -
    +
    m_cpx_1_PC_2 = fit(MixedModel, f_cpx_1, dat; contrasts=contr4b)
    -
    Minimizing 1651      Time: 0:00:09 ( 5.82 ms/it)
    +
    Minimizing 1148      Time: 0:00:02 ( 2.46 ms/it)

    Child (Intercept)0.568563880.754031750.493824030.70272614 Test: c5.11.953510621.39768044-0.032.095064211.44743366-0.04 Test: c234.151.823134761.35023508+0.88+0.030.766351200.87541487+0.93+0.20
    Test: c2.341.291691331.13652599+0.18-0.25+0.542.507001861.58335147+0.16+0.11+0.36
    Test: c3.41.150710421.07271171-0.01-0.06+0.241.484251841.21829875-0.03-0.03 +0.07-0.25
    Residual 0.000000000.000006070.00003566
    @@ -4036,167 +4036,167 @@

    - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - + @@ -4206,15 +4206,15 @@

    +
    VarCorr(m_cpx_1_PC_2)

    (Intercept)-0.01370.0142-0.960.33530.7072-0.01940.0143-1.360.17440.7705
    Test: c5.10.01760.03000.580.55890.42040.03280.03031.080.27950.5652
    Test: c234.150.00280.03120.090.92940.63470.00030.03130.010.99340.8700
    Test: c12.34-0.00620.0313-0.200.84340.97470.00160.03110.050.95810.5517
    Test: c3.4-0.0083-0.0009 0.0312-0.270.79040.7563-0.030.97600.6532
    a10.23250.04844.81<1e-050.30540.04876.27<1e-09
    Sex: Boys0.22370.014215.75<1e-550.18660.014313.03<1e-38
    Test: c5.1 & a1-0.18650.1012-1.840.0654-0.39330.1042-3.770.0002
    Test: c234.15 & a1-0.05940.1064-0.560.57680.10800.10771.000.3160
    Test: c12.34 & a1-0.03480.1072-0.320.7456-0.07610.1055-0.720.4708
    Test: c3.4 & a10.11040.0332 0.10581.040.29650.310.7538
    Test: c5.1 & Sex: Boys-0.10890.0300-3.620.0003-0.09080.0303-2.990.0028
    Test: c234.15 & Sex: Boys0.10160.03123.260.00110.13490.03134.31<1e-04
    Test: c12.34 & Sex: Boys-0.05640.0313-1.810.0710-0.03840.0311-1.240.2159
    Test: c3.4 & Sex: Boys-0.0156-0.0065 0.0312-0.500.6180-0.210.8355
    a1 & Sex: Boys-0.06690.0484-1.380.1669-0.00620.0487-0.130.8994
    Test: c5.1 & a1 & Sex: Boys-0.13000.1012-1.280.1989-0.13100.1042-1.260.2087
    Test: c234.15 & a1 & Sex: Boys0.00970.10640.090.92730.02080.10770.190.8471
    Test: c12.34 & a1 & Sex: Boys0.21290.10721.990.04700.11060.10551.050.2942
    Test: c3.4 & a1 & Sex: Boys0.04170.0345 0.10580.390.69320.330.7445
    Residual0.00000.0003
    ----++++@@ -4236,8 +4236,8 @@

    - - + + @@ -4246,9 +4246,9 @@

    - - - + + + @@ -4256,38 +4256,38 @@

    - - + + + - - - - - - + + + + + - - - - - - + + + + + + - - + + @@ -4297,34 +4297,34 @@

    +
    m_cpx_1_PC_2.PCA
    (Child = 
     Principal components based on correlation matrix
      (Intercept)     1.0     .      .      .      .
    - Test: c5.1     -0.61   1.0     .      .      .
    - Test: c234.15  -0.05   0.6    1.0     .      .
    - Test: c12.34    0.04   0.72   0.48   1.0     .
    - Test: c3.4      0.01  -0.14  -0.76   0.14   1.0
    + Test: c5.1      0.05   1.0     .      .      .
    + Test: c234.15  -0.19  -0.05   1.0     .      .
    + Test: c12.34   -0.08   0.66   0.19   1.0     .
    + Test: c3.4     -0.1   -0.84  -0.25  -0.41   1.0
     
     Normalized cumulative variances:
    -[0.4912, 0.7732, 0.992, 0.9997, 1.0]
    +[0.4645, 0.7088, 0.8788, 0.9906, 1.0]
     
     Component loadings
                       PC1    PC2    PC3    PC4    PC5
    - (Intercept)    -0.26  -0.39   0.76   0.04   0.46
    - Test: c5.1      0.59   0.33  -0.08   0.12   0.73
    - Test: c234.15   0.55  -0.39   0.11  -0.71  -0.14
    - Test: c12.34    0.44   0.32   0.59   0.35  -0.49
    - Test: c3.4     -0.31   0.7    0.24  -0.59   0.06,)
    + (Intercept) -0.01 0.7 -0.64 -0.32 0.04 + Test: c5.1 -0.62 0.2 0.2 0.16 0.72 + Test: c234.15 -0.16 -0.67 -0.67 -0.09 0.25 + Test: c12.34 -0.51 -0.13 0.23 -0.76 -0.3 + Test: c3.4 0.58 -0.07 0.22 -0.53 0.57,)
    -
    +
    f_zcp_1 = @formula(zScore ~ 1 + Test*a1*Sex + zerocorr(1 + Test | Child))
     m_zcp_1_PC_2 = fit(MixedModel, f_zcp_1, dat; contrasts=contr4b)
    -
    Minimizing 483   Time: 0:00:01 ( 3.93 ms/it)
    +
    Minimizing 485   Time: 0:00:00 ( 1.51 ms/it)

    Child (Intercept)0.500111550.707185650.5936548290.770489993 Test: c5.10.176755440.42042293-0.610.3194523790.565201184+0.05 Test: c234.150.402828400.634687640.7569262210.870015069-0.19 -0.05+0.60
    Test: c12.340.950099740.97473060+0.04+0.72+0.480.3043806200.551707006-0.08+0.66+0.19
    Test: c3.40.571970020.75628700+0.01-0.14-0.76+0.140.4266798240.653207336-0.10-0.84-0.25-0.41
    Residual 0.000000000.000023140.0000000830.000287906
    @@ -4349,162 +4349,162 @@

    - + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -4519,7 +4519,7 @@

    +
    VarCorr(m_zcp_1_PC_2)

    (Intercept)-0.0140-0.0195 0.0143-0.980.32840.7941-1.360.17370.7483
    Test: c5.10.01760.03070.570.56690.64040.02980.03020.990.32400.5858
    Test: c234.150.00510.03070.170.86800.23840.00160.03100.050.95840.6231
    Test: c12.34-0.00820.0317-0.260.79600.9077-0.00190.0318-0.060.95130.8468
    Test: c3.4-0.01260.0308-0.410.68250.5112-0.00160.0314-0.050.95980.6906
    a10.23050.04864.74<1e-050.30400.04876.25<1e-09
    Sex: Boys0.22320.1856 0.014315.64<1e-5412.96<1e-37
    Test: c5.1 & a1-0.19980.1033-1.930.0531-0.37210.1036-3.590.0003
    Test: c234.15 & a1-0.04900.1048-0.470.64010.10170.10710.950.3421
    Test: c12.34 & a1-0.02440.1091-0.220.8233-0.09230.1082-0.850.3933
    Test: c3.4 & a10.11810.10431.130.25760.04870.10660.460.6477
    Test: c5.1 & Sex: Boys-0.10970.0307-3.580.0003-0.09210.0302-3.050.0023
    Test: c234.15 & Sex: Boys0.11380.03073.710.00020.13490.03104.35<1e-04
    Test: c12.34 & Sex: Boys-0.05350.0317-1.690.0914-0.03670.0318-1.150.2493
    Test: c3.4 & Sex: Boys-0.01670.0308-0.540.5879-0.00640.0314-0.200.8386
    a1 & Sex: Boys-0.06310.0486-1.300.1947-0.00510.0487-0.100.9173
    Test: c5.1 & a1 & Sex: Boys-0.12170.1033-1.180.2386-0.12120.1036-1.170.2420
    Test: c234.15 & a1 & Sex: Boys0.00390.10480.040.97030.01380.10710.130.8977
    Test: c12.34 & a1 & Sex: Boys0.19550.10911.790.07310.11500.10821.060.2876
    Test: c3.4 & a1 & Sex: Boys0.03970.10430.380.70320.03140.10660.290.7687
    @@ -4549,8 +4549,8 @@

    - - + + @@ -4559,8 +4559,8 @@

    - - + + @@ -4569,8 +4569,8 @@

    - - + + @@ -4579,8 +4579,8 @@

    - - + + @@ -4589,8 +4589,8 @@

    - - + + @@ -4600,7 +4600,7 @@

    Residual

    - + @@ -4610,15 +4610,15 @@

    +
    MixedModels.likelihoodratiotest(m_zcp_1_PC_2, m_cpx_1_PC_2)

    Child (Intercept)0.630532960.794061060.559907070.74826938 Test: c5.10.410154660.640433180.343213420.58584420 . Test: c234.150.056850350.238433120.388220820.62307369 . . Test: c12.340.823954290.907719280.717070900.84680039 . . . Test: c3.40.261324290.511198880.476880650.69056546 . . . 0.000000000.000001660.00000346
    ---++-++ @@ -4636,7 +4636,7 @@

    - + @@ -4644,8 +4644,8 @@

    - - + + @@ -4660,7 +4660,7 @@

    3 Other topics

    3.1 Contrasts are re-parameterizations of the same model

    The choice of contrast does not affect the model objective, in other words, they all yield the same goodness of fit. It does not matter whether a contrast is orthogonal or not.

    -
    +
    [
       objective(m_ovi_SeqDiff),
       objective(m_ovi_Helmert),
    @@ -4668,16 +4668,16 @@ 

    ]

    3-element Vector{Float64}:
    - 13805.524890108634
    - 13805.524890108683
    - 13805.524890108614
    + 13851.100119301136 + 13851.100119301156 + 13851.100119301174

    3.2 VCs and CPs depend on contrast coding

    Trivially, the meaning of a contrast depends on its definition. Consequently, the contrast specification has a big effect on the random-effect structure. As an illustration, we refit the LMMs with variance components (VCs) and correlation parameters (CPs) for Child-related contrasts of Test. Unfortunately, it is not easy, actually rather quite difficult, to grasp the meaning of correlations of contrast-based effects; they represent two-way interactions.

    -
    +
    begin
       f_Child = @formula zScore ~
         1 + Test * a1 * Sex + (1 + Test | Child)
    @@ -4687,7 +4687,7 @@ 

    m_Child_PCA = fit(MixedModel, f_Child, dat; contrasts=contr4) end

    -
    Minimizing 1681      Time: 0:00:09 ( 5.75 ms/it)
    +
    Minimizing 1916      Time: 0:00:04 ( 2.34 ms/it)
    zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child) 261323213331 zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child) 3613330-9813502-171 10 NaN
    @@ -4712,162 +4712,162 @@

    - + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -4882,7 +4882,7 @@

    +
    VarCorr(m_Child_SDC)

    (Intercept)-0.0140-0.0206 0.0141-0.990.32170.7540-1.460.14460.7027
    Test: c5.1-0.02310.0432-0.530.59311.3977-0.04000.0434-0.920.35731.4474
    Test: c234.150.02510.16800.150.88111.35020.05040.16880.300.76540.8754
    Test: c2.34-0.03160.0764-0.410.67981.1365-0.01640.0774-0.210.83261.5834
    Test: c3.4-0.00480.0440-0.110.91241.07270.00310.04420.070.94491.2183
    a10.23740.04804.95<1e-060.31890.04816.63<1e-10
    Sex: Boys0.23000.1935 0.014116.32<1e-5913.70<1e-42
    Test: c5.1 & a10.28150.14581.930.05360.53230.14953.560.0004
    Test: c234.15 & a1-0.10490.5709-0.180.8543-0.92290.5784-1.600.1106
    Test: c2.34 & a10.07330.26100.280.7788-0.16330.2649-0.620.5375
    Test: c3.4 & a10.12840.14990.860.39150.01730.14850.120.9074
    Test: c5.1 & Sex: Boys0.12370.04322.870.00420.09040.04342.080.0374
    Test: c234.15 & Sex: Boys-0.62440.1680-3.720.0002-0.78580.1688-4.65<1e-05
    Test: c2.34 & Sex: Boys-0.18420.0764-2.410.0159-0.16570.0774-2.140.0323
    Test: c3.4 & Sex: Boys-0.03310.0440-0.750.4525-0.03360.0442-0.760.4471
    a1 & Sex: Boys-0.05460.0480-1.140.25540.00290.04810.060.9524
    Test: c5.1 & a1 & Sex: Boys0.09790.14580.670.50180.09360.14950.630.5311
    Test: c234.15 & a1 & Sex: Boys-0.48970.5709-0.860.3910-0.41440.5784-0.720.4737
    Test: c2.34 & a1 & Sex: Boys0.53150.26102.040.04170.30540.26491.150.2490
    Test: c3.4 & a1 & Sex: Boys-0.00540.1499-0.040.9714-0.00720.1485-0.050.9614
    @@ -4912,8 +4912,8 @@

    - - + + @@ -4922,9 +4922,9 @@

    - - - + + + @@ -4932,38 +4932,38 @@

    - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - + + @@ -4973,15 +4973,15 @@

    +
    VarCorr(m_Child_HeC)

    Child (Intercept)0.562117960.749745260.514582820.71734428 Test: Star_r0.522516720.72285318+0.290.440199680.66347546+0.58 Test: S20_r0.692710930.83229257-0.12+0.240.647366110.80459065-0.38+0.47
    Test: SLJ0.813920900.90217565-0.07-0.55-0.051.028715011.01425589+0.28-0.17-0.76
    Test: BPT0.430002630.65574586+0.22+0.34-0.80-0.360.547414120.73987439-0.58-0.00+0.44-0.09
    Residual 0.000000000.000021020.000000010.00010262
    ----++++@@ -5003,8 +5003,8 @@

    - - + + @@ -5013,9 +5013,9 @@

    - - - + + + @@ -5023,38 +5023,38 @@

    - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - + + @@ -5064,15 +5064,15 @@

    +
    VarCorr(m_Child_HyC)

    Child (Intercept)0.433530750.658430520.4514129370.671872709 Test: Star_r0.186297290.43162169+0.280.1622221130.402768064+0.43 Test: S20_r0.158061520.39756952+0.09+0.560.1442229000.379766903-0.21+0.79
    Test: SLJ0.055833490.23629112+0.02-0.44+0.480.0382735900.195636371+0.24-0.32-0.47
    Test: BPT0.024666540.15705584+0.03+0.30+0.44+0.140.0394517820.198624726-0.21+0.15+0.34+0.54
    Residual 0.000000000.000040790.0000001130.000336881
    ---+++@@ -5094,8 +5094,8 @@

    - - + + @@ -5104,9 +5104,9 @@

    - - - + + + @@ -5114,38 +5114,38 @@

    - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - + + @@ -5155,7 +5155,7 @@

    +
    VarCorr(m_Child_PCA)

    Child (Intercept)0.552825570.743522410.5353697710.731689668 Test: BPT-other0.674272760.82114113+1.001.3776398831.173729050+0.81 Test: Star-End0.990719270.99534882+0.30+0.310.9289311770.963810758+0.20+0.05
    Test: S20-Star1.203484861.09703458-0.15-0.13-0.031.9892354351.410402579-0.16+0.45-0.33
    Test: SLJ-S200.592157500.76951771+0.17+0.16-0.13-0.510.9658302450.982766628+0.33-0.20+0.47-0.88
    Residual 0.000000000.000026840.0000001380.000371215
    @@ -5185,8 +5185,8 @@

    - - + + @@ -5195,9 +5195,9 @@

    - - - + + + @@ -5205,38 +5205,38 @@

    - - - - + + + + - - - - - + + + + + - - - - - + + + + + - + @@ -5248,7 +5248,7 @@

    +
    begin
       f_Child0 = @formula zScore ~
         1 + Test * a1 * Sex + zerocorr(1 + Test | Child)
    @@ -5258,7 +5258,7 @@ 

    m_Child_PCA0 = fit(MixedModel, f_Child0, dat; contrasts=contr4) end

    -
    Minimizing 473   Time: 0:00:01 ( 4.00 ms/it)
    +
    Minimizing 466   Time: 0:00:00 ( 1.31 ms/it)

    Child (Intercept)0.568563880.754031750.493824030.70272614 Test: c5.11.953510621.39768044-0.032.095064211.44743366-0.04 Test: c234.151.823134761.35023508+0.88+0.030.766351200.87541487+0.93+0.20
    Test: c2.341.291691331.13652599+0.18-0.25+0.542.507001861.58335147+0.16+0.11+0.36
    Test: c3.41.150710421.07271171-0.01-0.06+0.241.484251841.21829875-0.03-0.03 +0.07-0.25
    Residual 0.000000000.000006070.00003566
    @@ -5283,162 +5283,162 @@

    - + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -5453,7 +5453,7 @@

    +
    MixedModels.likelihoodratiotest(m_Child_SDC0, m_Child_SDC)

    (Intercept)-0.0146-0.0206 0.0142-1.030.30240.8465-1.450.14610.7572
    Test: c5.1-0.02080.0430-0.480.62850.8888-0.03980.0418-0.950.34051.0616
    Test: c234.150.04920.16610.300.76720.99840.04160.16650.250.80260.3424
    Test: c2.34-0.03840.0744-0.520.60631.2892-0.02490.0784-0.320.75091.9359
    Test: c3.4-0.00620.0442-0.140.88920.92300.00900.04570.200.84431.1564
    a10.23810.04824.93<1e-060.31990.04836.63<1e-10
    Sex: Boys0.22970.1926 0.014216.19<1e-5813.58<1e-41
    Test: c5.1 & a10.29370.14542.020.04340.51700.14403.590.0003
    Test: c234.15 & a1-0.10400.5646-0.180.8538-0.94590.5711-1.660.0977
    Test: c2.34 & a10.07020.25400.280.7823-0.14800.2684-0.550.5814
    Test: c3.4 & a10.11820.15090.780.43340.01610.15380.100.9168
    Test: c5.1 & Sex: Boys0.11820.04302.750.00600.08690.04182.080.0376
    Test: c234.15 & Sex: Boys-0.62060.1661-3.740.0002-0.77750.1665-4.67<1e-05
    Test: c2.34 & Sex: Boys-0.17500.0744-2.350.0187-0.16060.0784-2.050.0404
    Test: c3.4 & Sex: Boys-0.03250.0442-0.730.4632-0.03300.0457-0.720.4702
    a1 & Sex: Boys-0.05480.0482-1.130.25640.00290.04830.060.9517
    Test: c5.1 & a1 & Sex: Boys0.12110.14540.830.40490.10910.14400.760.4485
    Test: c234.15 & a1 & Sex: Boys-0.39760.5646-0.700.4812-0.46820.5711-0.820.4124
    Test: c2.34 & a1 & Sex: Boys0.50510.25401.990.04670.30410.26841.130.2572
    Test: c3.4 & a1 & Sex: Boys0.00030.15090.000.9984-0.00860.1538-0.060.9553
    @@ -5479,7 +5479,7 @@

    - + @@ -5487,8 +5487,8 @@

    - - + + @@ -5496,15 +5496,15 @@

    +
    MixedModels.likelihoodratiotest(m_Child_HeC0, m_Child_HeC)

    zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child) 261329513413 zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child) 3613325-3013459-46 10 NaN
    -+--++ @@ -5522,7 +5522,7 @@

    - + @@ -5530,8 +5530,8 @@

    - - + + @@ -5539,15 +5539,15 @@

    +
    MixedModels.likelihoodratiotest(m_Child_HyC0, m_Child_HyC)

    zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child) 261324813415 zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child) 3613354-10713504-89 10 NaN
    --+-++ @@ -5565,7 +5565,7 @@

    - + @@ -5573,8 +5573,8 @@

    - - + + @@ -5582,7 +5582,7 @@

    +
    MixedModels.likelihoodratiotest(m_Child_PCA0, m_Child_PCA)

    zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child) 261333313412 zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child) 3613336-413516-104 10 NaN
    @@ -5608,7 +5608,7 @@

    - + @@ -5616,8 +5616,8 @@

    - - + + @@ -5626,7 +5626,7 @@

    +
    begin
       zcpLMM = ["SDC0", "HeC0", "HyC0", "PCA0"]
       mods = [m_Child_SDC0, m_Child_HeC0, m_Child_HyC0, m_Child_PCA0]
    @@ -5665,35 +5665,35 @@ 

    - + - - - + + + - + - - - + + + - - - + + + - + - - - + + +
    zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child) 261326013359 zScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child) 3613273-1313411-53 10 NaN
    1HeC0PCA0 2613247.713299.713469.213358.713410.713580.2
    2PCA0HyC0 2613259.913311.913481.313412.113464.113633.6
    3 SDC0 2613294.713346.713516.113412.913464.913634.4
    4HyC0HeC0 2613332.713384.713554.213415.513467.513636.9
    @@ -5706,7 +5706,7 @@

    3.3 VCs and CPs depend on random factor

    VCs and CPs resulting from a set of test contrasts can also be estimated for the random factor School. Of course, these VCs and CPs may look different from the ones we just estimated for Child.

    The effect of age (i.e., developmental gain) varies within School. Therefore, we also include its VCs and CPs in this model; the school-related VC for Sex was not significant.

    -
    +
    f_School = @formula zScore ~
       1 + Test * a1 * Sex + (1 + Test + a1 | School);
     m_School_SeqDiff = fit(MixedModel, f_School, dat; contrasts=contr1);
    @@ -5714,19 +5714,18 @@ 

    m_School_Hypo = fit(MixedModel, f_School, dat; contrasts=contr3); m_School_PCA = fit(MixedModel, f_School, dat; contrasts=contr4);

    -
    Minimizing 1078      Time: 0:00:00 ( 0.58 ms/it)
    -  objective:  13775.002576180374
    +
    Minimizing 1874      Time: 0:00:00 ( 0.34 ms/it)
    -
    +
    VarCorr(m_School_SeqDiff)
    --++@@ -5750,8 +5749,8 @@

    - - + + @@ -5761,9 +5760,9 @@

    - - - + + + @@ -5772,10 +5771,10 @@

    - - - - + + + + @@ -5783,41 +5782,41 @@

    - - - - - + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - + + @@ -5828,7 +5827,7 @@

    +
    VarCorr(m_School_Helmert)

    School (Intercept)0.04200860.20496000.0428840.207084 Test: Star_r0.09827650.3134909+0.140.1891690.434935-0.05 Test: S20_r0.12169380.3488464+0.05-0.190.1782290.422172-0.05-0.59 Test: SLJ0.11053190.3324634-0.17-0.21-0.630.0629110.250822+0.21-0.01-0.80
    Test: BPT0.09877570.3142859-0.23+0.54-0.42-0.370.0428200.206930-0.97+0.12-0.11-0.06
    a10.00743060.0862012+0.08+0.48-0.90+0.65+0.300.1075850.328002+0.10+0.57-0.24-0.11+0.06
    Residual 0.84894640.92138290.8467340.920182
    @@ -5860,8 +5859,8 @@

    - - + + @@ -5871,9 +5870,9 @@

    - - - + + + @@ -5882,10 +5881,10 @@

    - - - - + + + + @@ -5893,41 +5892,41 @@

    - - - - - + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - + + @@ -5938,7 +5937,7 @@

    +
    VarCorr(m_School_Hypo)

    School (Intercept)0.04200880.20496040.04288350.2070833 Test: Star_r0.02458780.1568050+0.140.04731230.2175138-0.05 Test: S20_r0.01398670.1182652+0.11+0.260.01307090.1143283-0.10-0.09 Test: SLJ0.00340510.0583532-0.13-0.04-0.000.00010810.0103977+0.72-0.56-0.47
    Test: BPT0.00204650.0452385-0.41+0.71-0.24-0.210.00140110.0374311-0.95+0.04-0.14-0.58
    a10.00742730.0861820+0.08+0.48-0.67+0.24+0.610.10760310.3280291+0.10+0.57+0.06-0.32+0.01
    Residual 0.84894160.92138030.84673480.9201820
    @@ -5970,8 +5969,8 @@

    - - + + @@ -5981,9 +5980,9 @@

    - - - + + + @@ -5992,10 +5991,10 @@

    - - - - + + + + @@ -6003,41 +6002,41 @@

    - - - - - + + + + + - - - + + + - - + + - - - - - - - + + + + + + + - - + + @@ -6048,7 +6047,7 @@

    +
    VarCorr(m_School_PCA)

    School (Intercept)0.0420080.2049580.0429000.207123 Test: BPT-other0.8187440.904845-0.410.5674350.753283-0.95 Test: Star-End0.0983620.313626+0.14+0.710.1892630.435044-0.05+0.04 Test: S20-Star0.1217630.348946+0.05-0.57-0.190.1781790.422113-0.05-0.13-0.59
    Test: SLJ-S200.1105240.332452-0.170.0642460.253467+0.20 +0.02-0.21-0.63-0.01-0.79
    a10.0074380.086245+0.08+0.61+0.48-0.90+0.650.1077550.328261+0.10+0.01+0.57-0.24-0.11
    Residual 0.8489380.9213780.8464550.920030
    @@ -6056,7 +6055,7 @@

    -+@@ -6080,8 +6079,8 @@

    - - + + @@ -6091,9 +6090,9 @@

    - - - + + + @@ -6102,10 +6101,10 @@

    - - - - + + + + @@ -6113,41 +6112,41 @@

    - - - - - + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - + + @@ -6159,7 +6158,7 @@

    +
    begin
       f_School0 = @formula zScore ~
         1 + Test * a1 * Sex + zerocorr(1 + Test + a1 | School)
    @@ -6183,9 +6182,6 @@ 

    :deviance, ) end

    -
    -
    Minimizing 287   Time: 0:00:00 ( 0.45 ms/it)
    -
    4×5 DataFrame

    School (Intercept)0.04200420.20494940.0428750.207063 Test: c5.10.13394170.3659805-0.180.0824890.287209-0.67 Test: c234.151.24395761.1153285+0.38+0.321.7102331.307759+0.35+0.40 Test: c2.340.30678100.5538781+0.04+0.29-0.660.4390320.662595-0.01+0.38+0.24
    Test: c3.40.11045160.3323425+0.17+0.19+0.38-0.180.0637450.252478-0.20+0.37+0.43-0.63
    a10.00755710.0869314+0.07+0.41-0.33+0.73-0.660.1077830.328304+0.10+0.45+0.48+0.35+0.11
    Residual 0.84895380.92138690.8465540.920084
    @@ -6212,33 +6208,33 @@

    1

    - - - + + + - - - + + + - - - + + + - - - + + +
    HeC0 2713785.113839.114015.013804.413858.414034.4
    2 PCA0 2713787.013841.014016.913813.113867.114043.1
    3 HyC0 2713790.113844.114020.113817.913871.914047.9
    4 SDC0 2713793.613847.614023.613819.913873.914049.9
    diff --git a/contrasts_kwdyz11.html b/contrasts_kwdyz11.html index 7f47529..7a48dd7 100644 --- a/contrasts_kwdyz11.html +++ b/contrasts_kwdyz11.html @@ -400,7 +400,7 @@

    Contrast Coding of Visual Attention Effects

    -
    +
    Code
    using Chain
    @@ -430,7 +430,7 @@ 

    2 Example data

    3 Preprocessing

    -
    +
    dat1 = DataFrame(dataset(:kwdyz11))
     cellmeans = combine(
       groupby(dat1, [:CTR]),
    @@ -502,11 +502,11 @@ 

    3 Preprocessing

    4 Julia contrast options

    We use the same formula for all analyses

    -
    +
    form = @formula rt ~ 1 + CTR + (1 + CTR | Subj)

    This is the default order of factor levels.

    -
    +
    show(StatsModels.levels(dat1.CTR))
    ["val", "sod", "dos", "dod"]
    @@ -520,7 +520,7 @@

    4 Julia contrast

    4.1 SeqDiffCoding

    The SeqDiffCoding contrast corresponds to MASS::contr.sdif() in R. The assignment of random factors such as Subj to Grouping() is necessary when the sample size is very large. We recommend to include it always, but in this tutorial we do so only in the first example.

    -
    +
    m1 = let levels = ["val", "sod", "dos", "dod"]
       contrasts = Dict(
         :CTR => SeqDiffCoding(; levels),
    @@ -528,10 +528,6 @@ 

    ) fit(MixedModel, form, dat1; contrasts) end

    -
    -
    Minimizing 200   Time: 0:00:00 ( 1.51 ms/it)
    -  objective:  325809.54929832555
    -
    @@ -548,34 +544,34 @@

    - + - + - + - + - - + + - + - + - - + + @@ -593,21 +589,21 @@

    4.2 HypothesisCoding

    HypothesisCoding is the most general option available. We can implement all “canned” contrasts ourselves. The next example reproduces the test statistcs from SeqDiffCoding - with a minor modification illustrating the flexibility of going beyond the default version.

    -
    -
    m1b = let levels = ["val", "sod", "dos", "dod"]
    -  contrasts = Dict(
    -    :CTR => HypothesisCoding(
    -      [
    -        -1  1 0  0
    -         0 -1 1  0
    -         0  0 1 -1
    -      ];
    -      levels,
    -      labels=["spt", "obj", "grv"],
    -    ),
    -  )
    -  fit(MixedModel, form, dat1; contrasts)
    -end
    +
    +
    m1b = let levels = ["val", "sod", "dos", "dod"]
    +  contrasts = Dict(
    +    :CTR => HypothesisCoding(
    +      [
    +        -1  1 0  0
    +         0 -1 1  0
    +         0  0 1 -1
    +      ];
    +      levels,
    +      labels=["spt", "obj", "grv"],
    +    ),
    +  )
    +  fit(MixedModel, form, dat1; contrasts)
    +end

    (Intercept) 389.73367.09137.0916 54.96 <1e-9955.199855.2018
    CTR: sod 33.78173.28743.2872 10.28 <1e-2423.248623.2464
    CTR: dos 13.98522.30576.072.30596.06 <1e-0810.753810.7563
    CTR: dod -2.74702.21432.2141 -1.240.21489.51100.21479.5079
    Residual
    @@ -624,26 +620,26 @@

    - + - + - + - + - - + + - + @@ -651,7 +647,7 @@

    2.2143

    - + @@ -670,11 +666,11 @@

    4.3 DummyCoding

    Thi contrast corresponds to contr.treatment() in R

    -
    -
    m2 = let
    -  contrasts = Dict(:CTR => DummyCoding(; base="val"))
    -  fit(MixedModel, form, dat1; contrasts)
    -end
    +
    +
    m2 = let
    +  contrasts = Dict(:CTR => DummyCoding(; base="val"))
    +  fit(MixedModel, form, dat1; contrasts)
    +end

    (Intercept) 389.73367.09157.0913 54.96 <1e-9955.201055.1994
    CTR: spt 33.78173.28713.2874 10.28 <1e-2423.246123.2486
    CTR: obj 13.98522.30596.062.30586.07 <1e-0810.756710.7552
    CTR: grv1.24 0.21489.51069.5110
    Residual
    @@ -691,38 +687,38 @@

    - + - + - + - + - + - + - + - + - + @@ -737,21 +733,21 @@

    4.4 YchycaeitCoding

    The contrasts returned by DummyCoding may be exactly what we want. Can’t we have them, but also have the intercept estimate the GM, rather than the mean of the base level? Yes, we can! We call this “You can have your cake and it eat, too”-Coding (YchycaeitCoding). And we use HypothesisCoding to achieve this outcome.

    -
    -
    m2b = let levels = ["val", "sod", "dos", "dod"]
    -  contrasts = Dict(
    -    :CTR => HypothesisCoding(
    -      [
    -        -1 1 0 0
    -        -1 0 1 0
    -        -1 0 0 1
    -      ];
    -      levels,
    -      labels=levels[2:end],
    -    )
    -  )
    -  fit(MixedModel, form, dat1; contrasts)
    -end
    +
    +
    m2b = let levels = ["val", "sod", "dos", "dod"]
    +  contrasts = Dict(
    +    :CTR => HypothesisCoding(
    +      [
    +        -1 1 0 0
    +        -1 0 1 0
    +        -1 0 0 1
    +      ];
    +      levels,
    +      labels=levels[2:end],
    +    )
    +  )
    +  fit(MixedModel, form, dat1; contrasts)
    +end

    (Intercept) 358.09146.15346.1541 58.19 <1e-9947.905547.9108
    CTR: dod 45.02004.36254.3635 10.32 <1e-2432.282132.2904
    CTR: dos 47.76693.55603.5565 13.43 <1e-4025.531425.5357
    CTR: sod 33.78173.28683.2873 10.28 <1e-2423.243623.2474
    Residual69.834969.8348
    @@ -768,10 +764,10 @@

    - + - + @@ -779,23 +775,23 @@

    3.2872

    - + - + - + - + - + @@ -814,11 +810,11 @@

    4.5 EffectsCoding

    This contrast corresponds almost to contr.sum() in R.

    -
    -
    m3 = let
    -  contrasts = Dict(:CTR => EffectsCoding(; base="dod"))
    -  fit(MixedModel, form, dat1; contrasts)
    -end
    +
    +
    m3 = let
    +  contrasts = Dict(:CTR => EffectsCoding(; base="dod"))
    +  fit(MixedModel, form, dat1; contrasts)
    +end

    (Intercept) 389.73367.09107.0908 54.96 <1e-9955.197455.1954
    CTR: sod10.28 <1e-2423.247023.2465
    CTR: dos 47.76693.55673.5562 13.43 <1e-4025.538025.5334
    CTR: dod 45.02004.36344.3632 10.32 <1e-2432.289232.2881
    Residual
    @@ -835,34 +831,34 @@

    - + - + - - - + + + - + - + - - + + - - + + - + @@ -881,11 +877,11 @@

    4.6 HelmertCoding

    HelmertCoding codes each level as the difference from the average of the lower levels. With the default order of CTR levels we get the following test statistics. These contrasts are othogonal.

    -
    -
    m4 = let
    -  contrasts = Dict(:CTR => HelmertCoding())
    -  fit(MixedModel, form, dat1; contrasts)
    -end
    +
    +
    m4 = let
    +  contrasts = Dict(:CTR => HelmertCoding())
    +  fit(MixedModel, form, dat1; contrasts)
    +end

    (Intercept) 389.73367.09217.0929 54.95 <1e-9955.205955.2125
    CTR: dos16.12481.440211.2016.12471.440511.19 <1e-287.32937.3332
    CTR: sod 2.13961.33381.3341 1.600.10876.00760.10886.0110
    CTR: val -31.64222.6425-11.972.6419-11.98 <1e-3219.951919.9472
    Residual
    @@ -905,23 +901,23 @@

    7.0930

    - + - - + + - - + + - - + + - + @@ -929,11 +925,11 @@

    0.8808

    - + - + @@ -943,18 +939,18 @@

    -
    + HeC1: (2 - 1)/2           # (391 - 358)/2
    -+ HeC2: (3 - (2+1)/2)/3     # (405 - (391 + 358)/2)/3
    -+ HeC3: (4 - (3+2+1)/3)/4   # (402 - (405 + 391 + 358)/3)/4
    +
    + HeC1: (2 - 1)/2           # (391 - 358)/2
    ++ HeC2: (3 - (2+1)/2)/3     # (405 - (391 + 358)/2)/3
    ++ HeC3: (4 - (3+2+1)/3)/4   # (402 - (405 + 391 + 358)/3)/4

    4.7 Reverse HelmertCoding

    Reverse HelmertCoding codes each level as the difference from the average of the higher levels. To estimate these effects we simply reverse the order of factor levels. Of course, the contrasts are also orthogonal.

    -
    -
    m4b = let levels = reverse(StatsModels.levels(dat1.CTR))
    -  contrasts = Dict(:CTR => HelmertCoding(; levels))
    -  fit(MixedModel, form, dat1; contrasts)
    -end
    +
    +
    m4b = let levels = reverse(StatsModels.levels(dat1.CTR))
    +  contrasts = Dict(:CTR => HelmertCoding(; levels))
    +  fit(MixedModel, form, dat1; contrasts)
    +end

    54.95 <1e-9955.213255.2131
    CTR: dos1.37341.10721.37351.1071 1.240.21484.75570.21474.7545
    CTR: sod -4.20390.6845-6.140.6841-6.15 <1e-093.35233.3465
    CTR: val-11.97 <1e-326.65086.6506
    Residual69.834769.8349
    @@ -974,23 +970,23 @@

    7.0930

    - + - - + + - - + + - - + + - + @@ -998,11 +994,11 @@

    0.8808

    - + - + @@ -1012,9 +1008,9 @@

    -
    + HeC1:(3 - 4)/2            # (405 - 402)/2
    -+ HeC2:(2 - (3+4)/2)/3      # (391 - (405 + 402)/2)/3
    -+ HeC3:(1 - (2+3+4)/3/4     # (356  -(391 + 405 + 402)/3)/4
    +
    + HeC1:(3 - 4)/2            # (405 - 402)/2
    ++ HeC2:(2 - (3+4)/2)/3      # (391 - (405 + 402)/2)/3
    ++ HeC3:(1 - (2+3+4)/3/4     # (356  -(391 + 405 + 402)/3)/4

    4.8 Anova Coding

    @@ -1022,21 +1018,21 @@

    4.8.1 A(2) x B(2)

    An A(2) x B(2) design can be recast as an F(4) design with the levels (A1-B1, A1-B2, A2-B1, A2-B2). The following contrast specifiction returns estimates for the main effect of A, the main effect of B, and the interaction of A and B. In a figure With A on the x-axis and the levels of B shown as two lines, the interaction tests the null hypothesis that the two lines are parallel. A positive coefficient implies overadditivity (diverging lines toward the right) and a negative coefficient underadditivity (converging lines).

    -
    -
    m5 = let levels = ["val", "sod", "dos", "dod"]
    -  contrasts = Dict(
    -    :CTR => HypothesisCoding(
    -      [
    -        -1 -1 +1 +1          # A
    -        -1 +1 -1 +1          # B
    -        +1 -1 -1 +1          # A x B
    -      ];
    -      levels,
    -      labels=["A", "B", "AxB"],
    -    ),
    -  )
    -  fit(MixedModel, form, dat1; contrasts)
    -end
    +
    +
    m5 = let levels = ["val", "sod", "dos", "dod"]
    +  contrasts = Dict(
    +    :CTR => HypothesisCoding(
    +      [
    +        -1 -1 +1 +1          # A
    +        -1 +1 -1 +1          # B
    +        +1 -1 -1 +1          # A x B
    +      ];
    +      levels,
    +      labels=["A", "B", "AxB"],
    +    ),
    +  )
    +  fit(MixedModel, form, dat1; contrasts)
    +end

    54.95 <1e-9955.213255.2131
    CTR: dos1.37341.10721.37351.1071 1.240.21484.75570.21474.7545
    CTR: sod -4.20390.6845-6.140.6841-6.15 <1e-093.35233.3465
    CTR: val-11.97 <1e-326.65086.6506
    Residual69.834769.8349
    @@ -1053,26 +1049,26 @@

    - + - + - - + + - + - + - + @@ -1080,7 +1076,7 @@

    3.0927

    - + @@ -1117,21 +1113,21 @@

    4.9 Nested coding

    Nested contrasts are often specified as follow up as post-hoc tests for ANOVA interactions. They are orthogonal. We specify them with HypothesisCoding.

    An A(2) x B(2) design can be recast as an F(4) design with the levels (A1-B1, A1-B2, A2-B1, A2-B2). The following contrast specifiction returns an estimate for the main effect of A and the effects of B nested in the two levels of A. In a figure With A on the x-axis and the levels of B shown as two lines, the second contrast tests whether A1-B1 is different from A1-B2 and the third contrast tests whether A2-B1 is different from A2-B2.

    -
    -
    m8 = let levels = ["val", "sod", "dos", "dod"]
    -  contrasts = Dict(
    -    :CTR => HypothesisCoding(
    -      [
    -        -1 -1 +1 +1
    -        -1 +1  0  0
    -         0  0 +1 -1
    -      ];
    -      levels,
    -      labels=["do_so", "spt", "grv"],
    -    ),
    -  )
    -  fit(MixedModel, form, dat1; contrasts)
    -end
    +
    +
    m8 = let levels = ["val", "sod", "dos", "dod"]
    +  contrasts = Dict(
    +    :CTR => HypothesisCoding(
    +      [
    +        -1 -1 +1 +1
    +        -1 +1  0  0
    +         0  0 +1 -1
    +      ];
    +      levels,
    +      labels=["do_so", "spt", "grv"],
    +    ),
    +  )
    +  fit(MixedModel, form, dat1; contrasts)
    +end
    (Intercept) 389.73367.09187.0917 54.96 <1e-9955.203255.2028
    CTR: A 59.00525.183011.385.182611.39 <1e-2936.210936.2079
    CTR: B 31.03484.67494.6750 6.64 <1e-1031.712431.7139
    CTR: AxB-11.81 <1e-3116.005616.0053
    Residual
    @@ -1148,34 +1144,34 @@

    - - + + - + - - + + - + - + - + - + - + @@ -1197,21 +1193,21 @@

    5 Other orthogona

    For factors with more than four levels there are many options for specifying orthogonal contrasts as long as one proceeds in a top-down strictly hiearchical fashion.

    Suppose you have a factor with seven levels and let’s ignore shifting colummns. In this case, you have six options for the first contrast, that is 6 vs. 1, 5 vs.2 , 4 vs. 3, 3 vs. 4, 2 vs. 5, and 1 vs. 6 levels. Then, you specify orthogonal contrasts for partitions with more than 2 elements and so on. That is, you don’t specify a contrast that crosses an earlier partition line.

    In the following example, after an initial 4 vs 3 partitioning of levels, we specify AnovaCoding for the left and HelmertCoding for the right partition.

    -
    -
    contrasts = Dict(
    -  :CTR => HypothesisCoding(
    -    [
    -      -1/4 -1/4 -1/4 -1/4 +1/3 +1/3 +1/3
    -      -1/2 -1/2 +1/2 +1/2    0    0    0
    -      -1/2 +1/2 -1/2 +1/2    0    0    0
    -      +1/2 -1/2 -1/2 +1/2    0    0    0
    -         0    0    0    0   -1   +1    0
    -         0    0    0    0 -1/2 -1/2    1
    -    ];
    -    levels=["A1", "A2", "A3", "A4", "A5", "A6", "A7"],
    -    labels=["c567.1234", "B", "C", "BxC", "c6.5", "c6.56"],
    -  ),
    -);
    +
    +
    contrasts = Dict(
    +  :CTR => HypothesisCoding(
    +    [
    +      -1/4 -1/4 -1/4 -1/4 +1/3 +1/3 +1/3
    +      -1/2 -1/2 +1/2 +1/2    0    0    0
    +      -1/2 +1/2 -1/2 +1/2    0    0    0
    +      +1/2 -1/2 -1/2 +1/2    0    0    0
    +         0    0    0    0   -1   +1    0
    +         0    0    0    0 -1/2 -1/2    1
    +    ];
    +    levels=["A1", "A2", "A3", "A4", "A5", "A6", "A7"],
    +    labels=["c567.1234", "B", "C", "BxC", "c6.5", "c6.56"],
    +  ),
    +);

    There are two rules that hold for all orthogonal contrasts:

      diff --git a/fggk21.html b/fggk21.html index 6cd1d11..dd83136 100644 --- a/fggk21.html +++ b/fggk21.html @@ -2263,10 +2263,6 @@

      ) fit(MixedModel, f, dat; contrasts) end

    -
    -
    Minimizing 148   Time: 0:00:00 ( 1.86 ms/it)
    -  objective:  25923.460469750276
    -

    (Intercept) 389.73367.093754.947.092254.95 <1e-9955.218455.2069
    CTR: do_so 59.00525.181611.395.182911.38 <1e-2936.199236.2104
    CTR: spt 33.78173.28833.2878 10.27 <1e-2423.256123.2521
    CTR: grv 2.74692.21462.2145 1.24 0.21489.51499.5132
    Residual
    @@ -2462,7 +2458,7 @@

    -
    issingular(m_zcp)
    +
    issingular(m_zcp)
    true
    @@ -2472,14 +2468,14 @@

    4.3 LMM m_cpx

    In the complex LMM investigated in this sequence we give up the assumption of zero-correlation between VCs.

    -
    m_cpx = let
    -  f = @formula(
    -    zScore ~ 1 + Test * Sex * a1 + (1 + Test + Sex + a1 | School)
    -  )
    -  fit(MixedModel, f, dat; contrasts)
    -end
    +
    m_cpx = let
    +  f = @formula(
    +    zScore ~ 1 + Test * Sex * a1 + (1 + Test + Sex + a1 | School)
    +  )
    +  fit(MixedModel, f, dat; contrasts)
    +end
    -
    Minimizing 2857      Time: 0:00:01 ( 0.69 ms/it)
    +
    Minimizing 2458      Time: 0:00:01 ( 0.45 ms/it)

    @@ -2515,16 +2511,16 @@

    0.0056

    - - + + - - + + @@ -2536,10 +2532,10 @@

    - + - + @@ -2556,7 +2552,7 @@

    0.0566

    - + @@ -2611,7 +2607,7 @@

    -0.0642

    - + @@ -2624,7 +2620,7 @@

    - + @@ -2633,17 +2629,17 @@

    - + - + - + @@ -2651,7 +2647,7 @@

    0.0011

    - + @@ -2659,7 +2655,7 @@

    0.1639

    - + @@ -2676,7 +2672,7 @@

    -
    VarCorr(m_cpx)
    +
    VarCorr(m_cpx)

    0.0310 0.180.85740.22030.85750.2202
    Test: S20_r 0.0104 0.0301 0.350.72940.17550.72930.1756
    Test: SLJTest: BMT-0.0401-0.0402 0.0305 -1.320.18810.1880 0.2242
    3.31 0.00090.76860.7687
    Test: Star_r & Sex: Girls0.0971 -0.660.50850.5086
    Sex: Girls & a1-0.1405-0.1404 0.0783 -1.79 0.0728Test: Star_r & Sex: Girls & a1 -0.16320.19750.1974 -0.83 0.4085
    Test: S20_r & Sex: Girls & a10.18620.1863 0.1961 0.950.34240.3423
    0.1941 0.010.99540.9955
    0.1942 0.840.39870.3988
    @@ -2709,8 +2705,8 @@

    - - + + @@ -2721,8 +2717,8 @@

    - - + + @@ -2733,10 +2729,10 @@

    - - + + - + @@ -2745,8 +2741,8 @@

    - - + + @@ -2769,20 +2765,20 @@

    - - + + - + - - + + @@ -2793,8 +2789,8 @@

    - - + + @@ -2807,9 +2803,9 @@

    -
    issingular(m_cpx)
    +
    issingular(m_cpx)
    -
    true
    +
    false

    The complex model may or may not be supported by the data.

    @@ -2821,7 +2817,7 @@

    4.4.1 LRT and goodness-of-fit statistics

    As the thee models are strictly hierarchically nested, we compare them with a likelihood-ratio tests (LRT) and AIC and BIC goodness-of-fit statistics derived from them.

    -
    MixedModels.likelihoodratiotest(m_ovi, m_zcp, m_cpx)
    +
    MixedModels.likelihoodratiotest(m_ovi, m_zcp, m_cpx)

    School (Intercept)0.1065060.3263520.1065390.326404 Test: Star_r0.0485100.2202510.0484840.220190 +0.10 Test: S20_r0.0308050.1755130.0308250.175570 -0.19-0.22-0.21 Test: SLJ0.0217740.1475610.0217870.147603 -0.10 +0.07 -0.83 Sex: Girls0.2008910.4482090.2009220.448243 -0.04 +0.25 +0.20-0.26-0.27 -0.10
    a10.5906830.7685590.5908680.768680 +0.02 -0.13 +0.03Residual 0.7393050.8598290.7392850.859817
    @@ -2874,18 +2870,18 @@

    Code -
    gof_summary = let
    -  nms = [:m_ovi, :m_zcp, :m_cpx]
    -  mods = eval.(nms)
    -  DataFrame(;
    -    name=nms,
    -    dof=dof.(mods),
    -    deviance=deviance.(mods),
    -    AIC=aic.(mods),
    -    AICc=aicc.(mods),
    -    BIC=bic.(mods),
    -  )
    -end
    +
    gof_summary = let
    +  nms = [:m_ovi, :m_zcp, :m_cpx]
    +  mods = eval.(nms)
    +  DataFrame(;
    +    name=nms,
    +    dof=dof.(mods),
    +    deviance=deviance.(mods),
    +    AIC=aic.(mods),
    +    AICc=aicc.(mods),
    +    BIC=bic.(mods),
    +  )
    +end
    3×6 DataFrame
    @@ -2951,34 +2947,34 @@

    Code -
    m_ovi_fe = DataFrame(coeftable(m_ovi));
    -m_zcp_fe = DataFrame(coeftable(m_zcp));
    -m_cpx_fe = DataFrame(coeftable(m_cpx));
    -m_all = hcat(
    -  m_ovi_fe[:, [1, 2, 4]],
    -  leftjoin(
    -    m_zcp_fe[:, [1, 2, 4]],
    -    m_cpx_fe[:, [1, 2, 4]];
    -    on=:Name,
    -    makeunique=true,
    -  );
    -  makeunique=true,
    -)
    -rename!(
    -  m_all,
    -  "Coef." => "b_ovi",
    -  "Coef._2" => "b_zcp",
    -  "Coef._1" => "b_cpx",
    -  "z" => "z_ovi",
    -  "z_2" => "z_zcp",
    -  "z_1" => "z_cpx",
    -)
    -m_all2 =
    -  round.(
    -    m_all[:, [:b_ovi, :b_zcp, :b_cpx, :z_ovi, :z_zcp, :z_cpx]],
    -    digits=2,
    -  )
    -m_all3 = hcat(m_all.Name, m_all2)
    +
    m_ovi_fe = DataFrame(coeftable(m_ovi));
    +m_zcp_fe = DataFrame(coeftable(m_zcp));
    +m_cpx_fe = DataFrame(coeftable(m_cpx));
    +m_all = hcat(
    +  m_ovi_fe[:, [1, 2, 4]],
    +  leftjoin(
    +    m_zcp_fe[:, [1, 2, 4]],
    +    m_cpx_fe[:, [1, 2, 4]];
    +    on=:Name,
    +    makeunique=true,
    +  );
    +  makeunique=true,
    +)
    +rename!(
    +  m_all,
    +  "Coef." => "b_ovi",
    +  "Coef._2" => "b_zcp",
    +  "Coef._1" => "b_cpx",
    +  "z" => "z_ovi",
    +  "z_2" => "z_zcp",
    +  "z_1" => "z_cpx",
    +)
    +m_all2 =
    +  round.(
    +    m_all[:, [:b_ovi, :b_zcp, :b_cpx, :z_ovi, :z_zcp, :z_cpx]],
    +    digits=2,
    +  )
    +m_all3 = hcat(m_all.Name, m_all2)
    20×7 DataFrame
    @@ -3220,10 +3216,10 @@

    -
    m_cpxCohort = let
    -  f = @formula zScore ~ 1 + Test * a1 * Sex + (1 + Test | Cohort)
    -  fit(MixedModel, f, dat; contrasts)
    -end
    +
    m_cpxCohort = let
    +  f = @formula zScore ~ 1 + Test * a1 * Sex + (1 + Test | Cohort)
    +  fit(MixedModel, f, dat; contrasts)
    +end

    @@ -3275,7 +3271,7 @@

    0.0451

    - + @@ -3418,7 +3414,7 @@

    -
    VarCorr(m_cpxCohort)
    +
    VarCorr(m_cpxCohort)

    0.22 0.82260.09580.0959
    Test: BMT
    @@ -3447,8 +3443,8 @@

    - - + + @@ -3457,8 +3453,8 @@

    - - + + @@ -3467,8 +3463,8 @@

    - - + + @@ -3477,8 +3473,8 @@

    - - + + @@ -3487,8 +3483,8 @@

    - - + + @@ -3497,8 +3493,8 @@

    - - + + @@ -3509,19 +3505,19 @@

    -
    issingular(m_cpxCohort)
    +
    issingular(m_cpxCohort)
    true

    The model is overparameterized with several CPs estimated between |.98| and |1.00|. How about the zero-correlation parameter (zcp) version of this LMM?

    -
    m_zcpCohort = let
    -  f = @formula(
    -    zScore ~ 1 + Test * a1 * Sex + zerocorr(1 + Test | Cohort)
    -  )
    -  fit(MixedModel, f, dat; contrasts)
    -end
    +
    m_zcpCohort = let
    +  f = @formula(
    +    zScore ~ 1 + Test * a1 * Sex + zerocorr(1 + Test | Cohort)
    +  )
    +  fit(MixedModel, f, dat; contrasts)
    +end

    Cohort (Intercept)0.00142720.03777880.00142700.0377751 Test: Star_r0.00376840.06138730.00376610.0613683 -0.90 Test: S20_r0.00404060.06356590.00404050.0635650 -1.00 +0.87 Test: SLJ0.00918670.09584740.00918760.0958520 +0.98 -0.97 -0.97 Test: BMT0.00108910.03300200.00108870.0329948 -1.00 +0.91 +0.99Residual 0.93531390.96711630.93531410.9671164
    @@ -3716,17 +3712,17 @@

    -
    issingular(m_zcpCohort)
    +
    issingular(m_zcpCohort)
    true

    This zcpLMM is also singular. Three of the five VCs are estimated as zero. This raises the possibility that LMM m_oviCohort might fit as well as LMM m_zcpCohort.

    -
    m_oviCohort = let
    -  f = @formula zScore ~ 1 + Test * a1 * Sex + (1 | Cohort)
    -  fit(MixedModel, f, dat; contrasts)
    -end
    +
    m_oviCohort = let
    +  f = @formula zScore ~ 1 + Test * a1 * Sex + (1 | Cohort)
    +  fit(MixedModel, f, dat; contrasts)
    +end

    @@ -3921,14 +3917,14 @@

    -
    issingular(m_oviCohort)
    +
    issingular(m_oviCohort)
    false

    This solves the problem with singularity, but does LMM m_zcpCohort fit noise relative to the LMM m_oviCohort?

    -
    MixedModels.likelihoodratiotest(m_oviCohort, m_zcpCohort)
    +
    MixedModels.likelihoodratiotest(m_oviCohort, m_zcpCohort)

    @@ -3971,16 +3967,16 @@

    -
    gof_summary2 = let
    -  mods = [m_oviCohort, m_zcpCohort, m_cpxCohort]
    -  DataFrame(;
    -    dof=dof.(mods),
    -    deviance=deviance.(mods),
    -    AIC=aic.(mods),
    -    AICc=aicc.(mods),
    -    BIC=bic.(mods),
    -  )
    -end
    +
    gof_summary2 = let
    +  mods = [m_oviCohort, m_zcpCohort, m_cpxCohort]
    +  DataFrame(;
    +    dof=dof.(mods),
    +    deviance=deviance.(mods),
    +    AIC=aic.(mods),
    +    AICc=aicc.(mods),
    +    BIC=bic.(mods),
    +  )
    +end
    3×5 DataFrame

    @@ -4055,20 +4051,20 @@

    -
    m1 = let
    -  f = @formula(
    -    zScore ~
    -      1 +
    -      Test * a1 * Sex +
    -      (1 + Test + a1 + Sex | School) +
    -      (1 + Test | Child) +
    -      zerocorr(1 + Test | Cohort)
    -  )
    -  fit(MixedModel, f, dat; contrasts)
    -end
    +
    m1 = let
    +  f = @formula(
    +    zScore ~
    +      1 +
    +      Test * a1 * Sex +
    +      (1 + Test + a1 + Sex | School) +
    +      (1 + Test | Child) +
    +      zerocorr(1 + Test | Cohort)
    +  )
    +  fit(MixedModel, f, dat; contrasts)
    +end
    -
    Minimizing 1474      Time: 0:00:19 (13.15 ms/it)
    -  objective:  24651.01449586962
    +
    Minimizing 2152      Time: 0:00:10 ( 4.81 ms/it)
    +  objective:  24651.013714010696

    @@ -4100,19 +4096,19 @@

    -0.0133

    - - - - + + + + - + - - - + + + @@ -4120,39 +4116,39 @@

    0.0092

    - - + + - + - + - - - + + + - - - - + + + + - + - + @@ -4162,7 +4158,7 @@

    -13.75

    - + @@ -4177,7 +4173,7 @@

    - + @@ -4190,7 +4186,7 @@

    -0.0633

    - + @@ -4198,8 +4194,8 @@

    - - + + @@ -4247,10 +4243,10 @@

    - + - + @@ -4280,7 +4276,7 @@

    -0.0155

    - + @@ -4297,7 +4293,7 @@

    - + @@ -4310,14 +4306,14 @@

    -
    VarCorr(m1)
    +
    VarCorr(m1)

    0.0192 -0.690.48740.58990.21380.01310.48820.58510.21370.0133
    Test: Star_r0.00890.0088 0.0375 0.240.81320.76400.33300.81340.72530.3329 0.0637
    0.0292 0.310.75350.65820.75310.6129 0.32800.00200.0000
    Test: SLJ0.00340.0033 0.0299 0.110.91070.57000.32100.91090.51700.3212 0.0336
    Test: BMT -0.0383 0.0296-1.290.19540.74250.3128-1.300.19530.70260.3129 0.0000
    a1 0.19560.05450.0544 3.59 0.0003 0.28260.2822
    <1e-42 0.14380.1437
    Test: S20_r & a1-0.0781-0.0780 0.0817 -0.96 0.33940.0769 -0.820.41060.4104 Test: BMT & a1 0.47130.08525.530.08515.54 <1e-07 a1 & Sex: Girls-0.1267-0.1266 0.1048 -1.210.22690.2270 0.1530 -0.100.91930.9194 Residual0.51840.5455
    --++@@ -4343,8 +4339,8 @@

    - - + + @@ -4355,9 +4351,9 @@

    - - - + + + @@ -4367,8 +4363,8 @@

    - - + + @@ -4379,11 +4375,11 @@

    - - + + - + @@ -4391,20 +4387,20 @@

    - - - - - - + + + + + + - - + + @@ -4415,8 +4411,8 @@

    - - + + @@ -4427,8 +4423,8 @@

    - - + + @@ -4439,8 +4435,8 @@

    - - + + @@ -4451,8 +4447,8 @@

    - - + + @@ -4463,8 +4459,8 @@

    - - + + @@ -4475,8 +4471,8 @@

    - - + + @@ -4487,8 +4483,8 @@

    - - + + @@ -4499,8 +4495,8 @@

    - - + + @@ -4511,8 +4507,8 @@

    - - + + @@ -4523,8 +4519,8 @@

    - - + + @@ -4535,8 +4531,8 @@

    - - + + @@ -4547,8 +4543,8 @@

    - - + + @@ -4561,7 +4557,7 @@

    -
    issingular(m1)
    +
    issingular(m1)
    true
    @@ -4569,20 +4565,20 @@

    -
    m2 = let
    -  f = @formula(
    -    zScore ~
    -      1 +
    -      Test * a1 * Sex +
    -      (0 + Test + a1 + Sex | School) +
    -      (0 + Test | Child) +
    -      zerocorr(0 + Test | Cohort)
    -  )
    -  fit(MixedModel, f, dat; contrasts)
    -end
    +
    m2 = let
    +  f = @formula(
    +    zScore ~
    +      1 +
    +      Test * a1 * Sex +
    +      (0 + Test + a1 + Sex | School) +
    +      (0 + Test | Child) +
    +      zerocorr(0 + Test | Cohort)
    +  )
    +  fit(MixedModel, f, dat; contrasts)
    +end
    -
    Minimizing 1592      Time: 0:00:20 (13.02 ms/it)
    -  objective:  24646.87204583089
    +
    Minimizing 1542      Time: 0:00:07 ( 4.59 ms/it)
    +  objective:  24646.87196275666

    Child (Intercept)0.348017430.589930020.34229580.5850605 Test: Star_r0.583636740.76396121+0.140.52608740.7253188+0.15 Test: S20_r0.433253150.658219680.37561170.6128717 +0.00 -0.52 Test: SLJ0.324925880.570022700.26728260.5169938 +0.05 -0.04-0.37-0.34 Test: BMT0.551356860.74253408-0.33+0.13-0.17-0.240.49365810.7026081-0.36+0.14-0.20-0.20
    School (Intercept)0.045691590.213755910.04567840.2137250 Test: Star_r0.110874410.332978100.11079990.3328662 -0.06 Test: S20_r0.107609480.328038840.10760390.3280303 -0.08 -0.39 Test: SLJ0.103025120.320975270.10317050.3212016 -0.19 +0.21 -0.80 Test: BMT0.097856750.312820640.09793440.3129448 -0.33 -0.02 +0.13 a10.079888940.282646320.07965290.2822285 +0.62 -0.20 +0.11 Sex: Girls0.020684320.143820460.02066320.1437471 -0.45 +0.45 +0.31Cohort (Intercept)0.000172920.013149960.00017630.0132772 Test: Star_r0.004059230.063712080.00405870.0637077 . Test: S20_r0.000004130.002032520.00000000.0000000 . . Test: SLJ0.001130030.033615950.00112720.0335732 . . . Test: BMT0.000000000.000000000.00000000.0000000 . . .Residual 0.268739240.518400650.29754650.5454782
    @@ -4614,7 +4610,7 @@

    -0.0136

    - + @@ -4623,11 +4619,11 @@

    Test: Star_r

    - - - + + + - + @@ -4635,8 +4631,8 @@

    0.0354

    - - + + @@ -4644,9 +4640,9 @@

    0.0052

    - - - + + + @@ -4654,19 +4650,19 @@

    -0.0388

    - - - + + + - + - + @@ -4676,7 +4672,7 @@

    -13.75

    - + @@ -4691,10 +4687,10 @@

    - + - + @@ -4764,7 +4760,7 @@

    -0.1262

    - + @@ -4774,7 +4770,7 @@

    -0.1371

    - + @@ -4794,7 +4790,7 @@

    -0.0125

    - + @@ -4815,13 +4811,13 @@

    - - + + - + @@ -4834,7 +4830,7 @@

    -
    issingular(m2)
    +
    issingular(m2)
    true
    @@ -4854,7 +4850,7 @@

    -
    VarCorr(m2)
    +
    VarCorr(m2)

    0.0195 -0.700.48460.4843 0.0093 0.03650.250.79880.79830.260.79870.8032 0.31030.02080.0209
    Test: S20_r0.17 0.86530.76890.33040.77400.3305 0.0563
    0.0339 0.150.87860.78180.24760.87870.78670.2478 0.0157
    0.0300 -1.290.19660.69830.19670.19680.70390.1969 0.0000
    a10.19340.1935 0.0545 3.55 0.0004 0.28320.2834
    <1e-42 0.14340.1433
    Test: S20_r & a1-0.1007-0.1006 0.0826 -1.220.22270.2228 0.1049 -1.200.22890.2290 0.1756 -0.780.43480.4349 0.1529 -0.080.93480.9349 0.75130.37010.75650.3702 0.0548
    Residual0.51010.5023
    @@ -4887,8 +4883,8 @@

    - - + + @@ -4899,9 +4895,9 @@

    - - - + + + @@ -4911,10 +4907,10 @@

    - - - - + + + + @@ -4923,11 +4919,11 @@

    - - - - - + + + + + @@ -4935,20 +4931,20 @@

    - - + + - - + + - - + + @@ -4959,8 +4955,8 @@

    - - + + @@ -4971,8 +4967,8 @@

    - - + + @@ -4983,8 +4979,8 @@

    - - + + @@ -4995,8 +4991,8 @@

    - - + + @@ -5007,11 +5003,11 @@

    - - + + - + @@ -5019,10 +5015,10 @@

    - - + + - + @@ -5031,8 +5027,8 @@

    - - + + @@ -5043,8 +5039,8 @@

    - - + + @@ -5055,8 +5051,8 @@

    - - + + @@ -5067,8 +5063,8 @@

    - - + + @@ -5091,8 +5087,8 @@

    - - + + @@ -5119,26 +5115,26 @@

    Cohort was estimated with CPs forced to zero. Therefore, the VCs were forced to be orthogonal; they already represent the PCA solution. However, depending on sampling, not all PCs may be identified for this random factor either.

    Importantly, again depending on sampling, a non-singular fit does not imply that unique variance is associated with all PCs (i.e., not for last PC for School). Embrace uncertainty!

    -
    MixedModels.PCA(m1)
    +
    MixedModels.PCA(m1)
    (Child = 
     Principal components based on correlation matrix
    - (Intercept)    1.0     .      .      .      .
    - Test: Star_r   0.14   1.0     .      .      .
    - Test: S20_r    0.0   -0.52   1.0     .      .
    - Test: SLJ      0.05  -0.04  -0.37   1.0     .
    - Test: BMT     -0.33   0.13  -0.17  -0.24   1.0
    + (Intercept)    1.0     .      .      .     .
    + Test: Star_r   0.15   1.0     .      .     .
    + Test: S20_r    0.0   -0.52   1.0     .     .
    + Test: SLJ      0.05  -0.04  -0.34   1.0    .
    + Test: BMT     -0.36   0.14  -0.2   -0.2   1.0
     
     Normalized cumulative variances:
    -[0.3284, 0.6158, 0.8283, 0.9385, 1.0]
    +[0.3297, 0.6164, 0.8287, 0.9358, 1.0]
     
     Component loadings
                      PC1    PC2    PC3    PC4    PC5
    - (Intercept)   -0.07   0.55   0.58  -0.59  -0.02
    - Test: Star_r  -0.6   -0.09   0.45   0.41   0.5
    - Test: S20_r    0.71   0.02   0.15   0.05   0.69
    - Test: SLJ     -0.32   0.44  -0.66  -0.21   0.47
    - Test: BMT     -0.15  -0.7   -0.01  -0.65   0.24, School = 
    + (Intercept)   -0.02   0.6    0.51   0.61   0.04
    + Test: Star_r  -0.61   0.02   0.45  -0.37  -0.53
    + Test: S20_r    0.7   -0.06   0.15   0.01  -0.69
    + Test: SLJ     -0.25   0.43  -0.72   0.2   -0.45
    + Test: BMT     -0.26  -0.67  -0.0    0.67  -0.2, School = 
     Principal components based on correlation matrix
      (Intercept)    1.0     .      .      .      .      .      .
      Test: Star_r  -0.06   1.0     .      .      .      .      .
    @@ -5149,34 +5145,34 @@ 

    + PC1 PC2 PC3 PC4 PC5 + (Intercept) 1.0 0.0 0.0 0.0 0.0 + Test: Star_r 0.0 1.0 0.0 0.0 0.0 + Test: S20_r 0.0 0.0 0.0 NaN 0.0 + Test: SLJ 0.0 0.0 1.0 0.0 0.0 + Test: BMT 0.0 0.0 0.0 0.0 NaN)
    @@ -5197,47 +5193,47 @@

    -
    MixedModels.PCA(m2)
    +
    MixedModels.PCA(m2)
    (Child = 
     Principal components based on correlation matrix
      Test: Run     1.0    .     .     .     .
    - Test: Star_r  0.5   1.0    .     .     .
    - Test: S20_r   0.56  0.64  1.0    .     .
    - Test: SLJ     0.55  0.6   0.72  1.0    .
    - Test: BMT     0.19  0.4   0.37  0.49  1.0
    + Test: Star_r  0.49  1.0    .     .     .
    + Test: S20_r   0.55  0.63  1.0    .     .
    + Test: SLJ     0.54  0.59  0.71  1.0    .
    + Test: BMT     0.19  0.4   0.36  0.48  1.0
     
     Normalized cumulative variances:
    -[0.6101, 0.7756, 0.8667, 0.948, 1.0]
    +[0.6047, 0.7707, 0.8633, 0.9461, 1.0]
     
     Component loadings
                      PC1    PC2    PC3    PC4    PC5
    - Test: Run     -0.42   0.53   0.63   0.37   0.08
    - Test: Star_r  -0.47   0.03  -0.65   0.58  -0.16
    - Test: S20_r   -0.49   0.15  -0.24  -0.49   0.66
    + Test: Run     -0.42   0.53   0.64   0.37   0.08
    + Test: Star_r  -0.47   0.03  -0.64   0.58  -0.16
    + Test: S20_r   -0.49   0.15  -0.25  -0.49   0.66
      Test: SLJ     -0.5   -0.05   0.09  -0.5   -0.7
    - Test: BMT     -0.34  -0.83   0.33   0.2    0.2, School = 
    + Test: BMT     -0.34  -0.83   0.34   0.19   0.2, School = 
     Principal components based on correlation matrix
      Test: Run      1.0     .      .      .      .      .      .
      Test: Star_r   0.53   1.0     .      .      .      .      .
      Test: S20_r    0.47   0.48   1.0     .      .      .      .
      Test: SLJ      0.47   0.76   0.41   1.0     .      .      .
      Test: BMT      0.15   0.38   0.18   0.02   1.0     .      .
    - a1             0.58   0.47   0.56  -0.05   0.65   1.0     .
    - Sex: Girls    -0.63  -0.26   0.06  -0.28  -0.58  -0.37   1.0
    + a1             0.58   0.47   0.55  -0.05   0.65   1.0     .
    + Sex: Girls    -0.63  -0.27   0.06  -0.28  -0.58  -0.37   1.0
     
     Normalized cumulative variances:
    -[0.4822, 0.694, 0.8509, 0.9554, 1.0, 1.0, 1.0]
    +[0.482, 0.6937, 0.8507, 0.9553, 1.0, 1.0, 1.0]
     
     Component loadings
                      PC1    PC2    PC3    PC4    PC5    PC6    PC7
    - Test: Run     -0.44   0.08   0.15  -0.64  -0.16   0.56   0.17
    - Test: Star_r  -0.44   0.28   0.02   0.41  -0.56   0.06  -0.49
    - Test: S20_r   -0.34   0.27  -0.58  -0.11   0.6   -0.0   -0.32
    - Test: SLJ     -0.32   0.56   0.33   0.25   0.22  -0.24   0.55
    - Test: BMT     -0.32  -0.53  -0.02   0.55   0.25   0.46   0.21
    - a1            -0.41  -0.35  -0.42  -0.14  -0.33  -0.53   0.35
    - Sex: Girls     0.34   0.35  -0.59   0.18  -0.29   0.37   0.4, Cohort = 
    + Test: Run     -0.44   0.08   0.15  -0.64  -0.16  -0.51   0.29
    + Test: Star_r  -0.44   0.28   0.02   0.41  -0.56   0.31   0.38
    + Test: S20_r   -0.34   0.27  -0.58  -0.1    0.6    0.24   0.21
    + Test: SLJ     -0.32   0.56   0.33   0.25   0.22  -0.23  -0.55
    + Test: BMT     -0.32  -0.53  -0.02   0.55   0.25  -0.47   0.19
    + a1            -0.41  -0.35  -0.42  -0.14  -0.33   0.11  -0.62
    + Sex: Girls     0.34   0.35  -0.59   0.18  -0.29  -0.55   0.0, Cohort = 
     Principal components based on correlation matrix
      Test: Run     1.0  .    .    .    .
      Test: Star_r  0.0  1.0  .    .    .
    @@ -5252,8 +5248,8 @@ 

    @@ -5268,21 +5264,21 @@

    5 Age x Sex nested in levels of Test

    In this final LMM, we test post-hoc five age x Sex interactions by nesting the interaction in the levels of Test. As this LMM m2_nested is a reparameterization of LMM m2.

    -
    m2_nested = let
    -  f = @formula(
    -    zScore ~
    -      1 +
    -      Test +
    -      Test & (a1 * Sex) +
    -      (0 + Test + a1 + Sex | School) +
    -      (0 + Test | Child) +
    -      zerocorr(0 + Test | Cohort)
    -  )
    -  fit(MixedModel, f, dat; contrasts)
    -end
    +
    m2_nested = let
    +  f = @formula(
    +    zScore ~
    +      1 +
    +      Test +
    +      Test & (a1 * Sex) +
    +      (0 + Test + a1 + Sex | School) +
    +      (0 + Test | Child) +
    +      zerocorr(0 + Test | Cohort)
    +  )
    +  fit(MixedModel, f, dat; contrasts)
    +end
    -
    Minimizing 1545      Time: 0:00:20 (13.06 ms/it)
    -  objective:  24646.871902747
    +
    Minimizing 1464      Time: 0:00:06 ( 4.55 ms/it)
    +  objective:  24646.87213270919

    Child Test: Run0.56444460.75129530.57222760.7564573 Test: Star_r0.63726780.7982906+0.500.64505730.8031546+0.49 Test: S20_r0.59125390.7689304+0.56+0.640.59904570.7739804+0.55+0.63 Test: SLJ0.61113770.7817530+0.55+0.60+0.720.61892500.7867179+0.54+0.59+0.71 Test: BMT0.48761200.69829220.49543570.7038720 +0.19 +0.40+0.37+0.49+0.36+0.48
    School Test: Run0.13695340.37007210.13705810.3702136 Test: Star_r0.09627060.31027500.09630820.3103357 +0.53 Test: S20_r0.10917820.33042120.10925460.3305368 +0.47 +0.48 Test: SLJ0.06132050.24762970.06140480.2478000 +0.47 +0.76 +0.41 Test: BMT0.03870120.19672630.03876340.1968842 +0.15 +0.38 +0.18 a10.08018960.28317760.08033420.2834328 +0.58 +0.47+0.56+0.55 -0.05 +0.65 Sex: Girls0.02057580.14344270.02052610.1432692 -0.63-0.26-0.27 +0.06 -0.28 -0.58Cohort Test: Run0.00300510.05481890.00300580.0548248 Test: Star_r0.00043420.02083860.00043520.0208614 . Test: S20_r0.00317410.05633930.00317000.0563024 . . Test: SLJ0.00024680.01571110.00024620.0156897 . . .Residual 0.26015830.51005710.25231320.5023079
    @@ -5314,7 +5310,7 @@

    5 Age x Sex

    - + @@ -5325,9 +5321,9 @@

    5 Age x Sex

    - + - + @@ -5335,8 +5331,8 @@

    5 Age x Sex

    - - + + @@ -5344,10 +5340,10 @@

    5 Age x Sex

    - - - - + + + + @@ -5355,23 +5351,23 @@

    5 Age x Sex

    - - + + - + - + - + @@ -5394,7 +5390,7 @@

    5 Age x Sex

    - + @@ -5474,7 +5470,7 @@

    5 Age x Sex

    - + @@ -5484,14 +5480,14 @@

    5 Age x Sex

    - + - + @@ -5516,7 +5512,7 @@

    5 Age x Sex

    - + @@ -5526,7 +5522,7 @@

    5 Age x Sex

    - + @@ -5535,13 +5531,13 @@

    5 Age x Sex

    - + - + @@ -5559,18 +5555,18 @@

    Code -
    gof_summary3 = let
    -  nms = [:m1, :m2, :m2_nested]
    -  mods = eval.(nms)
    -  DataFrame(;
    -    name=nms,
    -    dof=dof.(mods),
    -    deviance=deviance.(mods),
    -    AIC=aic.(mods),
    -    AICc=aicc.(mods),
    -    BIC=bic.(mods),
    -  )
    -end
    +
    gof_summary3 = let
    +  nms = [:m1, :m2, :m2_nested]
    +  mods = eval.(nms)
    +  DataFrame(;
    +    name=nms,
    +    dof=dof.(mods),
    +    deviance=deviance.(mods),
    +    AIC=aic.(mods),
    +    AICc=aicc.(mods),
    +    BIC=bic.(mods),
    +  )
    +end
    3×6 DataFrame
    @@ -5629,7 +5625,7 @@

    -
    n, p, q, k = size(m1)  # nobs, fe params, VCs+CPs, re terms
    +
    n, p, q, k = size(m1)  # nobs, fe params, VCs+CPs, re terms
    (9663, 20, 13076, 3)
    @@ -5641,37 +5637,37 @@

    -
    m1_geomdf = sum(leverage(m1))  # geom_dof
    +
    m1_geomdf = sum(leverage(m1))  # geom_dof
    -
    5672.4491657979415
    +
    5244.700177018742

    -
    sum(leverage(m2))
    +
    sum(leverage(m2))
    -
    5796.644149254227
    +
    5913.237831012837
    -
    sum(leverage(m2_nested))
    +
    sum(leverage(m2_nested))
    -
    5813.996927871189
    +
    5714.267039730008
    -
    n - m1_geomdf
    +
    n - m1_geomdf
    -
    3990.5508342020585
    +
    4418.299822981258
    -
    m1.feterm.rank
    +
    m1.feterm.rank
    20
    -
    dof(m1)
    +
    dof(m1)
    69
    @@ -5696,7 +5692,7 @@

    -
    m1.optsum            # MixedModels.OptSummary:  gets all info
    +
    m1.optsum            # MixedModels.OptSummary:  gets all info

    -0.0136 0.0195 -0.700.48430.4841 0.0365 0.26 0.79860.79900.7949 0.31030.02090.0210
    Test: S20_r0.0354 0.17 0.86530.76970.33050.76530.3304 0.0563
    0.0052 0.0339 0.150.87870.78250.24780.01560.87890.77820.24770.0154
    Test: BMT0.0300 -1.29 0.19670.69910.19680.69430.1969 0.0000
    Test: Run & a1-0.0562-0.0561 0.0783 -0.720.47350.4737
    Test: Star_r & a10.23700.2371 0.0801 2.96 0.00310.0907 0.0774 1.170.24090.2411 -0.2826 0.1572 -1.800.07220.0723 -0.1106 0.1530 -0.720.46950.4696
    Test: SLJ & a1 & Sex: Girls-0.1231-0.1232 0.1516 -0.81 0.4167 0.28340.2835
    0.14340.1433
    0.75200.7476 0.3702 0.0548
    Residual0.50890.5155
    @@ -5714,7 +5710,7 @@

    - + @@ -5762,15 +5758,15 @@

    - + - + - + @@ -5781,63 +5777,63 @@

    -
    loglikelihood(m1) # StatsBase.loglikelihood: return loglikelihood of the model
    +
    loglikelihood(m1) # StatsBase.loglikelihood: return loglikelihood of the model
    -
    -12325.50724793481
    +
    -12325.506857005348
    -
    deviance(m1)      # StatsBase.deviance: negative twice the log-likelihood relative to saturated mode`
    +
    deviance(m1)      # StatsBase.deviance: negative twice the log-likelihood relative to saturated mode`
    -
    24651.01449586962
    +
    24651.013714010696
    -
    objective(m1)    # MixedModels.objective: saturated model not clear: negative twice the log-likelihood
    +
    objective(m1)    # MixedModels.objective: saturated model not clear: negative twice the log-likelihood
    -
    24651.01449586962
    +
    24651.013714010696
    -
    nobs(m1) # n of observations; they are not independent
    +
    nobs(m1) # n of observations; they are not independent
    9663
    -
    n_, p_, q_, k_ = size(m1)
    +
    n_, p_, q_, k_ = size(m1)
    (9663, 20, 13076, 3)
    -
    dof(m1)  # n of degrees of freedom is number of model parameters
    +
    dof(m1)  # n of degrees of freedom is number of model parameters
    69
    -
    geom_df = sum(leverage(m1)) # trace of hat / rank of model matrix / geom dof
    +
    geom_df = sum(leverage(m1)) # trace of hat / rank of model matrix / geom dof
    -
    5672.4491657979415
    +
    5244.700177018742
    -
    resid_df = nobs(m1) - geom_df  # eff. residual degrees of freedom
    +
    resid_df = nobs(m1) - geom_df  # eff. residual degrees of freedom
    -
    3990.5508342020585
    +
    4418.299822981258
    -
    aic(m1)  # objective(m1) + 2*dof(m1)
    +
    aic(m1)  # objective(m1) + 2*dof(m1)
    -
    24789.01449586962
    +
    24789.013714010696
    -
    bic(m1)  # objective(m1) + dof(m1)*log(nobs(m1))
    +
    bic(m1)  # objective(m1) + dof(m1)*log(nobs(m1))
    -
    25284.16259709157
    +
    25284.16181523265
    @@ -5855,7 +5851,7 @@

    + julia> stderror(m1) # StatsBase.stderror: SE for fixed-effects coefficients + julia> propertynames(m1) # names of available extractors
    -
    coeftable(m1) # StatsBase.coeftable: fixed-effects statiscs; default level=0.95
    +
    coeftable(m1) # StatsBase.coeftable: fixed-effects statiscs; default level=0.95

    Initial objective value25840.6537554098125840.653755409716
    Optimizer settingsFunction evaluations14732151
    Final parameter vector[1.138, 0.2048, 0.0008, 0.0502, -0.4783, 1.4594, -0.6667, -0.0489, 0.2519, 1.0806, -0.5036, -0.1341, 0.975, -0.4254, 1.2492, 0.4123, -0.0382, -0.0482, -0.1148, -0.2013, 0.3377, -0.1245, 0.6412, -0.2524, 0.1239, -0.0249, -0.0896, 0.1169, 0.5783, -0.5004, 0.0587, 0.0528, 0.1349, 0.3231, -0.4144, -0.3978, -0.026, 0.3845, 0.1184, -0.1701, 0.0125, -0.0043, 0.0014, 0.0254, 0.1229, 0.0039, 0.0648, 0.0][1.0726, 0.196, 0.0007, 0.0483, -0.4584, 1.3152, -0.5947, -0.0492, 0.2535, 0.9533, -0.4134, -0.1382, 0.8501, -0.3203, 1.1238, 0.3918, -0.0359, -0.0457, -0.1096, -0.1911, 0.3216, -0.1179, 0.6092, -0.2396, 0.1182, -0.0241, -0.0863, 0.1109, 0.5497, -0.4762, 0.0564, 0.0506, 0.1283, 0.3066, -0.3949, -0.3767, -0.024, 0.3646, 0.1113, -0.1619, 0.0, 0.0, 0.0, 0.0243, 0.1168, 0.0, 0.0615, 0.0]
    Final objective value24651.014524651.0137
    Return code
    @@ -5877,141 +5873,141 @@

    - - + + - + - - + + - + - - + + - + - - + + - + - - - - + + + + - - + + - - + + - - + + - - + + - - + + - + - - - + + + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - - + + @@ -6020,88 +6016,88 @@

    -
    #Arrow.write("./data/m_cpx_fe.arrow", DataFrame(coeftable(m1)));
    +
    #Arrow.write("./data/m_cpx_fe.arrow", DataFrame(coeftable(m1)));
    -
    coef(m1)              # StatsBase.coef; parts of the table
    +
    coef(m1)              # StatsBase.coef; parts of the table
    20-element Vector{Float64}:
    - -0.013326418174543895
    -  0.008854455767991822
    -  0.009159355804501768
    -  0.0033542600278063522
    - -0.0382894498810129
    -  0.19562037117168546
    - -0.4287359064726347
    -  0.2896737283700021
    - -0.07805107265519066
    - -0.06326301586054563
    -  0.47128946887343964
    -  0.37559463121941
    - -0.18670827473612425
    - -0.06953014822894996
    - -0.2812361916524132
    - -0.1266782570629409
    - -0.13823832011459883
    -  0.1754219065821277
    - -0.015491064668230801
    -  0.1547945432078642
    + -0.013309175931007876 + 0.00884112861200947 + 0.009173006549207096 + 0.003347970943295056 + -0.03829755605578145 + 0.19557310478621426 + -0.42874120698907664 + 0.2896877613212633 + -0.078034593399739 + -0.06328624835977936 + 0.47131815525118237 + 0.3755983491272838 + -0.18670886099513845 + -0.06952475419310636 + -0.28123278216333797 + -0.12664594944222246 + -0.1382464788399039 + 0.17544785757028258 + -0.015478369943662399 + 0.15477149991315636
    -
    fixef(m1)    # MixedModels.fixef: not the same as coef() for rank-deficient case
    +
    fixef(m1)    # MixedModels.fixef: not the same as coef() for rank-deficient case
    20-element Vector{Float64}:
    - -0.013326418174543895
    -  0.008854455767991822
    -  0.009159355804501768
    -  0.0033542600278063522
    - -0.0382894498810129
    -  0.19562037117168546
    - -0.4287359064726347
    -  0.2896737283700021
    - -0.07805107265519066
    - -0.06326301586054563
    -  0.47128946887343964
    -  0.37559463121941
    - -0.18670827473612425
    - -0.06953014822894996
    - -0.2812361916524132
    - -0.1266782570629409
    - -0.13823832011459883
    -  0.1754219065821277
    - -0.015491064668230801
    -  0.1547945432078642
    + -0.013309175931007876 + 0.00884112861200947 + 0.009173006549207096 + 0.003347970943295056 + -0.03829755605578145 + 0.19557310478621426 + -0.42874120698907664 + 0.2896877613212633 + -0.078034593399739 + -0.06328624835977936 + 0.47131815525118237 + 0.3755983491272838 + -0.18670886099513845 + -0.06952475419310636 + -0.28123278216333797 + -0.12664594944222246 + -0.1382464788399039 + 0.17544785757028258 + -0.015478369943662399 + 0.15477149991315636
    -
    m1.β                  # alternative extractor
    +
    m1.β                  # alternative extractor
    20-element Vector{Float64}:
    - -0.013326418174543895
    -  0.008854455767991822
    -  0.009159355804501768
    -  0.0033542600278063522
    - -0.0382894498810129
    -  0.19562037117168546
    - -0.4287359064726347
    -  0.2896737283700021
    - -0.07805107265519066
    - -0.06326301586054563
    -  0.47128946887343964
    -  0.37559463121941
    - -0.18670827473612425
    - -0.06953014822894996
    - -0.2812361916524132
    - -0.1266782570629409
    - -0.13823832011459883
    -  0.1754219065821277
    - -0.015491064668230801
    -  0.1547945432078642
    + -0.013309175931007876 + 0.00884112861200947 + 0.009173006549207096 + 0.003347970943295056 + -0.03829755605578145 + 0.19557310478621426 + -0.42874120698907664 + 0.2896877613212633 + -0.078034593399739 + -0.06328624835977936 + 0.47131815525118237 + 0.3755983491272838 + -0.18670886099513845 + -0.06952475419310636 + -0.28123278216333797 + -0.12664594944222246 + -0.1382464788399039 + 0.17544785757028258 + -0.015478369943662399 + 0.15477149991315636
    -
    fixefnames(m1)        # works also for coefnames(m1)
    +
    fixefnames(m1)        # works also for coefnames(m1)
    20-element Vector{String}:
      "(Intercept)"
    @@ -6127,85 +6123,85 @@ 

    -
    vcov(m1)   # StatsBase.vcov: var-cov matrix of fixed-effects coefficients
    +
    vcov(m1)   # StatsBase.vcov: var-cov matrix of fixed-effects coefficients
    20×20 Matrix{Float64}:
    -  0.000368288   2.44834e-5   -1.71765e-5   …   3.89507e-6    2.86399e-6
    -  2.44834e-5    0.00140362   -0.000421413     -9.25565e-7   -1.05427e-7
    - -1.71765e-5   -0.000421413   0.000851032      2.05425e-5   -6.89378e-7
    - -2.68157e-5    5.43469e-5   -0.000468208     -2.4403e-5     1.36724e-6
    - -0.000143255   3.25955e-5   -8.0956e-6        1.40951e-6   -1.19346e-5
    - -4.45442e-5   -7.39539e-5    2.71186e-5   …  -6.03726e-5   -5.07707e-5
    - -4.4393e-5     6.34994e-5    4.35402e-5      -7.3791e-5     0.000282454
    - -2.72933e-5   -0.000442556   0.000212958      8.7071e-6     2.62752e-6
    -  3.39758e-6    0.000213337  -0.000395714     -0.00010435    8.17628e-6
    - -2.00038e-5    6.88797e-8    0.000175398      0.000158855  -6.10943e-5
    -  7.30797e-5   -2.67185e-5    2.85748e-5   …  -5.78095e-5    8.26953e-5
    -  6.91142e-6    8.70957e-7   -2.05397e-6       8.63739e-6   -0.000108162
    -  5.11841e-6   -1.95496e-6    7.66359e-6       0.000673899   0.000117963
    - -5.24346e-6   -1.56019e-6   -4.65511e-6      -0.00136393    0.000576546
    - -1.12612e-6    6.33588e-7   -9.0277e-7        0.000577209  -0.00171459
    - -4.55233e-6   -1.20844e-5    3.61454e-7   …   0.000151279  -0.0039188
    - -1.28132e-5   -2.83547e-5    2.85268e-5      -0.000138513   0.00179136
    -  4.97663e-7    2.85838e-5   -4.69381e-5      -0.0115833    -0.00195403
    -  3.89507e-6   -9.25565e-7    2.05425e-5       0.0234041    -0.00998137
    -  2.86399e-6   -1.05427e-7   -6.89378e-7      -0.00998137    0.028954
    + 0.000368635 2.45792e-5 -1.71701e-5 … 3.89162e-6 2.86536e-6 + 2.45792e-5 0.00140338 -0.000421256 -9.25828e-7 -1.01803e-7 + -1.71701e-5 -0.000421256 0.000850508 2.05407e-5 -6.94443e-7 + -2.69531e-5 5.44958e-5 -0.000468487 -2.44026e-5 1.37399e-6 + -0.000143158 3.23114e-5 -7.73605e-6 1.42228e-6 -1.1939e-5 + -4.43036e-5 -7.44531e-5 2.75121e-5 … -6.02434e-5 -5.10277e-5 + -4.42495e-5 6.33177e-5 4.36646e-5 -7.38279e-5 0.000282193 + -2.73321e-5 -0.000442566 0.000212961 8.73037e-6 2.58046e-6 + 3.44344e-6 0.000213339 -0.000395718 -0.000104391 8.2411e-6 + -2.00104e-5 6.84757e-8 0.00017538 0.000158887 -6.11795e-5 + 7.30063e-5 -2.66966e-5 2.85523e-5 … -5.78951e-5 8.27559e-5 + 6.8883e-6 8.75889e-7 -2.05673e-6 8.64112e-6 -0.000108103 + 5.13543e-6 -1.95673e-6 7.6624e-6 0.000673791 0.000117897 + -5.22672e-6 -1.56384e-6 -4.64923e-6 -0.00136393 0.00057671 + -1.15216e-6 6.37557e-7 -9.07973e-7 0.000577376 -0.00171451 + -4.58987e-6 -1.2076e-5 3.53589e-7 … 0.000152721 -0.00391891 + -1.28113e-5 -2.83483e-5 2.85153e-5 -0.000138431 0.00179013 + 4.95604e-7 2.85708e-5 -4.69151e-5 -0.0115817 -0.00195263 + 3.89162e-6 -9.25828e-7 2.05407e-5 0.0234045 -0.00998454 + 2.86536e-6 -1.01803e-7 -6.94443e-7 -0.00998454 0.0289529
    -
    vcov(m1; corr=true) # StatsBase.vcov: correlation matrix of fixed-effects coefficients
    +
    vcov(m1; corr=true) # StatsBase.vcov: correlation matrix of fixed-effects coefficients
    20×20 Matrix{Float64}:
    -  1.0           0.0340528    -0.0306808    …   0.00132671    0.000877047
    -  0.0340528     1.0          -0.385576        -0.000161486  -1.65376e-5
    - -0.0306808    -0.385576      1.0              0.00460293   -0.000138877
    - -0.0467202     0.0485019    -0.53663         -0.00533341    0.000268658
    - -0.252442      0.0294224    -0.00938471       0.000311577  -0.00237191
    - -0.042626     -0.0362505     0.0170715    …  -0.00724721   -0.00547944
    - -0.0741752     0.0543479     0.0478581       -0.0154666     0.0532268
    - -0.0160258    -0.133107      0.0822583        0.000641336   0.000174001
    -  0.00216723    0.069706     -0.166049        -0.00834977    0.000588207
    - -0.0135579     2.39133e-5    0.0782035        0.013506     -0.00467003
    -  0.0447212    -0.00837526    0.0115033    …  -0.00443776    0.00570739
    -  0.00705007    0.000455085  -0.0013783        0.00110524   -0.0124435
    -  0.00561361   -0.00109828    0.00552918       0.0927148     0.0145913
    - -0.00613755   -0.000935458  -0.00358449      -0.20027       0.0761115
    - -0.00118495    0.0003415    -0.000624902      0.0761894    -0.203476
    - -0.00226294   -0.00307704    0.000118199  …   0.00943335   -0.219701
    - -0.00380265   -0.00431046    0.00556933      -0.00515665    0.0599587
    -  0.00015876    0.00467083   -0.00985034      -0.463536     -0.0703032
    -  0.00132671   -0.000161486   0.00460293       1.0          -0.383433
    -  0.000877047  -1.65376e-5   -0.000138877     -0.383433      1.0
    + 1.0 0.034173 -0.0306645 … 0.0013249 0.00087707 + 0.034173 1.0 -0.385585 -0.000161545 -1.59708e-5 + -0.0306645 -0.385585 1.0 0.00460389 -0.000139943 + -0.0469365 0.0486379 -0.537103 -0.00533317 0.000269982 + -0.252126 0.0291655 -0.00896978 0.000314368 -0.0023726 + -0.0423789 -0.036501 0.0173258 … -0.00723216 -0.00550768 + -0.0739018 0.054198 0.0480103 -0.0154745 0.0531796 + -0.0160409 -0.133121 0.082284 0.00064304 0.000170886 + 0.00219556 0.0697161 -0.16611 -0.00835342 0.000592911 + -0.013556 2.37752e-5 0.0782197 0.0135086 -0.00467665 + 0.0446562 -0.00836926 0.011498 … -0.00444438 0.00571178 + 0.00702311 0.000457696 -0.00138056 0.0011057 -0.0124367 + 0.00562978 -0.0010994 0.00553017 0.0927017 0.0145838 + -0.00611506 -0.000937725 -0.00358105 -0.200268 0.0761344 + -0.0012118 0.000343676 -0.00062871 0.0762125 -0.203475 + -0.00228051 -0.00307513 0.000115661 … 0.00952306 -0.219709 + -0.00380026 -0.00430982 0.00556876 -0.00515349 0.059918 + 0.000158033 0.00466925 -0.00984883 -0.463483 -0.0702561 + 0.0013249 -0.000161545 0.00460389 1.0 -0.383559 + 0.00087707 -1.59708e-5 -0.000139943 -0.383559 1.0
    -
    stderror(m1)       # StatsBase.stderror: SE for fixed-effects coefficients
    +
    stderror(m1)       # StatsBase.stderror: SE for fixed-effects coefficients
    20-element Vector{Float64}:
    - 0.019190838609013373
    - 0.037464904374354346
    - 0.029172457183929874
    - 0.029908246837066204
    - 0.029570247247537502
    - 0.05445314275453583
    - 0.03118620045393219
    - 0.08874454325857666
    - 0.08169050540658983
    - 0.07688237996024007
    - 0.08515085655609324
    - 0.05108338328710162
    - 0.047511503910903
    - 0.0445173183865237
    - 0.049521334150376524
    - 0.10482540178954916
    - 0.17558064233009524
    - 0.16334323024815908
    - 0.15298414940873858
    - 0.17015877736759646
    + 0.019199856900105894 + 0.03746166680712168 + 0.0291634720215121 + 0.029908947317869982 + 0.02957320203560786 + 0.054449180355270105 + 0.031185689283858727 + 0.0887451746553604 + 0.08168636248556593 + 0.07688213791581955 + 0.08514931328708582 + 0.05108399545794252 + 0.0475102604276537 + 0.04451750030660286 + 0.049520299057707835 + 0.1048264966769763 + 0.17558244602551348 + 0.16333872136135616 + 0.1529853565566417 + 0.17015555631913265
    -
    propertynames(m1)  # names of available extractors
    +
    propertynames(m1)  # names of available extractors
    (:formula, :reterms, :Xymat, :feterm, :sqrtwts, :parmap, :dims, :A, :L, :optsum, :θ, :theta, :β, :beta, :βs, :betas, :λ, :lambda, :stderror, :σ, :sigma, :σs, :sigmas, :σρs, :sigmarhos, :b, :u, :lowerbd, :X, :y, :corr, :vcov, :PCA, :rePCA, :objective, :pvalues)
    @@ -6223,26 +6219,26 @@

    -
    issingular(m1) # Test if model is singular for paramter vector m1.theta (default)
    +
    issingular(m1) # Test if model is singular for paramter vector m1.theta (default)
    true

    -
    issingular(m2)
    +
    issingular(m2)
    true
    -
    VarCorr(m1) # MixedModels.VarCorr: estimates of random-effect structure (RES)
    +
    VarCorr(m1) # MixedModels.VarCorr: estimates of random-effect structure (RES)

    (Intercept)-0.01332640.0191908-0.01330920.0191999 -0.690.48740.4882
    Test: Star_r0.008854460.03746490.008841130.0374617 0.240.81320.8134
    Test: S20_r0.009159360.02917250.009173010.0291635 0.310.75350.7531
    Test: SLJ0.003354260.02990820.003347970.0299089 0.110.91070.9109
    Test: BMT-0.03828940.0295702-1.290.1954-0.03829760.0295732-1.300.1953
    a10.195620.05445310.1955730.0544492 3.59 0.0003
    Sex: Girls-0.4287360.0311862-0.4287410.0311857 -13.75 <1e-42
    Test: Star_r & a10.2896740.08874450.2896880.0887452 3.26 0.0011
    Test: S20_r & a1-0.07805110.0816905-0.07803460.0816864 -0.96 0.3394
    Test: SLJ & a1-0.0632630.0768824-0.06328620.0768821 -0.820.41060.4104
    Test: BMT & a10.4712890.08515095.530.4713180.08514935.54 <1e-07
    Test: Star_r & Sex: Girls0.3755950.05108340.3755980.051084 7.35 <1e-12
    Test: S20_r & Sex: Girls-0.1867080.0475115-0.1867090.0475103 -3.93 <1e-04
    Test: SLJ & Sex: Girls-0.06953010.0445173-0.06952480.0445175 -1.56 0.1183
    Test: BMT & Sex: Girls-0.2812360.0495213-0.2812330.0495203 -5.68 <1e-07
    a1 & Sex: Girls-0.1266780.104825-0.1266460.104826 -1.210.22690.2270
    Test: Star_r & a1 & Sex: Girls-0.1382380.175581-0.1382460.175582 -0.79 0.4311
    Test: S20_r & a1 & Sex: Girls0.1754220.1633430.1754480.163339 1.07 0.2828
    Test: SLJ & a1 & Sex: Girls-0.01549110.152984-0.01547840.152985 -0.100.91930.9194
    Test: BMT & a1 & Sex: Girls0.1547950.1701590.1547710.170156 0.91 0.3630
    --++@@ -6268,8 +6264,8 @@

    - - + + @@ -6280,9 +6276,9 @@

    - - - + + + @@ -6292,8 +6288,8 @@

    - - + + @@ -6304,11 +6300,11 @@

    - - + + - + @@ -6316,20 +6312,20 @@

    - - - - - - + + + + + + - - + + @@ -6340,8 +6336,8 @@

    - - + + @@ -6352,8 +6348,8 @@

    - - + + @@ -6364,8 +6360,8 @@

    - - + + @@ -6376,8 +6372,8 @@

    - - + + @@ -6388,8 +6384,8 @@

    - - + + @@ -6400,8 +6396,8 @@

    - - + + @@ -6412,8 +6408,8 @@

    - - + + @@ -6424,8 +6420,8 @@

    - - + + @@ -6436,8 +6432,8 @@

    - - + + @@ -6448,8 +6444,8 @@

    - - + + @@ -6460,8 +6456,8 @@

    - - + + @@ -6472,8 +6468,8 @@

    - - + + @@ -6486,7 +6482,7 @@

    -
    VarCorr(m2)
    +
    VarCorr(m2)

    Child (Intercept)0.348017430.589930020.34229580.5850605 Test: Star_r0.583636740.76396121+0.140.52608740.7253188+0.15 Test: S20_r0.433253150.658219680.37561170.6128717 +0.00 -0.52 Test: SLJ0.324925880.570022700.26728260.5169938 +0.05 -0.04-0.37-0.34 Test: BMT0.551356860.74253408-0.33+0.13-0.17-0.240.49365810.7026081-0.36+0.14-0.20-0.20
    School (Intercept)0.045691590.213755910.04567840.2137250 Test: Star_r0.110874410.332978100.11079990.3328662 -0.06 Test: S20_r0.107609480.328038840.10760390.3280303 -0.08 -0.39 Test: SLJ0.103025120.320975270.10317050.3212016 -0.19 +0.21 -0.80 Test: BMT0.097856750.312820640.09793440.3129448 -0.33 -0.02 +0.13 a10.079888940.282646320.07965290.2822285 +0.62 -0.20 +0.11 Sex: Girls0.020684320.143820460.02066320.1437471 -0.45 +0.45 +0.31Cohort (Intercept)0.000172920.013149960.00017630.0132772 Test: Star_r0.004059230.063712080.00405870.0637077 . Test: S20_r0.000004130.002032520.00000000.0000000 . . Test: SLJ0.001130030.033615950.00112720.0335732 . . . Test: BMT0.000000000.000000000.00000000.0000000 . . .Residual 0.268739240.518400650.29754650.5454782
    @@ -6519,8 +6515,8 @@

    - - + + @@ -6531,9 +6527,9 @@

    - - - + + + @@ -6543,10 +6539,10 @@

    - - - - + + + + @@ -6555,11 +6551,11 @@

    - - - - - + + + + + @@ -6567,20 +6563,20 @@

    - - + + - - + + - - + + @@ -6591,8 +6587,8 @@

    - - + + @@ -6603,8 +6599,8 @@

    - - + + @@ -6615,8 +6611,8 @@

    - - + + @@ -6627,8 +6623,8 @@

    - - + + @@ -6639,11 +6635,11 @@

    - - + + - + @@ -6651,10 +6647,10 @@

    - - + + - + @@ -6663,8 +6659,8 @@

    - - + + @@ -6675,8 +6671,8 @@

    - - + + @@ -6687,8 +6683,8 @@

    - - + + @@ -6699,8 +6695,8 @@

    - - + + @@ -6723,8 +6719,8 @@

    - - + + @@ -6737,45 +6733,45 @@

    -
    m1.σs      # VCs; m1.sigmas
    +
    m1.σs      # VCs; m1.sigmas
    -
    (Child = (var"(Intercept)" = 0.5899300186248844, var"Test: Star_r" = 0.7639612133604953, var"Test: S20_r" = 0.658219681909202, var"Test: SLJ" = 0.5700227005978211, var"Test: BMT" = 0.7425340800812925), School = (var"(Intercept)" = 0.2137559056537366, var"Test: Star_r" = 0.3329780987761621, var"Test: S20_r" = 0.32803884473380984, var"Test: SLJ" = 0.32097526864411674, var"Test: BMT" = 0.3128206391932548, a1 = 0.28264632412497126, var"Sex: Girls" = 0.1438204597464808), Cohort = (var"(Intercept)" = 0.01314995621094276, var"Test: Star_r" = 0.06371208452229353, var"Test: S20_r" = 0.0020325210658427655, var"Test: SLJ" = 0.033615946290033144, var"Test: BMT" = 0.0))
    +
    (Child = (var"(Intercept)" = 0.5850605295025836, var"Test: Star_r" = 0.7253188065638198, var"Test: S20_r" = 0.6128717020395804, var"Test: SLJ" = 0.5169937634418259, var"Test: BMT" = 0.7026080781925507), School = (var"(Intercept)" = 0.21372500397332667, var"Test: Star_r" = 0.3328662239048804, var"Test: S20_r" = 0.3280303277926459, var"Test: SLJ" = 0.3212016485032966, var"Test: BMT" = 0.312944787528044, a1 = 0.28222848702543474, var"Sex: Girls" = 0.14374708257478697), Cohort = (var"(Intercept)" = 0.01327721959958815, var"Test: Star_r" = 0.06370771186220402, var"Test: S20_r" = 0.0, var"Test: SLJ" = 0.0335731510538704, var"Test: BMT" = 0.0))
    -
    m1.θ       # Parameter vector for RES (w/o residual); m1.theta
    +
    m1.θ       # Parameter vector for RES (w/o residual); m1.theta
    48-element Vector{Float64}:
    -  1.1379808578187787
    -  0.20482472350757436
    -  0.0007568290993343182
    -  0.05015862559035548
    - -0.4783254792649123
    -  1.4593852782675234
    - -0.6667351473232765
    - -0.048914305923583076
    -  0.25189121887326976
    -  1.080570675334367
    - -0.5035583662207958
    - -0.13405062065481124
    -  0.9749848348297896
    +  1.0725644087519248
    +  0.19603180335365766
    +  0.0006989707030939914
    +  0.048333431339522906
    + -0.45839575693772194
    +  1.3151639159086943
    + -0.5946817820228019
    + -0.049231396991185894
    +  0.25348341383697526
    +  0.9532660805560547
    + -0.4133954465348457
    + -0.13824892384562082
    +  0.8500780627596318
       ⋮
    - -0.025980202240427883
    -  0.3845066623098876
    -  0.11840626932751377
    - -0.17005358340233095
    -  0.012474158221657745
    - -0.004267430792190249
    -  0.0013652913404655612
    -  0.025366395973694892
    -  0.12290124304422674
    -  0.003920753297880955
    -  0.06484549385144353
    + -0.024015280472054038
    +  0.3645599408853215
    +  0.1112553236698039
    + -0.16186296476512113
    +  0.0
    +  4.864135018349436e-5
    +  0.0
    +  0.02434051259928456
    +  0.1167924015734189
    +  0.0
    +  0.06154810501513169
       0.0
    -
    BlockDescription(m1) #  Description of blocks of A and L in a LinearMixedModel
    +
    BlockDescription(m1) #  Description of blocks of A and L in a LinearMixedModel

    Child Test: Run0.56444460.75129530.57222760.7564573 Test: Star_r0.63726780.7982906+0.500.64505730.8031546+0.49 Test: S20_r0.59125390.7689304+0.56+0.640.59904570.7739804+0.55+0.63 Test: SLJ0.61113770.7817530+0.55+0.60+0.720.61892500.7867179+0.54+0.59+0.71 Test: BMT0.48761200.69829220.49543570.7038720 +0.19 +0.40+0.37+0.49+0.36+0.48
    School Test: Run0.13695340.37007210.13705810.3702136 Test: Star_r0.09627060.31027500.09630820.3103357 +0.53 Test: S20_r0.10917820.33042120.10925460.3305368 +0.47 +0.48 Test: SLJ0.06132050.24762970.06140480.2478000 +0.47 +0.76 +0.41 Test: BMT0.03870120.19672630.03876340.1968842 +0.15 +0.38 +0.18 a10.08018960.28317760.08033420.2834328 +0.58 +0.47+0.56+0.55 -0.05 +0.65 Sex: Girls0.02057580.14344270.02052610.1432692 -0.63-0.26-0.27 +0.06 -0.28 -0.58Cohort Test: Run0.00300510.05481890.00300580.0548248 Test: Star_r0.00043420.02083860.00043520.0208614 . Test: S20_r0.00317410.05633930.00317000.0563024 . . Test: SLJ0.00024680.01571110.00024620.0156897 . . .Residual 0.26015830.51005710.25231320.5023079
    @@ -6821,39 +6817,39 @@

    -
    m2.θ
    +
    m2.θ
    48-element Vector{Float64}:
    -  1.4729630067266388
    -  0.7839590288563076
    -  0.8442929134851123
    -  0.8452773250238744
    -  0.2646810066793581
    -  1.354602147671133
    -  0.6180607446857718
    -  0.5707171082255509
    -  0.4816688045536064
    -  1.0852834447526913
    -  0.547179574617927
    -  0.21671488326108312
    -  1.0047299268364405
    +  1.5059633241479313
    +  0.7905595422264238
    +  0.8513448636718977
    +  0.8523314504015871
    +  0.2669578812727323
    +  1.3898162197833863
    +  0.6278115977313309
    +  0.5801729564758269
    +  0.4859928477625174
    +  1.1203923373435258
    +  0.5549188422789274
    +  0.22081924327455182
    +  1.0401914264607808
       ⋮
    - -0.01805876323213624
    -  0.31935406501511093
    -  0.14056642217397697
    - -0.18722520941287563
    -  0.0019409804824588209
    - -0.000854702979588228
    + -0.017697745938997193
    +  0.3245991574690091
    +  0.13984259294964374
    + -0.1895823320774014
    +  0.0
    +  0.00012735254024911713
       0.0
    -  0.1074759722955535
    -  0.0408553982374923
    -  0.11045685078823214
    -  0.03080253323285869
    +  0.10914584187734602
    +  0.041531173878651656
    +  0.11208744802603994
    +  0.031235131302801183
       0.0
    -
    BlockDescription(m2)
    +
    BlockDescription(m2)

    @@ -6902,28 +6898,28 @@

    6.4 Model “predictions”

    These commands inform us about extracion of conditional modes/means and (co-)variances, that using the model parameters to improve the predictions for units (levels) of the grouping (random) factors. We need this information, e.g., for partial-effect response profiles (e.g., facet plot) or effect profiles (e.g., caterpillar plot), or visualizing the borrowing-strength effect for correlation parameters (e.g., shrinkage plots). We are using the fit of LMM m2.

    -
    julia> condVar(m2)
    +
    julia> condVar(m2)

    Some plotting functions are currently available from the MixedModelsMakie package or via custom functions.

    -
    + julia> caterpillar!(m2)
    -+ julia> shrinkage!(m2)
    +
    + julia> caterpillar!(m2)
    ++ julia> shrinkage!(m2)

    6.4.1 Conditional covariances

    -
    condVar(m1)
    +
    condVar(m1)
    3-element Vector{Array{Float64, 3}}:
    - [0.05646046092775441 0.008741087080492059 … 0.0031541310120115004 -0.021366492030079107; 0.008741087080492059 0.2898070743228609 … -0.007395273870692747 0.02373863963471936; … ; 0.0031541310120115004 -0.007395273870692747 … 0.20511454245689775 -0.08320864426004519; -0.021366492030079107 0.02373863963471936 … -0.08320864426004519 0.2621984696751095;;; 0.06282981191597331 0.010873340067507205 … 0.003911304320141656 -0.028546511341588685; 0.010873340067507205 0.29888738083442257 … -0.005906595669994303 0.024370676194331312; … ; 0.003911304320141656 -0.005906595669994303 … 0.20895499475382556 -0.08406553259629664; -0.028546511341588685 0.024370676194331312 … -0.08406553259629664 0.27184758398121617;;; 0.05998897485888433 0.01007026807161604 … 0.0032319545291463526 -0.025312045521883212; 0.01007026807161604 0.2940394670641541 … -0.006817553888102131 0.023795082138195707; … ; 0.0032319545291463526 -0.006817553888102131 … 0.2078092502139327 -0.08344591293042244; -0.025312045521883212 0.023795082138195707 … -0.08344591293042244 0.26738308073259914;;; … ;;; 0.0911642999173916 0.01076609564325965 … -0.005637609554982028 -0.023662455633272725; 0.01076609564325965 0.29665063424015253 … -0.007332917065768334 0.025074183712715036; … ; -0.005637609554982028 -0.007332917065768334 … 0.20700327578177205 -0.08137850941302857; -0.023662455633272725 0.025074183712715036 … -0.08137850941302857 0.2673185912381177;;; 0.09758767655129515 0.008244537154902042 … -0.0010354836383137042 -0.022662590984633135; 0.008244537154902042 0.29316657183773565 … -0.007558444051222894 0.02545529557164294; … ; -0.0010354836383137042 -0.007558444051222894 … 0.20636024095767308 -0.08204002021725448; -0.022662590984633135 0.02545529557164294 … -0.08204002021725448 0.2643140589320666;;; 0.08427902904823857 0.008137131089769597 … -5.448343803071856e-5 -0.01908570180944885; 0.008137131089769597 0.2903404218730588 … -0.0077630785771130115 0.024937151640092022; … ; -5.448343803071856e-5 -0.0077630785771130115 … 0.20514228601518525 -0.08223816422128372; -0.01908570180944885 0.024937151640092022 … -0.08223816422128372 0.2613879265256324]
    - [0.037382661325217725 -0.0018051470792949033 … 0.029940911136657724 -0.01244345223719613; -0.0018051470792949033 0.09051215264208363 … -0.012244610563499873 0.017439875521624456; … ; 0.029940911136657724 -0.012244610563499873 … 0.06558800966167774 -0.012746513247199394; -0.01244345223719613 0.017439875521624456 … -0.012746513247199394 0.018352311028304123;;; 0.03217464671591924 0.00019909974801327407 … 0.02627029742637268 -0.010660132285994132; 0.00019909974801327407 0.07639620696704796 … -0.007615472878529819 0.014245884411538212; … ; 0.02627029742637268 -0.007615472878529819 … 0.057429424799467686 -0.010752601438413252; -0.010660132285994132 0.014245884411538212 … -0.010752601438413252 0.015916025259580583;;; 0.02931773029899377 -0.00318202484369497 … 0.021529371207791897 -0.010468735783714597; -0.00318202484369497 0.0877854372242869 … -0.013135551350890045 0.018155944442391866; … ; 0.021529371207791897 -0.013135551350890045 … 0.05185205623812096 -0.01035444832586628; -0.010468735783714597 0.018155944442391866 … -0.01035444832586628 0.016797747820827533;;; … ;;; 0.026752946917134604 0.0028930880769873213 … 0.01903100884665739 -0.006858818931875681; 0.0028930880769873213 0.07613947167907514 … -0.005487860383599791 0.012942351267027008; … ; 0.01903100884665739 -0.005487860383599791 … 0.05093403107631236 -0.006102052856935498; -0.006858818931875681 0.012942351267027008 … -0.006102052856935498 0.013722354630431572;;; 0.027218597898895663 0.0035105914941084113 … 0.02031450027310185 -0.006162818466481287; 0.0035105914941084113 0.07605736439573893 … -0.004958713622938641 0.012639471135981264; … ; 0.02031450027310185 -0.004958713622938641 … 0.05307335906565115 -0.006292276029352733; -0.006162818466481287 0.012639471135981264 … -0.006292276029352733 0.013744887928746738;;; 0.043329326310117225 -0.003077486069647413 … 0.03639152682395296 -0.013665784308341528; -0.003077486069647413 0.09944879336028199 … -0.014990671654062395 0.01920040229893295; … ; 0.03639152682395296 -0.014990671654062395 … 0.07512799464195363 -0.014346672368784442; -0.013665784308341528 0.01920040229893295 … -0.014346672368784442 0.019529046292703082]
    - [0.0001624893302946822 6.809276760802604e-6 … -4.6917226461083115e-6 0.0; 6.809276760802604e-6 0.002350815403225895 … -0.00015352131411632052 0.0; … ; -4.6917226461083115e-6 -0.00015352131411632052 … 0.000851482182428563 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015913802081720684 8.636268905937163e-6 … -5.971228600979366e-6 0.0; 8.636268905937163e-6 0.0020370776713334775 … -0.00016803507630411106 0.0; … ; -5.971228600979366e-6 -0.00016803507630411106 … 0.0007841967975071386 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016107332729719428 7.517372519491449e-6 … -5.10400306824662e-6 0.0; 7.517372519491449e-6 0.0022348773520284035 … -0.00015922539038549057 0.0; … ; -5.10400306824662e-6 -0.00015922539038549057 … 0.0008237973652566612 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016046986147184554 8.294439488860557e-6 … -5.42301575559805e-6 0.0; 8.294439488860557e-6 0.0021568108017217787 … -0.0001637977537184879 0.0; … ; -5.42301575559805e-6 -0.0001637977537184879 … 0.0008119432272028718 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001580856198253438 8.548764514673167e-6 … -6.842906693187147e-6 0.0; 8.548764514673167e-6 0.0019544407667465287 … -0.00016998440973049989 0.0; … ; -6.842906693187147e-6 -0.00016998440973049989 … 0.000763281290146378 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015732346828528415 7.309910180796245e-6 … -7.278918997664716e-6 0.0; 7.309910180796245e-6 0.0019259339350955339 … -0.00016887030366421503 0.0; … ; -7.278918997664716e-6 -0.00016887030366421503 … 0.0007463694625123178 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001593872289661442 7.892011292068771e-6 … -6.353962391643299e-6 0.0; 7.892011292068771e-6 0.002069851138743824 … -0.00016756307945140484 0.0; … ; -6.353962391643299e-6 -0.00016756307945140484 … 0.0007884351701505988 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015708408471662314 8.323399337044809e-6 … -7.845522431501192e-6 0.0; 8.323399337044809e-6 0.0018808801004042105 … -0.00017392113057051914 0.0; … ; -7.845522431501192e-6 -0.00017392113057051914 … 0.0007429208051915409 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015529524243854123 9.604794249145802e-6 … -7.639791823552067e-6 0.0; 9.604794249145802e-6 0.0017804671632761467 … -0.0001735958331640202 0.0; … ; -7.639791823552067e-6 -0.0001735958331640202 … 0.0007169963867619168 0.0; 0.0 0.0 … 0.0 0.0]
    + [0.06019418742504718 0.009503796745062064 … 0.0033834400385739888 -0.022668479351173654; 0.009503796745062064 0.2854005880473556 … -0.00958507730779486 0.028716656437979788; … ; 0.0033834400385739888 -0.00958507730779486 … 0.1844727328000474 -0.06916979669328152; -0.022668479351173654 0.028716656437979788 … -0.06916979669328152 0.25191061541703247;;; 0.06638934288350756 0.011426004515357342 … 0.003909463104620026 -0.0292119474420615; 0.011426004515357342 0.2928687317350804 … -0.008478311285984651 0.02941370590727316; … ; 0.003909463104620026 -0.008478311285984651 … 0.18703004403763182 -0.06952986363931428; -0.0292119474420615 0.02941370590727316 … -0.06952986363931428 0.26021572018283845;;; 0.06362867054593162 0.010699346006361469 … 0.0033964643426404985 -0.026279729153108257; 0.010699346006361469 0.28888125998326925 … -0.009167782850568209 0.028821548015862015; … ; 0.0033964643426404985 -0.009167782850568209 … 0.18628102304197858 -0.06916102296546002; -0.026279729153108257 0.028821548015862015 … -0.06916102296546002 0.2563896296894346;;; … ;;; 0.09363460112990261 0.012046797405318213 … -0.0032862574042418287 -0.02711142050203791; 0.012046797405318213 0.291073687094071 … -0.009685893528276247 0.029842612487591166; … ; -0.0032862574042418287 -0.009685893528276247 … 0.18550883582901173 -0.06729639981737609; -0.02711142050203791 0.029842612487591166 … -0.06729639981737609 0.256671190831006;;; 0.09976557687633258 0.010016082191638962 … 0.0006243976195820504 -0.026342260007078178; 0.010016082191638962 0.2881525540785056 … -0.009777322410713288 0.030136684275133368; … ; 0.0006243976195820504 -0.009777322410713288 … 0.18521298293304764 -0.06807597904121555; -0.026342260007078178 0.030136684275133368 … -0.06807597904121555 0.25412967605580083;;; 0.08693320547738166 0.009664117531498923 … 0.0012964873388475982 -0.022429713649827168; 0.009664117531498923 0.2858445857972337 … -0.009905239241814905 0.029695883522352712; … ; 0.0012964873388475982 -0.009905239241814905 … 0.18441693027690204 -0.06832602885070671; -0.022429713649827168 0.029695883522352712 … -0.06832602885070671 0.25135725618394045] + [0.037365395950585974 -0.0017655779498263638 … 0.029992640730425405 -0.012406566176960596; -0.0017655779498263638 0.09045228551960292 … -0.012385246199939885 0.017386570410622106; … ; 0.029992640730425405 -0.012385246199939885 … 0.06535317542823817 -0.01276748746573651; -0.012406566176960596 0.017386570410622106 … -0.01276748746573651 0.018334154141751987;;; 0.03216249095122564 0.00022696322483036835 … 0.02630529454531921 -0.010631439799091614; 0.00022696322483036835 0.07634951401975061 … -0.0077355031375509736 0.01420287914883203; … ; 0.02630529454531921 -0.0077355031375509736 … 0.05720044917460387 -0.010766382709518987; -0.010631439799091614 0.01420287914883203 … -0.010766382709518987 0.01590307809857184;;; 0.02929681307843224 -0.0031408663505337925 … 0.02158258776750699 -0.010436205316876505; -0.0031408663505337925 0.08773510997203417 … -0.013259706737215242 0.01810475478038694; … ; 0.02158258776750699 -0.013259706737215242 … 0.051655516941355686 -0.010379390251669994; -0.010436205316876505 0.01810475478038694 … -0.010379390251669994 0.016781780508046636;;; … ;;; 0.026745929701339315 0.002917641659474549 … 0.019080622096953756 -0.006834727156841562; 0.002917641659474549 0.07609969337059758 … -0.005614009097038336 0.012904348828268273; … ; 0.019080622096953756 -0.005614009097038336 … 0.050698905689706475 -0.006126528590023523; -0.006834727156841562 0.012904348828268273 … -0.006126528590023523 0.013714527286069556;;; 0.027216188929041405 0.003530944546766289 … 0.020359086613926557 -0.006139450095676234; 0.003530944546766289 0.07601961064990106 … -0.005083424404002116 0.012605131223533494; … ; 0.020359086613926557 -0.005083424404002116 … 0.0528330485244931 -0.006308308944350414; -0.006139450095676234 0.012605131223533494 … -0.006308308944350414 0.013739395068611007;;; 0.04331653082166873 -0.0030379453893194797 … 0.036447674453436926 -0.013624830406168449; -0.0030379453893194797 0.09937883559028705 … -0.015148527887408843 0.019142855162286802; … ; 0.036447674453436926 -0.015148527887408843 … 0.07489666357201216 -0.014366751200894581; -0.013624830406168449 0.019142855162286802 … -0.014366751200894581 0.01950850481597297] + [0.00016545568505701335 6.921929999981573e-6 … -4.769170817387602e-6 0.0; 6.921929999981573e-6 0.002350279752955536 … -0.00015337284868442632 0.0; … ; -4.769170817387602e-6 -0.00015337284868442632 … 0.0008497610242309145 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001619822900577131 8.776171492319528e-6 … -6.069472752000027e-6 0.0; 8.776171492319528e-6 0.002036458052140791 … -0.0001679553344232745 0.0; … ; -6.069472752000027e-6 -0.0001679553344232745 … 0.0007826808244322982 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016398774773102024 7.640545323880597e-6 … -5.188084036842045e-6 0.0; 7.640545323880597e-6 0.002234310283157169 … -0.00015910218072598674 0.0; … ; -5.188084036842045e-6 -0.00015910218072598674 … 0.0008221654797834798 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001633625475861464 8.429206258047161e-6 … -5.511715091305747e-6 0.0; 8.429206258047161e-6 0.0021562253114837133 … -0.00016368660493861682 0.0; … ; -5.511715091305747e-6 -0.00016368660493861682 … 0.000810348287230687 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016089264981359867 8.680226109278226e-6 … -6.954004136733749e-6 0.0; 8.680226109278226e-6 0.001953795166646088 … -0.0001699333399437687 0.0; … ; -6.954004136733749e-6 -0.0001699333399437687 … 0.0007618309710747372 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016010322463798926 7.419377161513542e-6 … -7.397987220434422e-6 0.0; 7.419377161513542e-6 0.0019252827742582445 … -0.00016884046751908626 0.0; … ; -7.397987220434422e-6 -0.00016884046751908626 … 0.000744959564694986 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001622410767889185 8.01528410963981e-6 … -6.456679120351298e-6 0.0; 8.01528410963981e-6 0.0020692515929081647 … -0.0001674800149112973 0.0; … ; -6.456679120351298e-6 -0.0001674800149112973 … 0.0007869107690595535 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015985536145516973 8.448304257568326e-6 … -7.972844532979829e-6 0.0; 8.448304257568326e-6 0.0018802113797502158 … -0.00017389522990241473 0.0; … ; -7.972844532979829e-6 -0.00017389522990241473 … 0.0007415238377492921 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015800318743016144 9.75269804326113e-6 … -7.763058933586718e-6 0.0; 9.75269804326113e-6 0.0017797801831911692 … -0.00017360878834771101 0.0; … ; -7.763058933586718e-6 -0.00017360878834771101 … 0.0007156601770628602 0.0; 0.0 0.0 … 0.0 0.0]
    -
    condVar(m2)
    +
    condVar(m2)
    3-element Vector{Array{Float64, 3}}:
    - [0.17090827908394837 0.027262026576516135 … 0.03380346024298022 -0.00725898477697015; 0.027262026576516135 0.17362860841886468 … 0.03725760536477991 0.018606919834712306; … ; 0.03380346024298022 0.03725760536477991 … 0.16027831963262387 0.028396673886695065; -0.00725898477697015 0.018606919834712306 … 0.028396673886695065 0.16044266373295085;;; 0.18217266813532992 0.03403215638194173 … 0.04110909046910593 -0.009203498970715065; 0.03403215638194173 0.1854807112555363 … 0.0484535420768501 0.021145389994612112; … ; 0.04110909046910593 0.0484535420768501 … 0.17270612527308093 0.03080503422943898; -0.009203498970715065 0.021145389994612112 … 0.03080503422943898 0.1628999798226587;;; 0.17598207538028804 0.030839707406116214 … 0.037829209453142054 -0.008027447928738635; 0.030839707406116214 0.18017131892730673 … 0.04329994145914574 0.019886266952541386; … ; 0.037829209453142054 0.04329994145914574 … 0.16700723694482034 0.029647017101376034; -0.008027447928738635 0.019886266952541386 … 0.029647017101376034 0.16162269221670272;;; … ;;; 0.2173727394927963 0.07077417442793549 … 0.0671331561164205 0.021622197935503698; 0.07077417442793549 0.22137583323754262 … 0.07253677420131632 0.05084345335238386; … ; 0.0671331561164205 0.07253677420131632 … 0.18357724232380448 0.05024789366648706; 0.021622197935503698 0.05084345335238386 … 0.05024789366648706 0.18615473888535655;;; 0.22427545347433642 0.07760416492591914 … 0.0766739573301095 0.03241003430210565; 0.07760416492591914 0.22447630154317874 … 0.07866285848857124 0.05862485650015413; … ; 0.0766739573301095 0.07866285848857124 … 0.19229940149864155 0.06063971394271496; 0.03241003430210565 0.05862485650015413 … 0.06063971394271496 0.1950709514513498;;; 0.20604841432017237 0.06133280233274787 … 0.06198644244541778 0.02228070633700272; 0.06133280233274787 0.2071819423793147 … 0.0637708267715584 0.04774655852993967; … ; 0.06198644244541778 0.0637708267715584 … 0.1791596515000308 0.051377608691885325; 0.02228070633700272 0.04774655852993967 … 0.051377608691885325 0.18669597320366366]
    - [0.10762625120838518 0.04838303958232419 … 0.0477193367718641 -0.027746475219333506; 0.04838303958232419 0.07948773455156048 … 0.0348982189813234 -0.010275451351059854; … ; 0.0477193367718641 0.0348982189813234 … 0.06571253141716403 -0.012819964751108165; -0.027746475219333506 -0.010275451351059854 … -0.012819964751108165 0.018249001379576288;;; 0.08786705405494342 0.04038394833689375 … 0.04010641390582609 -0.02268094493330316; 0.04038394833689375 0.0691386963788005 … 0.03203056278906753 -0.00839840230704004; … ; 0.04010641390582609 0.03203056278906753 … 0.057460951832629205 -0.010821249376082568; -0.02268094493330316 -0.00839840230704004 … -0.010821249376082568 0.015830523970505453;;; 0.09631029751643853 0.03587539258354575 … 0.03838831009690908 -0.025396292957756198; 0.03587539258354575 0.06308408495911258 … 0.024737958411540202 -0.007211734104591098; … ; 0.03838831009690908 0.024737958411540202 … 0.05195118580798586 -0.010453523302885338; -0.025396292957756198 -0.007211734104591098 … -0.010453523302885338 0.01671012877070668;;; … ;;; 0.07438147990531531 0.0305305111571838 … 0.029412174280976297 -0.017012235372204258; 0.0305305111571838 0.06268187406983632 … 0.023453579910918183 -0.00403058941307241; … ; 0.029412174280976297 0.023453579910918183 … 0.05096069628401587 -0.00618427832636701; -0.017012235372204258 -0.00403058941307241 … -0.00618427832636701 0.013655181344400849;;; 0.07353882538543838 0.030541819753753648 … 0.030140659927341572 -0.016051860394370857; 0.030541819753753648 0.06347376869476529 … 0.024725729033149037 -0.0033653120951671655; … ; 0.030140659927341572 0.024725729033149037 … 0.053085730286024674 -0.006368644184479695; -0.016051860394370857 -0.0033653120951671655 … -0.006368644184479695 0.013679938216201639;;; 0.12465965193831827 0.0579439268525617 … 0.0576096293475985 -0.030973421607732164; 0.0579439268525617 0.09049603789220044 … 0.04197587901957836 -0.01174320550801033; … ; 0.0576096293475985 0.04197587901957836 … 0.07532213698238206 -0.01442195543124506; -0.030973421607732164 -0.01174320550801033 … -0.01442195543124506 0.019422773635780873]
    - [0.0018733240498050652 3.096151407390133e-5 … 2.2244806033743188e-5 0.0; 3.096151407390133e-5 0.0003979172766731916 … 5.69132236754644e-6 0.0; … ; 2.2244806033743188e-5 5.69132236754644e-6 … 0.00023306275288016156 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0016446428664714044 3.72910599876562e-5 … 2.723027443151125e-5 0.0; 3.72910599876562e-5 0.00038664282322931987 … 7.791883693382405e-6 0.0; … ; 2.723027443151125e-5 7.791883693382405e-6 … 0.00022861952824465714 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0017877970891102882 3.243158361859379e-5 … 2.4229209032921504e-5 0.0; 3.243158361859379e-5 0.00039383229376694387 … 6.503673530124919e-6 0.0; … ; 2.4229209032921504e-5 6.503673530124919e-6 … 0.000231255131594314 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0017309507895529432 3.4360740268888014e-5 … 2.5245564123808525e-5 0.0; 3.4360740268888014e-5 0.000391740323920398 … 6.72051620707648e-6 0.0; … ; 2.5245564123808525e-5 6.72051620707648e-6 … 0.00023059331670321413 0.0; 0.0 0.0 … 0.0 0.0;;; 0.001586490132064953 3.888041156707243e-5 … 2.8017507733504467e-5 0.0; 3.888041156707243e-5 0.00038357584814544546 … 8.147743352690285e-6 0.0; … ; 2.8017507733504467e-5 8.147743352690285e-6 … 0.00022719515986812782 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015684894428273305 4.000129888505287e-5 … 2.8685004036434755e-5 0.0; 4.000129888505287e-5 0.00038013479938511346 … 8.963434176674353e-6 0.0; … ; 2.8685004036434755e-5 8.963434176674353e-6 … 0.00022596457956954328 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0016701131270366056 3.692631322356877e-5 … 2.624349422033717e-5 0.0; 3.692631322356877e-5 0.00038705399687490586 … 7.544287495385443e-6 0.0; … ; 2.624349422033717e-5 7.544287495385443e-6 … 0.00022886710469376584 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015333233660692336 4.0894638884906606e-5 … 2.924110404372773e-5 0.0; 4.0894638884906606e-5 0.00037999301464735014 … 8.864917680249245e-6 0.0; … ; 2.924110404372773e-5 8.864917680249245e-6 … 0.00022568435707695788 0.0; 0.0 0.0 … 0.0 0.0;;; 0.001453393379725358 4.285087133359302e-5 … 3.085019200677401e-5 0.0; 4.285087133359302e-5 0.0003739504094135209 … 1.0040622295976805e-5 0.0; … ; 3.085019200677401e-5 1.0040622295976805e-5 … 0.00022374726281913847 0.0; 0.0 0.0 … 0.0 0.0]
    + [0.16966695569915408 0.02617127694248172 … 0.03258884081091673 -0.007206240570521886; 0.02617127694248172 0.17240843577597612 … 0.036311607303949625 0.017685521894305247; … ; 0.03258884081091673 0.036311607303949625 … 0.16016849406450073 0.02700910382414811; -0.007206240570521886 0.017685521894305247 … 0.02700910382414811 0.15894754823050586;;; 0.18123324821101372 0.032970827180563524 … 0.03995868284073482 -0.009308813398023906; 0.032970827180563524 0.18449651868025052 … 0.047727398942295 0.020196526455978036; … ; 0.03995868284073482 0.047727398942295 … 0.1729130206146902 0.029390651597285412; -0.009308813398023906 0.020196526455978036 … 0.029390651597285412 0.16144344560817153;;; 0.17484149294160142 0.029746321294318603 … 0.03664654756610398 -0.0080538238837542; 0.029746321294318603 0.17906868394590209 … 0.0424605957917473 0.018944085956201298; … ; 0.03664654756610398 0.0424605957917473 … 0.16706614260704472 0.028246498043986833; -0.0080538238837542 0.018944085956201298 … 0.028246498043986833 0.16014814619477102;;; … ;;; 0.21713559937899732 0.0703232791298282 … 0.06595205177634571 0.02224836937658333; 0.0703232791298282 0.2207965785568308 … 0.0715649873399086 0.05045668458090867; … ; 0.06595205177634571 0.0715649873399086 … 0.18284532391986422 0.04876533846002718; 0.02224836937658333 0.05045668458090867 … 0.04876533846002718 0.18528720926682385;;; 0.22412902553385222 0.07722305653468363 … 0.07564573705535872 0.03327435300237856; 0.07722305653468363 0.2237846566159937 … 0.07765990648329005 0.058316403691267296; … ; 0.07564573705535872 0.07765990648329005 … 0.1915742870715255 0.05932034418821193; 0.03327435300237856 0.058316403691267296 … 0.05932034418821193 0.19437286232267642;;; 0.205527415636691 0.0607498585349418 … 0.06085868964925743 0.022971189688065028; 0.0607498585349418 0.2063016197365087 … 0.06271247545596066 0.047296418415569835; … ; 0.06085868964925743 0.06271247545596066 … 0.17846777170600717 0.05001559243541315; 0.022971189688065028 0.047296418415569835 … 0.05001559243541315 0.18581538540889578] + [0.10769418687358297 0.0484138260546604 … 0.04763895560577541 -0.027759205229890213; 0.0484138260546604 0.07951701580471926 … 0.03495321490061306 -0.010311510372108108; … ; 0.04763895560577541 0.03495321490061306 … 0.0658350520969288 -0.01270562792721933; -0.027759205229890213 -0.010311510372108108 … -0.01270562792721933 0.018196540862379026;;; 0.0879084826520309 0.040403913310339656 … 0.040037182565219126 -0.022685563208058285; 0.040403913310339656 0.06916204870896962 … 0.03208450922319941 -0.00842678401969979; … ; 0.040037182565219126 0.03208450922319941 … 0.057579486039892006 -0.01071278176888107; -0.022685563208058285 -0.00842678401969979 … -0.01071278176888107 0.015777046740511287;;; 0.09637213624194817 0.03589422543301574 … 0.03830636300698518 -0.02541382219547382; 0.03589422543301574 0.06309224943216125 … 0.02477485898489156 -0.007248744857239961; … ; 0.03830636300698518 0.02477485898489156 … 0.05206800643939926 -0.010345170531194063; -0.02541382219547382 -0.007248744857239961 … -0.010345170531194063 0.016662358117835684;;; … ;;; 0.07441613532861045 0.030534129302106215 … 0.029358413135702772 -0.017030746639950356; 0.030534129302106215 0.06268091131640748 … 0.023507104986285554 -0.004067681652846168; … ; 0.029358413135702772 0.023507104986285554 … 0.0511310861047336 -0.006095360848082819; -0.017030746639950356 -0.004067681652846168 … -0.006095360848082819 0.013610756027601966;;; 0.07356828397556059 0.030542855562619584 … 0.030098187775322967 -0.016068996673588593; 0.030542855562619584 0.06347189659643981 … 0.02478959264016431 -0.0034032300910587046; … ; 0.030098187775322967 0.02478959264016431 … 0.05324804720352666 -0.006283052897152759; -0.016068996673588593 -0.0034032300910587046 … -0.006283052897152759 0.013633449293620056;;; 0.1247463998878555 0.05798323363917551 … 0.05754108517606356 -0.030993072866660944; 0.05798323363917551 0.090536033106285 … 0.04204624951052498 -0.011783159908059896; … ; 0.05754108517606356 0.04204624951052498 … 0.07545231569635082 -0.01431516261615476; -0.030993072866660944 -0.011783159908059896 … -0.01431516261615476 0.01937291704557192] + [0.0018735729244332131 3.1021279739402785e-5 … 2.218901558704754e-5 0.0; 3.1021279739402785e-5 0.0003987145541487774 … 5.687922385049934e-6 0.0; … ; 2.218901558704754e-5 5.687922385049934e-6 … 0.00023246361130711195 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0016448374627962333 3.735940126370843e-5 … 2.7163163938007965e-5 0.0; 3.735940126370843e-5 0.0003873943943271986 … 7.787212545118072e-6 0.0; … ; 2.7163163938007965e-5 7.787212545118072e-6 … 0.00022804305561134738 0.0; 0.0 0.0 … 0.0 0.0;;; 0.001788023110969321 3.249144540015982e-5 … 2.4169663572572665e-5 0.0; 3.249144540015982e-5 0.0003946125070407935 … 6.4998245935627574e-6 0.0; … ; 2.4169663572572665e-5 6.4998245935627574e-6 … 0.00023066529735919788 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0017311576193917888 3.4425010639770386e-5 … 2.5182780729294603e-5 0.0; 3.4425010639770386e-5 0.00039251230085191426 … 6.716489112057239e-6 0.0; … ; 2.5182780729294603e-5 6.716489112057239e-6 … 0.00023000674697200486 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015866567728126586 3.895300927019573e-5 … 2.7947105583323014e-5 0.0; 3.895300927019573e-5 0.0003843160712136583 … 8.142851120432268e-6 0.0; … ; 2.7947105583323014e-5 8.142851120432268e-6 … 0.000226625569125888 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015686577971835273 4.007382105691694e-5 … 2.8613860602075923e-5 0.0; 4.007382105691694e-5 0.00038086108365777084 … 8.958114047331325e-6 0.0; … ; 2.8613860602075923e-5 8.958114047331325e-6 … 0.00022540117288928575 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0016703012710220753 3.6996751480078234e-5 … 2.6177223175802248e-5 0.0; 3.6996751480078234e-5 0.00038780797818598625 … 7.539703069962164e-6 0.0; … ; 2.6177223175802248e-5 7.539703069962164e-6 … 0.00022828921517269618 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015334797920780099 4.097063267119373e-5 … 2.916768169845572e-5 0.0; 4.097063267119373e-5 0.00038071951801350813 … 8.859649467653798e-6 0.0; … ; 2.916768169845572e-5 8.859649467653798e-6 … 0.00022512224213137852 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0014535411311816353 4.292579687983954e-5 … 3.077535310809958e-5 0.0; 4.292579687983954e-5 0.00037465233137207627 … 1.0034600769927935e-5 0.0; … ; 3.077535310809958e-5 1.0034600769927935e-5 … 0.00022319509436843918 0.0; 0.0 0.0 … 0.0 0.0]

    They are hard to look at. Let’s take pictures.

    @@ -6933,9 +6929,9 @@

    Code -
    caterpillar!(
    -  Figure(; resolution=(800, 400)), ranefinfo(m1, :Cohort)
    -)
    +
    caterpillar!(
    +  Figure(; resolution=(800, 400)), ranefinfo(m1, :Cohort)
    +)
    @@ -6953,7 +6949,7 @@

    Code -
    shrinkageplot!(Figure(; resolution=(800, 800)), m1, :Cohort)
    +
    shrinkageplot!(Figure(; resolution=(800, 800)), m1, :Cohort)
    @@ -6967,7 +6963,7 @@

    Code -
    shrinkageplot!(Figure(; resolution=(800, 800)), m2, :Cohort)
    +
    shrinkageplot!(Figure(; resolution=(800, 800)), m2, :Cohort)
    diff --git a/fggk21_files/figure-html/fig-caterpillarcohort-output-1.svg b/fggk21_files/figure-html/fig-caterpillarcohort-output-1.svg index 33bf523..0d0d3ad 100644 --- a/fggk21_files/figure-html/fig-caterpillarcohort-output-1.svg +++ b/fggk21_files/figure-html/fig-caterpillarcohort-output-1.svg @@ -2,348 +2,333 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - - - - - - - + - - - - - - - + - + - - - - - + + - + - + - - - - - + + - + - - + + + + + - + - - + + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - + - + - + - + - + - + - + + + + + + + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - - - + + + @@ -353,9 +338,9 @@ - - - + + + @@ -365,9 +350,11 @@ - - - + + + + + @@ -377,10 +364,10 @@ - - - - + + + + @@ -405,643 +392,637 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - + - - - - - - - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1079,9 +1060,9 @@ - - - + + + @@ -1091,16 +1072,18 @@ - - - - - - - - - - + + + + + + + + + + + + diff --git a/fggk21_files/figure-html/fig-m1shrinkagecohort-output-1.svg b/fggk21_files/figure-html/fig-m1shrinkagecohort-output-1.svg index a2e7cfe..35c7378 100644 --- a/fggk21_files/figure-html/fig-m1shrinkagecohort-output-1.svg +++ b/fggk21_files/figure-html/fig-m1shrinkagecohort-output-1.svg @@ -2,435 +2,444 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - - + + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - + + - - + + - - + + - - + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - - - - - + - + + + + - - + + - + - + - + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - - + + - - + + - - + + - + - + - + + + + + + + + + + - + - + - + - - + + - - + + - + - + - + - + - - - - + @@ -442,254 +451,254 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -700,33 +709,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -736,89 +745,89 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -829,33 +838,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -865,33 +874,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -901,188 +910,188 @@ - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1093,98 +1102,98 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1195,107 +1204,107 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1306,89 +1315,89 @@ - + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1399,61 +1408,61 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/fggk21_files/figure-html/fig-m2shrinkagecohort-output-1.svg b/fggk21_files/figure-html/fig-m2shrinkagecohort-output-1.svg index 9544067..43cedfb 100644 --- a/fggk21_files/figure-html/fig-m2shrinkagecohort-output-1.svg +++ b/fggk21_files/figure-html/fig-m2shrinkagecohort-output-1.svg @@ -2,519 +2,555 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - - + + - + - + - - - - + - + - + - + - + - + - + - + - + - + + + + - + - + + + + - + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + - + - - + + + + + + + + - + - + - + - + - - + + + + + - + + + + - - + + - + - + - - + + - - + + - - + + - - + + + + + - + - - + + + + + - + + + + - + - + + + + - + - + - + + + + + + + + + + - + - + - + + + + - - + + - - + + - - + + - - + + + + + - + - - + + - - + + - - + + - + - - + + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + + + + + + + - + - + - + - + - + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - - - - - - - + - + - - + + - + - + - + - + - - - - + - + - - - - + - - + + - + - + - - - - - - - - - - - - - - + + - + - - - - - - - + - - - - + - + - - - - + @@ -537,140 +573,140 @@ - + - - + + - - + + - + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -679,271 +715,271 @@ - + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -954,33 +990,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -990,230 +1026,230 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1224,98 +1260,98 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1326,233 +1362,233 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1563,64 +1599,64 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + + + + + - - - - - - + + + + + + - - + + - - - - - - + + + + + + diff --git a/glmm.html b/glmm.html index d54989e..958297d 100644 --- a/glmm.html +++ b/glmm.html @@ -366,7 +366,7 @@

    Generalized linear mixed models

    Load the packages to be used

    -
    +
    Code
    using AlgebraOfGraphics
    @@ -390,7 +390,7 @@ 

    Generalized linear mixed models

    1 Matrix notation for the sleepstudy model

    -
    +
    sleepstudy = DataFrame(dataset(:sleepstudy))
    180×3 DataFrame
    155 rows omitted
    @@ -571,7 +571,7 @@

    +
    contrasts = Dict(:subj => Grouping())
     m1 = let f = @formula reaction ~ 1 + days + (1 + days | subj)
       fit(MixedModel, f, sleepstudy; contrasts)
    @@ -585,7 +585,7 @@ 

    +
    m1.y
    180-element view(::Matrix{Float64}, :, 3) with eltype Float64:
    @@ -632,15 +632,15 @@ 

    +
    m1.β
    2-element Vector{Float64}:
    - 251.40510484848417
    -  10.467285959595896
    + 251.4051048484848 + 10.467285959595449

    -
    +
    m1.X
    180×2 Matrix{Float64}:
    @@ -674,14 +674,14 @@ 

    +
    m1.b
    1-element Vector{Matrix{Float64}}:
    - [2.815818033394916 -40.04844099287436 … 0.7232621645096935 12.118907745826883; 9.075511916305423 -8.644079548078082 … -0.9710526581529085 1.3106980682714398]
    + [2.8158188723726987 -40.04844155099845 … 0.7232620681342852 12.118907791462991; 9.07551177315976 -8.64407948654385 … -0.9710526407852382 1.3106980710461535]

    -
    +
    only(m1.b)   # only one grouping factor
    2×18 Matrix{Float64}:
    @@ -691,7 +691,7 @@ 

    +
    Int.(first(m1.reterms))
    180×36 Matrix{Int64}:
    @@ -724,68 +724,68 @@ 

    +
    m1.X * m1.β + only(m1.reterms) * vec(only(m1.b))
    180-element Vector{Float64}:
    - 254.2209228818791
    - 273.7637207577804
    - 293.3065186336817
    - 312.84931650958305
    - 332.3921143854843
    - 351.9349122613857
    - 371.477710137287
    - 391.0205080131883
    - 410.56330588908963
    - 430.10610376499096
    - 211.3566638556098
    - 213.17987026712763
    - 215.0030766786454
    + 254.22092372085748
    + 273.7637214536127
    + 293.30651918636795
    + 312.8493169191231
    + 332.39211465187833
    + 351.93491238463355
    + 371.47771011738877
    + 391.020507850144
    + 410.56330558289915
    + 430.1061033156544
    + 211.35666329748636
    + 213.17986977053795
    + 215.00307624358956
        ⋮
    - 328.09823342453774
    - 337.5944667259808
    - 263.52401259431105
    - 275.3019966221784
    - 287.0799806500457
    - 298.85796467791306
    - 310.6359487057804
    - 322.41393273364775
    - 334.1919167615151
    - 345.96990078938245
    - 357.7478848172497
    - 369.5258688451171
    + 328.0982334671007 + 337.594466785911 + 263.5240126399478 + 275.3019966705894 + 287.079980701231 + 298.8579647318726 + 310.6359487625142 + 322.41393279315577 + 334.1919168237974 + 345.969900854439 + 357.74788488508057 + 369.52586891572224

    -
    +
    fitted(m1)   # just to check that these are indeed the same as calculated above
    180-element Vector{Float64}:
    - 254.2209228818791
    - 273.7637207577804
    - 293.3065186336817
    - 312.84931650958305
    - 332.3921143854843
    - 351.9349122613857
    - 371.477710137287
    - 391.02050801318836
    - 410.56330588908963
    - 430.10610376499096
    - 211.3566638556098
    - 213.17987026712763
    - 215.0030766786454
    + 254.22092372085748
    + 273.7637214536127
    + 293.30651918636795
    + 312.8493169191231
    + 332.39211465187833
    + 351.9349123846335
    + 371.4777101173887
    + 391.020507850144
    + 410.56330558289915
    + 430.10610331565437
    + 211.35666329748636
    + 213.17986977053792
    + 215.00307624358956
        ⋮
    - 328.0982334245378
    - 337.5944667259808
    - 263.52401259431105
    - 275.3019966221784
    - 287.07998065004574
    - 298.85796467791306
    - 310.6359487057804
    - 322.41393273364775
    - 334.1919167615151
    - 345.96990078938245
    - 357.74788481724977
    - 369.5258688451171
    + 328.0982334671007 + 337.594466785911 + 263.5240126399478 + 275.3019966705894 + 287.079980701231 + 298.8579647318726 + 310.6359487625142 + 322.4139327931558 + 334.19191682379744 + 345.96990085443906 + 357.7478848850806 + 369.52586891572224

    In symbols we would write the linear predictor expression as \[ @@ -798,16 +798,16 @@

    \(\boldsymbol{\Sigma}_\boldsymbol{\theta}\) is a 36 × 36 symmetric covariance matrix that has a special form - it consists of 18 diagonal blocks, each of size 2 × 2 and all the same.

    Recall that this symmetric matrix can be constructed from the parameters \(\boldsymbol\theta\), which generate the lower triangular matrix \(\boldsymbol\lambda\), and the estimate \(\widehat{\sigma^2}\).

    -
    +
    m1.θ
    3-element Vector{Float64}:
    - 0.9292213081613828
    - 0.01816836498823806
    - 0.22264488151102485
    + 0.9292213200493655 + 0.01816837940083566 + 0.22264487715036416

    -
    +
    λ = only(m1.λ)  # with multiple grouping factors there will be multiple λ's
    2×2 LinearAlgebra.LowerTriangular{Float64, Matrix{Float64}}:
    @@ -815,7 +815,7 @@ 

    +
    Σ = varest(m1) ** λ')
    2×2 Matrix{Float64}:
    @@ -824,7 +824,7 @@ 

    +
    VarCorr(m1)

    @@ -841,7 +841,7 @@

    - + @@ -895,7 +895,7 @@

    this presentation for more information than you could possibly want to know on how Julia converts code like this to run on the processor.

    -
    +
    increment(x) = x + one(x)
     logistic(η) = inv(increment(exp(-η)))
    @@ -911,7 +911,7 @@

    3.1 An example of a Bernoulli GLMM

    The contra dataset in the MixedModels package is from a survey on the use of artificial contraception by women in Bangladesh.

    -
    +
    contra = DataFrame(dataset(:contra))
    1934×5 DataFrame
    1909 rows omitted
    @@ -1148,7 +1148,7 @@

    +
    combine(groupby(contra, :dist), nrow)
    60×2 DataFrame
    35 rows omitted
    @@ -1305,7 +1305,7 @@

    Figure 1, shows that the probability of contraception use is not linear in age - it is low for younger women, higher for women in the middle of the range (assumed to be women in late 20’s to early 30’s) and low again for older women (late 30’s to early 40’s in this survey).

    If we fit a model with only the age term in the fixed effects, that term will not be significant. This doesn’t mean that there is no “age effect”, it only means that there is no significant linear effect for age.

    -
    +
    Code
    draw(
    @@ -1335,7 +1335,7 @@ 

    +
    contrasts = Dict(
       :dist => Grouping(),
       :urban => HelmertCoding(),
    @@ -1350,7 +1350,7 @@ 

    fit(MixedModel, form, contra, dist; nAGQ, contrasts) end

    -
    Minimizing 199   Time: 0:00:00 ( 2.51 ms/it)
    +
    Minimizing 206   Time: 0:00:00 ( 1.72 ms/it)

    subj (Intercept)565.51066565.51068 23.78047
    @@ -1367,18 +1367,18 @@

    - + - + - + @@ -1391,7 +1391,7 @@

    - + @@ -1415,7 +1415,7 @@

    - + @@ -1428,7 +1428,7 @@

    +
    VarCorr(gm1)

    (Intercept)-0.6871-0.6870 0.1686 -4.08 <1e-040.47870.4786
    age 0.0035 0.0092 0.380.70230.7020
    urban: Y0.34830.3484 0.0600 5.81 <1e-08livch: 3+0.91540.9153 0.1858 4.93 <1e-06
    @@ -1444,8 +1444,8 @@

    - - + +
    dist (Intercept)0.2291130.4786570.229090.47863
    @@ -1455,7 +1455,7 @@

    3.2 Convert livch to a binary factor

    -
    +
    @transform!(contra, :children = :livch  "0")
     # add the associated contrast specifier
     contrasts[:children] = EffectsCoding()
    @@ -1463,7 +1463,7 @@

    +
    gm2 = let
       form = @formula(
         use ~
    @@ -1477,7 +1477,7 @@ 

    fit(MixedModel, form, contra, dist; nAGQ, contrasts) end

    -
    Minimizing 144   Time: 0:00:00 ( 1.01 ms/it)
    +
    Minimizing 149   Time: 0:00:00 ( 0.94 ms/it)
    @@ -1544,7 +1544,7 @@

    +
    Code
    let
    @@ -1612,7 +1612,7 @@ 

    3.3 Using urban&dist as a grouping factor

    It turns out that there can be more difference between urban and rural settings within the same political district than there is between districts. To model this difference we build a model with urban&dist as a grouping factor.

    -
    +
    gm3 = let
       form = @formula(
         use ~
    @@ -1626,7 +1626,7 @@ 

    fit(MixedModel, form, contra, dist; nAGQ, contrasts) end

    -
    Minimizing 140   Time: 0:00:00 ( 1.02 ms/it)
    +
    Minimizing 141   Time: 0:00:00 ( 1.08 ms/it)

    @@ -1667,7 +1667,7 @@

    - + @@ -1701,7 +1701,7 @@

    +
    Code
    let
    @@ -1746,7 +1746,7 @@ 

    7

    - + @@ -1773,7 +1773,7 @@

    +
    gm2

    children: true0.60650.6064 0.1045 5.80 <1e-082353.82 2368.482407.452407.46 2368.54
    @@ -1840,7 +1840,7 @@

    +
    gm3

    @@ -1881,7 +1881,7 @@

    - + @@ -1920,7 +1920,7 @@

    3.4 Predictions for some subgroups

    For a “typical” district (random effect near zero) the predictions on the linear predictor scale for a woman whose age is near the centering value (i.e. centered age of zero) are:

    -
    +
    using Effects
     design = Dict(
       :children => [true, false], :urban => ["Y", "N"], :age => [0.0]
    @@ -1957,40 +1957,40 @@ 

    true

    - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + +
    children: true0.60650.6064 0.1045 5.80 <1e-080.0 Y0.6585760.1505290.5080470.8091050.6585740.150530.5080440.809104
    2 false 0.0 Y-0.5543370.230477-0.784814-0.323861-0.5543060.230476-0.784781-0.32383
    3 true 0.0 N-0.1286120.113016-0.241628-0.0155953-0.1286270.113017-0.241644-0.0156101
    4 false 0.0 N-1.341520.221575-1.5631-1.11995-1.341510.221574-1.56308-1.11993
    @@ -1998,14 +1998,14 @@

    +
    logistic.(preds[!, "use: Y"])
    4-element Vector{Float64}:
    - 0.6589404203024364
    - 0.364858723221093
    - 0.46789132742910544
    - 0.2072594086310126
    + 0.6589399963739235 + 0.3648660519811384 + 0.46788748821040266 + 0.20726238106287984

    diff --git a/glmm_files/figure-html/fig-contradata-output-1.svg b/glmm_files/figure-html/fig-contradata-output-1.svg index 05e3856..6efc114 100644 --- a/glmm_files/figure-html/fig-contradata-output-1.svg +++ b/glmm_files/figure-html/fig-contradata-output-1.svg @@ -2,339 +2,339 @@ - + - + - + - - - - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - + + + + + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -342,302 +342,302 @@ - - - - - + + + + + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + @@ -647,34 +647,34 @@ - + - + - + - + - + - + - + - + - + - + diff --git a/kb07.html b/kb07.html index c8cb692..7c368b0 100644 --- a/kb07.html +++ b/kb07.html @@ -389,17 +389,15 @@

    Bootstrapping a fitted model

    Code
    using AlgebraOfGraphics
     using CairoMakie
    -using DataFrameMacros
    -using DataFrames
    -using MixedModels
    -using ProgressMeter
    -using Random
    -using SMLP2023: dataset
    +using DataFrames
    +using MixedModels
    +using Random
    +using SMLP2023: dataset
    +
    +CairoMakie.activate!(; type="svg")
     
    -CairoMakie.activate!(; type="svg")
    -
    -import ProgressMeter
    -ProgressMeter.ijulia_behavior(:clear)
    +import ProgressMeter +ProgressMeter.ijulia_behavior(:clear)

    @@ -543,8 +541,8 @@

    1 Data set and mo fit(MixedModel, form, kb07; contrasts) end

    -
    Minimizing 799   Time: 0:00:01 ( 1.68 ms/it)
    -  objective:  28637.123623229592
    +
    Minimizing 894   Time: 0:00:00 ( 0.79 ms/it)
    +  objective:  28637.97101084821
    @@ -571,79 +569,79 @@

    1 Data set and mo

    - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - + - - + + - + - - + + - + - - + + - + - + @@ -684,8 +682,8 @@

    1 Data set and mo

    - - + + @@ -693,35 +691,35 @@

    1 Data set and mo

    - - - + + + - - - - + + + + - - + + - - + + - - + + @@ -729,35 +727,35 @@

    1 Data set and mo

    - - - + + + - - + + - + - - - - - + + + + + - - + + @@ -871,14 +869,14 @@

    1 Data set and mo

    - + - + @@ -928,10 +926,10 @@

    1 Data set and mo

    - - + + - +
    (Intercept)2181.672977.313628.222181.642477.350528.20 <1e-99301.8062362.2579301.8688362.4643
    spkr: old67.749118.26643.7167.749617.96043.77 0.000242.379540.680733.058241.1114
    prec: maintain-333.920547.1558-333.920047.1534 -7.08 <1e-1161.9630246.915858.8506247.3123
    load: yes78.770219.52984.0378.800619.72703.99 <1e-0464.975142.389066.961243.3929
    spkr: old & prec: maintain-21.965515.8074-21.996015.8191 -1.390.16470.1644
    spkr: old & load: yes18.383715.807418.383215.8191 1.160.24480.2452
    prec: maintain & load: yes4.533315.80744.532715.8191 0.290.77430.7745
    spkr: old & prec: maintain & load: yes23.607315.807423.637715.8191 1.490.13530.1351
    Residual668.5542669.0519
    subj (Intercept)91087.0055301.806291124.7853301.8688
    spkr: old1796.022142.3795+0.791092.846833.0582+1.00
    prec: maintain3839.412661.9630-0.59+0.023463.397158.8506-0.62-0.62
    load: yes4221.763864.97514483.799766.9612 +0.36+0.85+0.54+0.36+0.51
    item (Intercept)131230.7914362.2579131380.3392362.4643
    spkr: old1654.923240.6807+0.441690.146441.1114+0.42
    prec: maintain60967.4037246.915861163.3893247.3123 -0.69+0.35+0.37
    load: yes1796.828442.3890+0.32+0.16-0.141882.946343.3929+0.29+0.14-0.13
    Residual 446964.7062668.5542447630.5113669.0519
    prec: maintain63766.93763766.936 252.521 -0.70
    subj (Intercept)88819.43888819.437 298.026
    rt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item) 2928637272863826 200.14310.1698
    @@ -951,28 +949,28 @@

    2 A bootstrap sam
    Table with 14 columns and 2000 rows:
           obj      β1       β2       β3        β4       σ        σ1       σ2       ⋯
         ┌───────────────────────────────────────────────────────────────────────────
    - 1  │ 28769.9  2152.69  60.3921  -359.134  54.1231  702.317  421.683  212.915  ⋯
    - 2  │ 28775.3  2221.81  61.7318  -349.417  71.1992  697.028  442.809  278.934  ⋯
    + 1  │ 28769.9  2152.69  60.3921  -359.134  54.1231  702.318  421.682  212.915  ⋯
    + 2  │ 28775.3  2221.81  61.7318  -349.417  71.1992  697.027  442.823  278.938  ⋯
      3  │ 28573.6  2325.31  53.9668  -404.225  81.3407  657.746  364.354  274.392  ⋯
    - 4  │ 28682.9  2274.65  52.9438  -384.66   69.6788  682.801  398.9    319.726  ⋯
    - 5  │ 28616.1  2191.34  54.7785  -357.919  111.829  673.878  253.248  235.913  ⋯
    - 6  │ 28634.1  2176.73  95.9793  -378.383  82.1559  671.685  510.996  309.876  ⋯
    - 7  │ 28620.4  2128.07  57.6928  -267.747  60.4621  666.986  396.878  295.009  ⋯
    + 4  │ 28682.9  2274.65  52.9438  -384.66   69.6788  682.801  398.902  319.725  ⋯
    + 5  │ 28616.1  2191.34  54.7785  -357.919  111.829  673.878  253.248  235.914  ⋯
    + 6  │ 28634.1  2176.73  95.9793  -378.383  82.1559  671.685  510.996  309.875  ⋯
    + 7  │ 28620.4  2128.07  57.6928  -267.747  60.4621  666.986  396.878  295.008  ⋯
      8  │ 28665.9  2152.59  55.8208  -274.382  76.5128  684.746  369.091  274.446  ⋯
      9  │ 28651.2  2088.3   76.4636  -296.14   95.6124  680.282  265.684  186.041  ⋯
    - 10 │ 28679.9  2375.23  72.2422  -423.922  94.0833  680.729  425.72   287.686  ⋯
    - 11 │ 28686.8  2034.11  59.9149  -224.859  59.5448  682.433  308.675  272.181  ⋯
    - 12 │ 28702.2  2130.98  83.3953  -271.61   79.974   689.679  401.974  264.255  ⋯
    - 13 │ 28625.0  2055.35  55.3526  -363.937  67.7128  676.817  309.154  265.796  ⋯
    - 14 │ 28570.3  2160.73  81.5575  -321.913  108.979  661.524  426.869  259.825  ⋯
    - 15 │ 28613.6  2237.73  36.9996  -362.443  82.1812  673.873  312.861  241.595  ⋯
    + 10 │ 28679.9  2375.23  72.2422  -423.922  94.0833  680.729  425.719  287.686  ⋯
    + 11 │ 28686.8  2034.11  59.9149  -224.859  59.5448  682.432  308.691  272.187  ⋯
    + 12 │ 28702.2  2130.98  83.3953  -271.61   79.974   689.679  401.978  264.25   ⋯
    + 13 │ 28625.0  2055.35  55.3526  -363.937  67.7128  676.817  309.146  265.792  ⋯
    + 14 │ 28570.3  2160.73  81.5575  -321.913  108.979  661.524  426.868  259.825  ⋯
    + 15 │ 28613.6  2237.73  36.9996  -362.443  82.1812  673.873  312.86   241.593  ⋯
      16 │ 28681.4  2306.64  43.8801  -429.983  103.082  686.437  360.536  204.514  ⋯
    - 17 │ 28577.2  2143.78  66.2959  -373.598  93.157   668.15   321.47   183.119  ⋯
    - 18 │ 28616.1  2197.03  55.9111  -356.06   74.1476  675.709  302.678  212.917  ⋯
    - 19 │ 28771.6  2067.71  56.5032  -324.984  64.804   699.136  344.776  225.602  ⋯
    - 20 │ 28674.3  2181.99  40.6566  -251.315  63.1301  683.81   340.569  295.054  ⋯
    - 21 │ 28677.6  2129.89  72.7198  -245.006  84.7693  681.416  359.088  287.655  ⋯
    - 22 │ 28582.1  2179.8   74.8364  -405.798  68.2978  664.168  357.697  231.402  ⋯
    + 17 │ 28577.2  2143.78  66.2959  -373.598  93.157   668.15   321.468  183.119  ⋯
    + 18 │ 28616.1  2197.03  55.9111  -356.06   74.1476  675.711  302.638  212.898  ⋯
    + 19 │ 28771.6  2067.71  56.5033  -324.984  64.804   699.14   344.805  225.657  ⋯
    + 20 │ 28674.3  2181.99  40.6566  -251.315  63.1301  683.81   340.57   295.054  ⋯
    + 21 │ 28677.6  2129.89  72.7198  -245.006  84.7693  681.416  359.085  287.655  ⋯
    + 22 │ 28582.1  2179.8   74.8364  -405.798  68.2978  664.169  357.698  231.401  ⋯
      23 │ 28714.9  2326.34  74.7091  -400.441  67.79    692.381  354.032  259.052  ⋯
      ⋮  │    ⋮        ⋮        ⋮        ⋮         ⋮        ⋮        ⋮        ⋮     ⋱

    @@ -982,17 +980,17 @@

    2 A bootstrap sam
    confint(kbm02samp)
    DictTable with 2 columns and 9 rows:
    - par   lower      upper
    - ────┬─────────────────────
    - β1  │ 2028.01    2337.92
    - β2  │ 38.431     99.5944
    - β3  │ -439.321   -245.864
    - β4  │ 46.0262    107.511
    - ρ1  │ -0.897984  -0.445598
    - σ   │ 655.249    701.497
    - σ1  │ 261.196    448.512
    - σ2  │ 175.489    312.049
    - σ3  │ 228.099    357.789
    + par lower upper + ────┬──────────────────── + β1 │ 2028.01 2337.92 + β2 │ 38.431 99.5944 + β3 │ -439.321 -245.864 + β4 │ 46.0262 107.511 + ρ1 │ -0.89799 -0.445596 + σ │ 655.249 701.497 + σ1 │ 261.196 448.51 + σ2 │ 175.489 312.044 + σ3 │ 228.099 357.789

    A sample like this can be used for more than just creating an interval because it approximates the distribution of the estimator. For the fixed-effects parameters the estimators are close to being normally distributed, Figure 1.

    diff --git a/kb07_files/figure-html/fig-kbm02sampcorrdens-output-1.svg b/kb07_files/figure-html/fig-kbm02sampcorrdens-output-1.svg index d05caa5..9efb4ec 100644 --- a/kb07_files/figure-html/fig-kbm02sampcorrdens-output-1.svg +++ b/kb07_files/figure-html/fig-kbm02sampcorrdens-output-1.svg @@ -2,132 +2,135 @@ - + - + - + - + - + - + - + + + + - + - - - - + - - - - + - + - + - + - + + + + - + - + - + - + - + - + - + - - - - + - + - + - + + + + + + + - - + + - - + + - + + + + - - + + + + + - + - + - + - + - + - - - - - - - + - + - + @@ -136,134 +139,134 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + diff --git a/kb07_files/figure-html/fig-kbm02sampsigmadens-output-1.svg b/kb07_files/figure-html/fig-kbm02sampsigmadens-output-1.svg index 7c5909c..f0e5fba 100644 --- a/kb07_files/figure-html/fig-kbm02sampsigmadens-output-1.svg +++ b/kb07_files/figure-html/fig-kbm02sampsigmadens-output-1.svg @@ -2,272 +2,257 @@ - + - + - - - - + - + + + + - + - + + + + - + - + - - - - - - - + - - + + - + - + - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - + + + + + + - + - - + + @@ -275,22 +260,22 @@ - + - + - + - + - + - + diff --git a/kkl15.html b/kkl15.html index 96d2cc7..de43b03 100644 --- a/kkl15.html +++ b/kkl15.html @@ -412,7 +412,7 @@

    1 Background

    2 Packages

    -
    +
    Code
    using Arrow
    @@ -439,7 +439,7 @@ 

    2 Packages

    3 Read data, compute and plot means

    -
    +
    dat = DataFrame(dataset(:kkl15))
     describe(dat)
    @@ -527,7 +527,7 @@

    3 Read data, comp

    We also recommend to sort levels of factors into a meaningful order, that is overwrite the default alphabetic ordering. This is also a good place to choose alternative names for variables in the context of the present analysis.

    The LMM analysis is based on log-transformed reaction times lrt, indicated by a boxcox() check of model residuals. With the exception of diagnostic plots of model residuals, the analysis of untransformed reaction times did not lead to different results.

    Comparative density plots of all response times by cue-target relation show the times for valid cues to be faster than for the other conditions.

    -
    +
    Code
    draw(
    @@ -556,7 +556,7 @@ 

    3 Read data, comp

    Boxplots of the mean of log response time by subject under the different conditions show an outlier value under three of the four conditions; they are from the same subject.

    -
    +
    dat_subj = combine(
       groupby(dat, [:Subj, :CTR]),
       nrow => :n,
    @@ -624,7 +624,7 @@ 

    3 Read data, comp 4 rt_m -308.223 +308.224 208.194 304.862 584.71 @@ -646,7 +646,7 @@

    3 Read data, comp

    -
    +
    Code
    boxplot(
    @@ -679,7 +679,7 @@ 

    3 Read data, comp

    Mean of log 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).

    We remove the outlier subject and replot, but we model the data points in dat and check whether this subject appears as an outlier in the caterpillar plot of conditional modes.

    -
    +
    Code
    let dat_subj = filter(r -> r.rt_m < 510, dat_subj)
    @@ -715,7 +715,7 @@ 

    3 Read data, comp

    A better alternative to the boxplot is often a dotplot, because it also displays subjects’ condition means.

    To be done

    For the next set of plots we average subjects’ data within each of the four experimental conditions. This table could be used as input for a repeated-measures ANOVA.

    -
    +
    dat_cond = combine(
       groupby(dat_subj, :CTR),
       :n => length => :N,
    @@ -790,7 +790,7 @@ 

    3 Read data, comp
  • plot the correlation matrix for four measures/scores, and
  • plot the correlation matrix for GM and three effects
  • -
    +
    dat_subj_w = @chain dat_subj begin
       unstack(:Subj, :CTR, :rt_m)
       disallowmissing!
    @@ -939,7 +939,7 @@ 

    3 Read data, comp

    4 Linear mixed model

    -
    +
    contrasts = Dict(
       :Subj => Grouping(),
       :CTR => SeqDiffCoding(; levels=["val", "sod", "dos", "dod"]),
    @@ -948,9 +948,6 @@ 

    4 Linear mixed mo form = @formula log(rt) ~ 1 + CTR + (1 + CTR | Subj) fit(MixedModel, form, dat; contrasts) end

    -
    -
    Minimizing 257   Time: 0:00:00 ( 0.96 ms/it)
    -
    @@ -1008,8 +1005,8 @@

    4 Linear mixed mo

    -
    -
    VarCorr(m1)
    +
    +
    VarCorr(m1)
    @@ -1036,8 +1033,8 @@

    4 Linear mixed mo

    - - + + @@ -1045,8 +1042,8 @@

    4 Linear mixed mo

    - - + + @@ -1054,8 +1051,8 @@

    4 Linear mixed mo

    - - + + @@ -1063,8 +1060,8 @@

    4 Linear mixed mo

    - - + + @@ -1073,7 +1070,7 @@

    4 Linear mixed mo

    - + @@ -1082,14 +1079,14 @@

    4 Linear mixed mo

    Subj (Intercept)0.033825210.183916320.033826310.18391930
    CTR: sod0.004729460.068771100.004729550.06877171 +0.56
    CTR: dos0.000001250.001120110.000001260.00112098 -0.05 +0.80
    CTR: dod0.001496900.038689780.001497040.03869162 +0.60 +0.66 +0.36Residual 0.038845750.197093260.19709325
    -
    -
    issingular(m1)
    +
    +
    issingular(m1)
    true
    -
    -
    only(MixedModels.PCA(m1))
    +
    +
    only(MixedModels.PCA(m1))
    
     Principal components based on correlation matrix
    @@ -1099,7 +1096,7 @@ 

    4 Linear mixed mo CTR: dod 0.6 0.66 0.36 1.0 Normalized cumulative variances: -[0.6325, 0.9136, 1.0, 1.0] +[0.6324, 0.9136, 1.0, 1.0] Component loadings PC1 PC2 PC3 PC4 @@ -1110,11 +1107,11 @@

    4 Linear mixed mo

    We note that the critical correlation parameter between spatial (sod) and attraction (dod) is now estimated at .66 – not that close to the 1.0 boundary that caused singularity in Kliegl et al. (2011). However, the LMM based on log reaction times is still singular. Let’s check for untransformed reaction times.

    -
    -
    m1_rt = let
    -  form = @formula rt ~ 1 + CTR + (1 + CTR | Subj)
    -  fit(MixedModel, form, dat; contrasts)
    -end
    +
    +
    m1_rt = let
    +  form = @formula rt ~ 1 + CTR + (1 + CTR | Subj)
    +  fit(MixedModel, form, dat; contrasts)
    +end
    @@ -1131,18 +1128,18 @@

    4 Linear mixed mo

    - - + + - + - + - + @@ -1150,15 +1147,15 @@

    4 Linear mixed mo

    - + - - + + @@ -1172,8 +1169,8 @@

    4 Linear mixed mo

    (Intercept) 308.20596.414948.056.415148.04 <1e-9959.376359.3778
    CTR: sod 23.07202.64182.6415 8.73 <1e-1722.852822.8500
    CTR: dos1.4584 8.97 <1e-186.83466.8337
    CTR: dod 2.6860 2.0608 1.300.192515.10270.192415.1022
    Residual
    -
    -
    VarCorr(m1_rt)
    +
    +
    VarCorr(m1_rt)
    @@ -1200,8 +1197,8 @@

    4 Linear mixed mo

    - - + + @@ -1209,8 +1206,8 @@

    4 Linear mixed mo

    - - + + @@ -1218,8 +1215,8 @@

    4 Linear mixed mo

    - - + + @@ -1227,8 +1224,8 @@

    4 Linear mixed mo

    - - + + @@ -1236,8 +1233,8 @@

    4 Linear mixed mo

    - - + + @@ -1246,8 +1243,8 @@

    4 Linear mixed mo

    Subj (Intercept)3525.5458559.376313525.7215259.37779
    CTR: sod522.2484622.85276522.1205422.84996 +0.66
    CTR: dos46.711446.8345846.699306.83369 +0.35 +0.15
    CTR: dod228.0906115.10267228.0755115.10217 +0.53 +0.65 +0.30
    Residual 4254.2469865.224594254.2484965.22460
    -
    -
    issingular(m1_rt)
    +
    +
    issingular(m1_rt)
    false
    @@ -1264,11 +1261,11 @@

    5 Diagnostic plot

    5.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(m1), residuals(m1); alpha=0.3)
    +
    CairoMakie.activate!(; type="png")
    +scatter(fitted(m1), residuals(m1); alpha=0.3)
    @@ -1280,17 +1277,17 @@

    +
    Code -
    set_aog_theme!()
    -draw(
    -  data((; f=fitted(m1), r=residuals(m1))) *
    -  mapping(
    -    :f => "Fitted values from m1", :r => "Residuals from m1"
    -  ) *
    -  density();
    -)
    +
    set_aog_theme!()
    +draw(
    +  data((; f=fitted(m1), r=residuals(m1))) *
    +  mapping(
    +    :f => "Fitted values from m1", :r => "Residuals from m1"
    +  ) *
    +  density();
    +)
    @@ -1305,18 +1302,18 @@

    5.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(m1);
    -  qqline=:none,
    -  axis=(;
    -    xlabel="Standard normal quantiles",
    -    ylabel="Quantiles of the residuals from model m1",
    -  ),
    -)
    +
    CairoMakie.activate!(; type="png")
    +qqnorm(
    +  residuals(m1);
    +  qqline=:none,
    +  axis=(;
    +    xlabel="Standard normal quantiles",
    +    ylabel="Quantiles of the residuals from model m1",
    +  ),
    +)
    @@ -1327,17 +1324,17 @@

    +
    Code -
    qqnorm(
    -  residuals(m1_rt);
    -  qqline=:none,
    -  axis=(;
    -    xlabel="Standard normal quantiles",
    -    ylabel="Quantiles of the residuals from model m1",
    -  ),
    -)
    +
    qqnorm(
    +  residuals(m1_rt);
    +  qqline=:none,
    +  axis=(;
    +    xlabel="Standard normal quantiles",
    +    ylabel="Quantiles of the residuals from model m1",
    +  ),
    +)
    @@ -1352,22 +1349,22 @@

    5.3 Observed and theoretical normal distribution

    The violation of expectation is again due to the fact that the distribution of residuals is narrower than expected from a normal distribution. We can see this in this plot. Overall, it does not look too bad.

    -
    +
    Code -
    CairoMakie.activate!(; type="svg")
    -let
    -  n = nrow(dat)
    -  dat_rz = (;
    -    value=vcat(residuals(m1) ./ std(residuals(m1)), randn(n)),
    -    curve=repeat(["residual", "normal"]; inner=n),
    -  )
    -  draw(
    -    data(dat_rz) *
    -    mapping(:value; color=:curve) *
    -    density(; bandwidth=0.1);
    -  )
    -end
    +
    CairoMakie.activate!(; type="svg")
    +let
    +  n = nrow(dat)
    +  dat_rz = (;
    +    value=vcat(residuals(m1) ./ std(residuals(m1)), randn(n)),
    +    curve=repeat(["residual", "normal"]; inner=n),
    +  )
    +  draw(
    +    data(dat_rz) *
    +    mapping(:value; color=:curve) *
    +    density(; bandwidth=0.1);
    +  )
    +end
    @@ -1384,11 +1381,11 @@

    6 Conditional modes

    6.1 Caterpillar plot

    -
    +
    Code -
    cm1 = only(ranefinfo(m1))
    -caterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=2)
    +
    cm1 = only(ranefinfo(m1))
    +caterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=2)
    @@ -1400,10 +1397,10 @@

    When we order the conditional modes for GM, that is (Intercept), the outlier subject S113 becomes visible; the associated experimental effects are not unusual.

    -
    +
    Code -
    caterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=1)
    +
    caterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=1)
    @@ -1415,11 +1412,11 @@

    The caterpillar plot also reveals that credibility intervals are much shorter for subjects’ Grand Means, shown in (Intercept), than the subjects’ experimental effects, because the latter are based on difference scores not means. Moreover, credibility intervals are shorter for the first spatial effect sod than the other two effects, because the spatial effect involves the valid condition which yielded three times as many trials than the other three conditions. Consequently, the spatial effect is more reliable. Unfortunately, due to differences in scaling of the x-axis of the panels this effect must be inferred. One option to reveal this difference is to reparameterize the LMM such model parameters estimate the conditional modes for the levels of condition rather than the contrast-based effects. This is accomplished by replacing the 1 in the random effect term with 0, as shown next.

    -
    -
    m1L = let
    -  form = @formula rt ~ 1 + CTR + (0 + CTR | Subj)
    -  fit(MixedModel, form, dat; contrasts)
    -end
    +
    +
    m1L = let
    +  form = @formula rt ~ 1 + CTR + (0 + CTR | Subj)
    +  fit(MixedModel, form, dat; contrasts)
    +end
    @@ -1436,7 +1433,7 @@

    - + @@ -1444,26 +1441,26 @@

    - + - + - + - + - - + + - - + + @@ -1471,11 +1468,11 @@

    - + - + @@ -1485,8 +1482,8 @@

    -
    -
    VarCorr(m1L)
    +
    +
    VarCorr(m1L)

    (Intercept) 308.20596.41536.4151 48.04 <1e-99 CTR: sod 23.07202.64152.6420 8.73 <1e-1760.179660.1802
    CTR: dos 13.08551.45841.4585 8.97 <1e-1862.478962.4787
    CTR: dod2.68602.06072.68592.0616 1.300.192471.54390.192671.5445
    CTR: val 47.292547.2886
    Residual65.224665.2245
    @@ -1504,8 +1501,8 @@

    - - + + @@ -1513,8 +1510,8 @@

    - - + + @@ -1522,8 +1519,8 @@

    - - + + @@ -1531,8 +1528,8 @@

    - - + + @@ -1540,8 +1537,8 @@

    - - + + @@ -1551,14 +1548,14 @@

    The caterpillar plot for levels shows the effect of the number of trials on credibility intervals; they are obviously much shorter for the valid condition. Note that this effect is not visible in a repeated-measure ANOVA with four condition means per subject as input.

    -
    +
    Code -
    @chain m1L begin
    -  ranefinfo
    -  only
    -  caterpillar!(Figure(; resolution=(800, 1000)), _; orderby=1)
    -end
    +
    @chain m1L begin
    +  ranefinfo
    +  only
    +  caterpillar!(Figure(; resolution=(800, 1000)), _; orderby=1)
    +end
    @@ -1574,10 +1571,10 @@

    6.2 Shrinkage plot

    6.2.1 Log-transformed reaction times (LMM m1)

    -
    +
    Code -
    shrinkageplot!(Figure(; resolution=(1000, 1200)), m1)
    +
    shrinkageplot!(Figure(; resolution=(1000, 1200)), m1)
    @@ -1592,10 +1589,10 @@

    6.2.2 Raw reaction times (LMM m1_rt)

    -
    +
    Code -
    shrinkageplot!(Figure(; resolution=(1000, 1200)), m1_rt)
    +
    shrinkageplot!(Figure(; resolution=(1000, 1200)), m1_rt)
    @@ -1621,73 +1618,73 @@

    7 Parametric boot

    7.1 Generate a bootstrap sample

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

    -
    -
    samp = parametricbootstrap(MersenneTwister(1234321), 2500, m1;
    -                           optsum_overrides=(; ftol_rel=1e-8));
    -
    -
    tbl = samp.tbl
    +
    samp = parametricbootstrap(MersenneTwister(1234321), 2500, m1;
    +                           optsum_overrides=(; ftol_rel=1e-8));
    +
    +
    +
    tbl = samp.tbl
    Table with 26 columns and 2500 rows:
           obj       β1       β2         β3         β4            σ         ⋯
         ┌───────────────────────────────────────────────────────────────────
    - 1  │ -21723.9  5.65297  0.0776126  0.039106   -0.0013708    0.196176  ⋯
    - 2  │ -21108.3  5.71733  0.0804429  0.0386068  0.00575313    0.197357  ⋯
    - 3  │ -21063.8  5.66428  0.0725792  0.0383587  0.00958592    0.197487  ⋯
    - 4  │ -21121.5  5.69924  0.075978   0.039032   0.00779778    0.197325  ⋯
    - 5  │ -21739.9  5.70391  0.0739256  0.034784   0.00040087    0.196179  ⋯
    - 6  │ -21359.0  5.69776  0.0827999  0.0440931  0.00786666    0.196906  ⋯
    - 7  │ -21120.2  5.67658  0.0620062  0.0415177  -0.00420678   0.197326  ⋯
    - 8  │ -21478.8  5.6702   0.0662573  0.0438442  -0.00331906   0.196696  ⋯
    - 9  │ -20886.6  5.68164  0.0719098  0.0368378  0.0043128     0.19782   ⋯
    - 10 │ -21400.4  5.68848  0.0707709  0.0410581  0.00626677    0.196777  ⋯
    - 11 │ -21565.8  5.65823  0.0626937  0.0449801  -0.0129838    0.196502  ⋯
    - 12 │ -20959.8  5.68811  0.086935   0.0405281  -0.00620311   0.197551  ⋯
    - 13 │ -21515.6  5.6556   0.0688038  0.0412677  -0.00227728   0.196591  ⋯
    - 14 │ -21351.5  5.70541  0.0844503  0.0393561  0.00206449    0.196936  ⋯
    - 15 │ -21505.6  5.69288  0.0686169  0.0373182  0.000780283   0.196691  ⋯
    - 16 │ -21152.2  5.71185  0.0785621  0.0443818  0.00196888    0.197318  ⋯
    - 17 │ -20954.6  5.67956  0.0560955  0.0441204  0.00616687    0.197625  ⋯
    - 18 │ -21297.9  5.69953  0.0819562  0.0482077  -0.000747306  0.196944  ⋯
    - 19 │ -21636.6  5.68097  0.0631924  0.0416913  -0.00420336   0.196289  ⋯
    - 20 │ -20761.5  5.72306  0.0850321  0.0390101  0.0114425     0.197969  ⋯
    - 21 │ -21433.2  5.67599  0.0722524  0.0458681  -0.000569138  0.196698  ⋯
    - 22 │ -20850.3  5.69293  0.0653955  0.0383436  -0.00174954   0.197888  ⋯
    - 23 │ -21412.2  5.70064  0.0761079  0.0439189  0.00447735    0.196759  ⋯
    + 1  │ -21726.3  5.65296  0.0776098  0.0390983  -0.00192407   0.196175  ⋯
    + 2  │ -21112.6  5.71733  0.0804452  0.0386008  0.00441928    0.197359  ⋯
    + 3  │ -21065.0  5.66428  0.0725807  0.0383616  0.00977017    0.197492  ⋯
    + 4  │ -21116.6  5.69924  0.0759795  0.0390337  0.00725382    0.197324  ⋯
    + 5  │ -21650.5  5.7039   0.0739011  0.0348058  -0.000164276  0.196069  ⋯
    + 6  │ -21356.6  5.69776  0.0828046  0.0440864  0.00807038    0.196912  ⋯
    + 7  │ -21118.0  5.67658  0.0620127  0.0415122  -0.00470687   0.197323  ⋯
    + 8  │ -21482.2  5.6702   0.0662555  0.0438526  -0.00243733   0.196701  ⋯
    + 9  │ -20882.6  5.68163  0.071917   0.0368263  0.00451148    0.197831  ⋯
    + 10 │ -21400.8  5.68848  0.0707767  0.0410532  0.00644842    0.196796  ⋯
    + 11 │ -21566.3  5.65823  0.0626926  0.0449806  -0.0126605    0.196514  ⋯
    + 12 │ -20958.1  5.68811  0.0869311  0.0405299  -0.00495313   0.197559  ⋯
    + 13 │ -21516.6  5.6556   0.0688022  0.0412704  -0.00261289   0.196596  ⋯
    + 14 │ -21354.8  5.70541  0.0844484  0.0393567  0.00274489    0.196936  ⋯
    + 15 │ -21503.1  5.69287  0.0686162  0.0373194  0.00145341    0.196692  ⋯
    + 16 │ -21155.5  5.71186  0.0785595  0.0443829  0.00210673    0.197311  ⋯
    + 17 │ -20954.3  5.67956  0.0560935  0.0441269  0.0065956     0.197633  ⋯
    + 18 │ -21296.4  5.69953  0.0819501  0.048204   -0.00110287   0.196946  ⋯
    + 19 │ -21638.0  5.68097  0.0631934  0.041689   -0.00418874   0.196291  ⋯
    + 20 │ -20760.8  5.72306  0.0850344  0.0390064  0.0113318     0.197966  ⋯
    + 21 │ -21432.3  5.676    0.0722568  0.0458649  0.000163016   0.196699  ⋯
    + 22 │ -20850.9  5.69293  0.0654037  0.0383358  -0.00130412   0.197842  ⋯
    + 23 │ -21406.8  5.70064  0.0761065  0.0439254  0.00542814    0.196757  ⋯
      ⋮  │    ⋮         ⋮         ⋮          ⋮           ⋮           ⋮      ⋱

    7.2 Shortest coverage interval

    -
    -
    confint(samp)
    +
    +
    confint(samp)
    DictTable with 2 columns and 15 rows:
      par   lower        upper
      ────┬───────────────────────
    - β1  │ 5.65481      5.73071
    - β2  │ 0.058961     0.0895368
    - β3  │ 0.033392     0.0485977
    - β4  │ -0.00904061  0.0126064
    - ρ1  │ 0.396079     0.723871
    - ρ2  │ -0.999971    0.915557
    - ρ3  │ -0.881343    0.999992
    - ρ4  │ 0.379009     0.807484
    - ρ5  │ 0.460748     0.910983
    - ρ6  │ -0.880744    0.800718
    - σ   │ 0.195885     0.198254
    - σ1  │ 0.154888     0.20986
    - σ2  │ 0.0567064    0.080392
    - σ3  │ 0.000848579  0.0176647
    - σ4  │ 0.0283153    0.0492107
    + β1 │ 5.65481 5.7307 + β2 │ 0.059008 0.0895876 + β3 │ 0.0333901 0.0485983 + β4 │ -0.00892629 0.0127809 + ρ1 │ 0.388808 0.718646 + ρ2 │ -0.999908 0.925436 + ρ3 │ -0.890365 0.999997 + ρ4 │ 0.383311 0.813969 + ρ5 │ 0.433522 0.886426 + ρ6 │ -0.840803 0.830724 + σ │ 0.195886 0.198245 + σ1 │ 0.154673 0.210314 + σ2 │ 0.0564024 0.0801978 + σ3 │ 0.000653202 0.0175227 + σ4 │ 0.0283408 0.0493863

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

    -
    +
    Code -
    ridgeplot(samp; show_intercept=false)
    +
    ridgeplot(samp; show_intercept=false)
    @@ -1703,15 +1700,15 @@

    7.3 Comparative density plots of bootstrapped parameter estimates

    7.3.1 Residual

    -
    +
    Code -
    draw(
    -  data(tbl) *
    -  mapping(:σ => "Residual") *
    -  density();
    -  figure=(; resolution=(800, 400)),
    -)
    +
    draw(
    +  data(tbl) *
    +  mapping(:σ => "Residual") *
    +  density();
    +  figure=(; resolution=(800, 400)),
    +)
    @@ -1726,32 +1723,32 @@

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

    The shortest coverage interval for the GM ranges from 376 to 404 ms and the associate variance component from .15 to .21. 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(
    -    [:β2, :β3, :β4] .=> "Experimental effect size [ms]";
    -    color=dims(1) => 
    -    renamer(["spatial effect", "object effect", "attraction effect"]) =>
    -    "Experimental effects",
    -  ) *
    -  density();
    -  figure=(; resolution=(800, 350)),
    -)
    +
    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(
    +    [:β2, :β3, :β4] .=> "Experimental effect size [ms]";
    +    color=dims(1) => 
    +    renamer(["spatial effect", "object effect", "attraction effect"]) =>
    +    "Experimental effects",
    +  ) *
    +  density();
    +  figure=(; resolution=(800, 350)),
    +)
    @@ -1763,20 +1760,20 @@

    +
    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)),
    -)
    +
    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)),
    +)
    @@ -1791,21 +1788,21 @@

    7.3.3 Correlation parameters (CPs)

    -
    +
    Code -
    draw(
    -  data(tbl) *
    -  mapping(
    -    [:ρ1, :ρ2, :ρ3, :ρ4, :ρ5, :ρ6] .=> "Correlation";
    -    color=dims(1) =>
    -    renamer(["GM, spatial", "GM, object", "spatial, object",
    -    "GM, attraction", "spatial, attraction", "object, attraction"]) =>
    -    "Correlation parameters",
    -  ) *
    -  density();
    -  figure=(; resolution=(800, 350)),
    -)
    +
    draw(
    +  data(tbl) *
    +  mapping(
    +    [:ρ1, :ρ2, :ρ3, :ρ4, :ρ5, :ρ6] .=> "Correlation";
    +    color=dims(1) =>
    +    renamer(["GM, spatial", "GM, object", "spatial, object",
    +    "GM, attraction", "spatial, attraction", "object, attraction"]) =>
    +    "Correlation parameters",
    +  ) *
    +  density();
    +  figure=(; resolution=(800, 350)),
    +)
    diff --git a/kkl15_files/figure-html/fig-betadensitym1-output-1.svg b/kkl15_files/figure-html/fig-betadensitym1-output-1.svg index 95a0cf5..777f970 100644 --- a/kkl15_files/figure-html/fig-betadensitym1-output-1.svg +++ b/kkl15_files/figure-html/fig-betadensitym1-output-1.svg @@ -2,536 +2,536 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - - + + - - + + - + + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - + + + + + + + + + - - + + @@ -539,196 +539,196 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/kkl15_files/figure-html/fig-bsridgem1-output-1.svg b/kkl15_files/figure-html/fig-bsridgem1-output-1.svg index 117756d..7dac5e7 100644 --- a/kkl15_files/figure-html/fig-bsridgem1-output-1.svg +++ b/kkl15_files/figure-html/fig-bsridgem1-output-1.svg @@ -2,529 +2,532 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + + + + - - + + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - - - + + + - - - - - - - + + + + + + + - - + + diff --git a/kkl15_files/figure-html/fig-caterpillarm1-output-1.svg b/kkl15_files/figure-html/fig-caterpillarm1-output-1.svg index 6a9535e..a44240e 100644 --- a/kkl15_files/figure-html/fig-caterpillarm1-output-1.svg +++ b/kkl15_files/figure-html/fig-caterpillarm1-output-1.svg @@ -2,1822 +2,1843 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - - + + - + - + - - + + - - + + - - + + - - + + - + - + + + + - + + + + + + + + + + - + + + + - + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2164,79 +2185,79 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2253,7 +2274,7 @@ - + @@ -2289,7 +2310,7 @@ - + @@ -2303,10 +2324,10 @@ - + - + @@ -2319,7 +2340,7 @@ - + @@ -2349,12 +2370,12 @@ - + - + - + @@ -2387,20 +2408,20 @@ - + - + - + - + - + @@ -2460,17 +2481,17 @@ - + - + - + @@ -2542,27 +2563,27 @@ - + - - + + - + - + @@ -2583,530 +2604,530 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - + + + + - - - + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - - - - + + + + + + + + - - - - + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - + - - - - - - - - - - - - + + + + + + + + + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - - + + - + - + - + - - + + - + - + - + - + - - + + - - + + - + - + @@ -3116,30 +3137,30 @@ - + - + - + - - - + + + - + - + - - + + - - + + @@ -3148,32 +3169,32 @@ - + - + - + - + - + - + - - + + @@ -3183,28 +3204,28 @@ - + - + - + - - + + - + - - + + - + - + @@ -3213,21 +3234,21 @@ - - + + - + - + - + - - - + + + @@ -3245,13 +3266,13 @@ - + - + @@ -3263,22 +3284,22 @@ - + - + - + - + @@ -3293,9 +3314,9 @@ - + - + @@ -3315,49 +3336,49 @@ - + - + - + - - + + - + - + - + - + - + @@ -3374,23 +3395,23 @@ - + - - + + - + - + - + @@ -3492,10 +3513,10 @@ - - - - + + + + diff --git a/kkl15_files/figure-html/fig-caterpillarm1a-output-1.svg b/kkl15_files/figure-html/fig-caterpillarm1a-output-1.svg index 73959b8..859f539 100644 --- a/kkl15_files/figure-html/fig-caterpillarm1a-output-1.svg +++ b/kkl15_files/figure-html/fig-caterpillarm1a-output-1.svg @@ -2,1822 +2,1846 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - - + + - - + + - - + + - + - + + + + - + + + + + + + + + + - + + + + - + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2164,79 +2188,79 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2247,7 +2271,7 @@ - + @@ -2273,7 +2297,7 @@ - + @@ -2316,14 +2340,14 @@ - + - - + + @@ -2347,7 +2371,7 @@ - + @@ -2361,15 +2385,15 @@ - + - + - + @@ -2382,18 +2406,18 @@ - + - + - - + + @@ -2456,7 +2480,7 @@ - + @@ -2485,7 +2509,7 @@ - + @@ -2496,11 +2520,11 @@ - + - + @@ -2540,15 +2564,15 @@ - - + + - + - + @@ -2583,316 +2607,316 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - + + - + - - + + - + - + - + @@ -2902,210 +2926,210 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - - + + - + - + - - + + - - + + - - + + - - - + + + - + - + @@ -3113,30 +3137,30 @@ - + - + - + - - - + + + - + - - + + - + @@ -3149,22 +3173,22 @@ - + - + - + - + - + - + @@ -3176,53 +3200,53 @@ - - + + - + - - + + - + - + - - - + + + - - + + - - + + - + - - + + - + - + @@ -3247,11 +3271,11 @@ - + - + @@ -3261,23 +3285,23 @@ - + - + - + - + @@ -3301,31 +3325,31 @@ - + - + - - + + - + - - + + - + @@ -3334,23 +3358,23 @@ - + - + - + - + - - + + @@ -3359,9 +3383,9 @@ - + - + @@ -3369,14 +3393,14 @@ - + - - + + @@ -3388,11 +3412,11 @@ - + - + @@ -3492,10 +3516,10 @@ - - - - + + + + diff --git a/kkl15_files/figure-html/fig-caterpillarm1l-output-1.svg b/kkl15_files/figure-html/fig-caterpillarm1l-output-1.svg index 1691a65..6aff96f 100644 --- a/kkl15_files/figure-html/fig-caterpillarm1l-output-1.svg +++ b/kkl15_files/figure-html/fig-caterpillarm1l-output-1.svg @@ -2,372 +2,390 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + + + + + + + - + - - - - + - - + + - - + + - + - + + + + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + - + - + + + + - + + + + - + - + - + - + - + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + - - + + - + - + - + - + + + + - + - + - + - - - - + - - - - - - - - + + - - + + - - + + - + - + - + - + - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - - + - + - + + + + + + + - + @@ -376,501 +394,501 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -958,742 +976,742 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1778,763 +1796,763 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2619,293 +2637,293 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kkl15_files/figure-html/fig-caterpillarm1la-output-1.svg b/kkl15_files/figure-html/fig-caterpillarm1la-output-1.svg index ac3d91f..78af265 100644 --- a/kkl15_files/figure-html/fig-caterpillarm1la-output-1.svg +++ b/kkl15_files/figure-html/fig-caterpillarm1la-output-1.svg @@ -2,1786 +2,1792 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - - + + - + + + + - + + + + - + + + + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - - - - - - - - + + - + - + + + + - + - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1802,7 +1808,7 @@ - + @@ -1824,7 +1830,7 @@ - + @@ -1839,7 +1845,7 @@ - + @@ -1854,7 +1860,7 @@ - + @@ -1864,7 +1870,7 @@ - + @@ -1908,7 +1914,7 @@ - + @@ -1916,7 +1922,7 @@ - + @@ -1937,11 +1943,11 @@ - + - + @@ -2034,7 +2040,7 @@ - + @@ -2049,7 +2055,7 @@ - + @@ -2099,7 +2105,7 @@ - + @@ -2128,292 +2134,292 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - - - - - - + + + + + + - - - + + + - + - + - - - - - + + + + + - - + + - + - + - - + + - - - - + + + + - - - - - - - + + + + + + + - - - + + + - - - - - - - + + + + + + + - - + + - - + + - + - + - + - - - - + + + + - + - - - + + + - - + + - - + + - - - + + + - - - - + + + + - - + + - - + + - + - + - + - - + + - - - + + + - + - - - - + + + + - - - - - + + + + + - + - + - - - - - - + + + + + + - + - + - + - + - + - + - + - - - + + + - + - + - - - + + + - + - - + + - + - + - + - + @@ -2421,76 +2427,76 @@ - - + + - - - + + + - + - - + + - + - - - + + + - - + + - + - + - - - - - - + + + + + + - - + + - - - - + + + + - + - + @@ -2500,7 +2506,7 @@ - + @@ -2514,551 +2520,551 @@ - + - + - - - + + + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - + + + - - + + - - - + + + - - + + - + - + - + - - - - + + + + - - - + + + - - - + + + - - - - - + + + + + - - - + + + - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - + + + + + + + + + - + - - - - - + + + + + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - - - + + + - + - + - + - + - + - - + + - + - - + + - - + + - - - - - - + + + + + + - - - + + + - - + + - + - + - - - + + + - + - - - + + + - + - - - + + + - - + + - - - - - + + + + + - + - + - - - - + + + + - + - + - + - - - + + + - - - + + + - - + + - + - + - - - + + + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - + + + - + - + - + - + - - + + - - + + - + - + - + - + - + - - - - - + + + + + - + - + - - + + - - - - - - + + + + + + @@ -3066,54 +3072,54 @@ - + - + - - - - + + + + - - + + - + - - + + - - + + - + - + - + - - + + - + - + @@ -3122,48 +3128,48 @@ - - + + - + - - + + - - + + - - - - + + + + - - + + - - - + + + - + - + - - - - + + + + @@ -3171,16 +3177,16 @@ - - - + + + - + @@ -3189,31 +3195,31 @@ - - + + - + - - + + - + - + - - + + @@ -3225,23 +3231,23 @@ - - - + + + - + - - + + @@ -3259,22 +3265,22 @@ - - - + + + - + - - + + @@ -3289,43 +3295,43 @@ - + - + - - + + - - + + - + - - + + - + - - - + + + - + - - + + @@ -3422,15 +3428,15 @@ - - + + - + - - + + diff --git a/kkl15_files/figure-html/fig-corrdensitym1-output-1.svg b/kkl15_files/figure-html/fig-corrdensitym1-output-1.svg index 0cab006..6de31b1 100644 --- a/kkl15_files/figure-html/fig-corrdensitym1-output-1.svg +++ b/kkl15_files/figure-html/fig-corrdensitym1-output-1.svg @@ -2,522 +2,531 @@ - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + - + - + + + + - - + + + + + - + - - + + - + - + - - - - + - + - + + + + - - + + - + + + + - + - + - + - + - + - + - - - - + - + - + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - + + + + @@ -531,331 +540,331 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/kkl15_files/figure-html/fig-m1fittedresid-output-1.png b/kkl15_files/figure-html/fig-m1fittedresid-output-1.png index 8b40d48..e8f3bad 100644 Binary files a/kkl15_files/figure-html/fig-m1fittedresid-output-1.png and b/kkl15_files/figure-html/fig-m1fittedresid-output-1.png differ diff --git a/kkl15_files/figure-html/fig-m1fittedresid2-output-1.png b/kkl15_files/figure-html/fig-m1fittedresid2-output-1.png index 12b6988..2a374e0 100644 Binary files a/kkl15_files/figure-html/fig-m1fittedresid2-output-1.png and b/kkl15_files/figure-html/fig-m1fittedresid2-output-1.png differ diff --git a/kkl15_files/figure-html/fig-qqnormm1-output-1.png b/kkl15_files/figure-html/fig-qqnormm1-output-1.png index 39b94c7..0ea8360 100644 Binary files a/kkl15_files/figure-html/fig-qqnormm1-output-1.png and b/kkl15_files/figure-html/fig-qqnormm1-output-1.png differ diff --git a/kkl15_files/figure-html/fig-qqnormm1_rt-output-1.png b/kkl15_files/figure-html/fig-qqnormm1_rt-output-1.png index 7338f86..7cdfe26 100644 Binary files a/kkl15_files/figure-html/fig-qqnormm1_rt-output-1.png and b/kkl15_files/figure-html/fig-qqnormm1_rt-output-1.png differ diff --git a/kkl15_files/figure-html/fig-shrinkagem1_rt-output-1.svg b/kkl15_files/figure-html/fig-shrinkagem1_rt-output-1.svg index adbf976..a1e0b68 100644 --- a/kkl15_files/figure-html/fig-shrinkagem1_rt-output-1.svg +++ b/kkl15_files/figure-html/fig-shrinkagem1_rt-output-1.svg @@ -2,309 +2,321 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + - + - + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + - - + + - - + + - + - - + + - + - + - - - - - + + - - + + - + - + - + - - + + - + - + - + - + - - + + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - - + + - + - + @@ -313,46 +325,46 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -399,7 +411,7 @@ - + @@ -440,311 +452,311 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + @@ -791,7 +803,7 @@ - + @@ -832,264 +844,264 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1177,370 +1189,370 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1587,7 +1599,7 @@ - + @@ -1628,305 +1640,305 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -2015,310 +2027,310 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + @@ -2407,284 +2419,284 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - + + + - + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + - - - - + + + + - - - + + + - + - + diff --git a/kkl15_files/figure-html/fig-sigmadensitym1-output-1.svg b/kkl15_files/figure-html/fig-sigmadensitym1-output-1.svg index b9e108b..dc5fa71 100644 --- a/kkl15_files/figure-html/fig-sigmadensitym1-output-1.svg +++ b/kkl15_files/figure-html/fig-sigmadensitym1-output-1.svg @@ -2,348 +2,336 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + - - + + - + - - - - - - - + - + - + - + + + + + + + - + - - - - - + + - - + + - + - - - - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - + + + + + + - - - - - - + + + + + + diff --git a/kkl15_files/figure-html/fig-sigmasdensitym1-output-1.svg b/kkl15_files/figure-html/fig-sigmasdensitym1-output-1.svg index 867f30b..5d68e1b 100644 --- a/kkl15_files/figure-html/fig-sigmasdensitym1-output-1.svg +++ b/kkl15_files/figure-html/fig-sigmasdensitym1-output-1.svg @@ -2,508 +2,531 @@ - + - + - - - - - - - + - - - - + - + + + + - - + + - + - - + + - - + + - - + + - + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + + + + - + + + + - + - + + + + - + - + + + + - + - + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - - - - + - - + + - + - - - - + - - + + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -511,195 +534,195 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + diff --git a/kkl15_files/figure-html/fig-stdresidm1dens-output-1.svg b/kkl15_files/figure-html/fig-stdresidm1dens-output-1.svg index 4cd7fe9..ce086ab 100644 --- a/kkl15_files/figure-html/fig-stdresidm1dens-output-1.svg +++ b/kkl15_files/figure-html/fig-stdresidm1dens-output-1.svg @@ -2,291 +2,300 @@ - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + + + + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + @@ -300,61 +309,61 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/kwdyz11.html b/kwdyz11.html index 6563e9e..d2fb3f5 100644 --- a/kwdyz11.html +++ b/kwdyz11.html @@ -416,7 +416,7 @@

    1 Background

    2 Packages

    -
    +
    Code
    using AlgebraOfGraphics
    @@ -442,7 +442,7 @@ 

    2 Packages

    3 Read data, compute and plot densities and means

    -
    +
    dat = DataFrame(dataset(:kwdyz11))
     describe(dat)
    @@ -530,7 +530,7 @@

    3 Read data, comp

    We also recommend to sort levels of factors into a meaningful order, that is overwrite the default alphabetic ordering. This is also a good place to choose alternative names for variables in the context of the present analysis.

    The LMM analysis is based on log-transformed reaction times lrt, indicated by a boxcox() check of model residuals. With the exception of diagnostic plots of model residuals, the analysis of untransformed reaction times did not lead to different results and exhibited the same problems of model identification (see Kliegl et al., 2011).

    Comparative density plots of all response times by cue-target relation, Figure 1, show the times for valid cues to be faster than for the other conditions.

    -
    +
    Code
    draw(
    @@ -555,7 +555,7 @@ 

    3 Read data, comp

    An alternative visualization without overlap of the conditions can be accomplished with ridge plots.

    To be done

    For the next set of plots we average subjects’ data within the four experimental conditions. This table could be used as input for a repeated-measures ANOVA.

    -
    +
    dat_subj = combine(
       groupby(dat, [:Subj, :CTR]),
       :rt => length => :n,
    @@ -799,7 +799,7 @@ 

    3 Read data, comp

    -
    +
    Code
    boxplot(
    @@ -836,7 +836,7 @@ 

    3 Read data, comp

    4 Linear mixed model

    -
    +
    contrasts = Dict(
       :CTR => SeqDiffCoding(; levels=["val", "sod", "dos", "dod"]),
       :Subj => Grouping(),
    @@ -845,9 +845,6 @@ 

    4 Linear mixed mo form = @formula(log(rt) ~ 1 + CTR + (1 + CTR | Subj)) fit(MixedModel, form, dat; contrasts) end

    -
    -
    Minimizing 242   Time: 0:00:00 ( 1.17 ms/it)
    -

    Subj CTR: val2236.578447.29252236.211347.2886 CTR: sod3621.581660.17963621.657760.1802 +0.94 CTR: dos3903.613262.47893903.582662.4787 +0.93 +0.99 CTR: dod5118.522571.54395118.615071.5445 +0.89 +0.98 +0.98Residual 4254.248365.22464254.241965.2245
    @@ -905,8 +902,8 @@

    4 Linear mixed mo

    -
    -
    VarCorr(m1)
    +
    +
    VarCorr(m1)
    @@ -933,8 +930,8 @@

    4 Linear mixed mo

    - - + + @@ -943,7 +940,7 @@

    4 Linear mixed mo

    - + @@ -951,8 +948,8 @@

    4 Linear mixed mo

    - - + + @@ -961,7 +958,7 @@

    4 Linear mixed mo

    - + @@ -979,15 +976,15 @@

    4 Linear mixed mo

    Subj (Intercept)0.02076540.14410210.02076510.1441010 CTR: sod 0.00338490.05817950.0581798 +0.48
    CTR: dos0.00075290.02743990.00075300.0274402 -0.24 -0.15 CTR: dod 0.00062200.02494090.0249402 +0.30 +0.93 -0.43
    -
    -
    issingular(m1)
    +
    +
    issingular(m1)
    true

    LMM m1 is not fully supported by the data; it is overparameterized. This is also visible in the PCA: only three, not four PCS are needed to account for all the variance and covariance in the random-effect structure. The problem is the +.93 CP for spatial sod and attraction dod effects.

    -
    -
    first(MixedModels.PCA(m1))
    +
    +
    first(MixedModels.PCA(m1))
    
     Principal components based on correlation matrix
    @@ -1018,16 +1015,16 @@ 

    5 Diagnostic plot

    5.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")
    -set_aog_theme!()
    -draw(
    -  data((; f=fitted(m1), r=residuals(m1))) *
    -  mapping(:f => "Fitted values", :r => "Residual from model m1") *
    -  visual(Scatter);
    -)
    +
    CairoMakie.activate!(; type="png")
    +set_aog_theme!()
    +draw(
    +  data((; f=fitted(m1), r=residuals(m1))) *
    +  mapping(:f => "Fitted values", :r => "Residual from model m1") *
    +  visual(Scatter);
    +)
    @@ -1039,17 +1036,17 @@

    +
    Code -
    CairoMakie.activate!(; type="png")
    -draw(
    -  data((; f=fitted(m1), r=residuals(m1))) *
    -  mapping(
    -    :f => "Fitted log response time", :r => "Residual from model m1"
    -  ) *
    -  density();
    -)
    +
    CairoMakie.activate!(; type="png")
    +draw(
    +  data((; f=fitted(m1), r=residuals(m1))) *
    +  mapping(
    +    :f => "Fitted log response time", :r => "Residual from model m1"
    +  ) *
    +  density();
    +)
    @@ -1064,8 +1061,8 @@

    5.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.

    -
    -
    qqnorm(residuals(m1); qqline=:none)
    +
    +
    qqnorm(residuals(m1); qqline=:none)

    @@ -1074,21 +1071,21 @@

    5.3 Observed and theoretical normal distribution

    The violation of expectation is again due to the fact that the distribution of residuals is much narrower than expected from a normal distribution, as shown in Figure 5. Overall, it does not look too bad.

    -
    +
    Code -
    let
    -  n = nrow(dat)
    -  dat_rz = DataFrame(;
    -    value=vcat(residuals(m1) ./ std(residuals(m1)), randn(n)),
    -    curve=vcat(fill.("residual", n), fill.("normal", n)),
    -  )
    -  draw(
    -    data(dat_rz) *
    -    mapping(:value => "Standardized residuals"; color=:curve) *
    -    density(; bandwidth=0.1);
    -  )
    -end
    +
    let
    +  n = nrow(dat)
    +  dat_rz = DataFrame(;
    +    value=vcat(residuals(m1) ./ std(residuals(m1)), randn(n)),
    +    curve=vcat(fill.("residual", n), fill.("normal", n)),
    +  )
    +  draw(
    +    data(dat_rz) *
    +    mapping(:value => "Standardized residuals"; color=:curve) *
    +    density(; bandwidth=0.1);
    +  )
    +end
    @@ -1117,12 +1114,12 @@

    6.2 Caterpillar plot

    The caterpillar plot, Figure 6, also reveals the high correlation between spatial sod and attraction dod effects.

    -
    +
    Code -
    caterpillar!(
    -  Figure(; resolution=(800, 1000)), ranefinfo(m1, :Subj); orderby=2
    -)
    +
    caterpillar!(
    +  Figure(; resolution=(800, 1000)), ranefinfo(m1, :Subj); orderby=2
    +)
    @@ -1137,10 +1134,10 @@

    6.3 Shrinkage plot

    Figure 7 provides more evidence for a problem with the visualization of the spatial sod and attraction dod CP. The corresponding panel illustrates an implosion of conditional modes.

    -
    +
    Code -
    shrinkageplot!(Figure(; resolution=(1000, 1000)), m1)
    +
    shrinkageplot!(Figure(; resolution=(1000, 1000)), m1)
    @@ -1164,40 +1161,40 @@

    7 Parametric boot

    7.1 Generate a bootstrap sample

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

    -
    +
    Code -
    Random.seed!(1234321)
    -samp = parametricbootstrap(2500, m1; hide_progress=true)
    -tbl = samp.tbl
    +
    Random.seed!(1234321)
    +samp = parametricbootstrap(2500, m1; hide_progress=true)
    +tbl = samp.tbl
    Table with 26 columns and 2500 rows:
           obj       β1       β2         β3         β4            σ         ⋯
         ┌───────────────────────────────────────────────────────────────────
    - 1  │ -12802.3  5.93392  0.0864217  0.0488883  -0.0121833    0.192002  ⋯
    - 2  │ -12794.3  5.95776  0.0989839  0.0318746  -0.00666147   0.191977  ⋯
    - 3  │ -12930.6  5.93669  0.0885609  0.0209792  -0.000657475  0.191496  ⋯
    - 4  │ -12946.5  5.93165  0.0767127  0.0343559  -0.00499478   0.191438  ⋯
    - 5  │ -12677.5  5.91938  0.0984593  0.0272951  -0.00555746   0.19247   ⋯
    - 6  │ -12869.7  5.96313  0.104457   0.0321632  -0.00719273   0.191751  ⋯
    - 7  │ -12478.1  5.9328   0.0947866  0.0409707  -0.00461589   0.193076  ⋯
    - 8  │ -12463.7  5.94439  0.0977165  0.0321098  -0.00625459   0.193115  ⋯
    - 9  │ -12836.2  5.9728   0.097135   0.0416619  6.11913e-5    0.191843  ⋯
    - 10 │ -12932.3  5.94709  0.0742452  0.0505274  -0.013146     0.191583  ⋯
    - 11 │ -12736.2  5.93625  0.0728171  0.0479427  -0.0183158    0.192193  ⋯
    - 12 │ -13048.0  5.89421  0.0680602  0.0481655  -0.0214151    0.191101  ⋯
    - 13 │ -13313.8  5.92608  0.0892319  0.0473893  -0.014168     0.190142  ⋯
    - 14 │ -12575.0  5.89235  0.0846171  0.0341531  -0.00613035   0.192728  ⋯
    - 15 │ -12833.1  5.94217  0.0774874  0.0422344  -0.00278949   0.191772  ⋯
    - 16 │ -12504.5  5.94385  0.0898019  0.0429787  -0.00705642   0.192833  ⋯
    - 17 │ -12875.5  5.96624  0.0976097  0.0370807  -0.00071883   0.191576  ⋯
    - 18 │ -13287.4  5.97493  0.101651   0.0407504  -0.0163219    0.190317  ⋯
    - 19 │ -13088.2  5.95426  0.101522   0.0342395  0.00229663    0.190991  ⋯
    - 20 │ -12820.6  5.92995  0.0775967  0.0394345  -0.0112548    0.191861  ⋯
    - 21 │ -12634.4  5.92989  0.0836736  0.0357487  -0.00206017   0.192456  ⋯
    - 22 │ -13097.6  5.92438  0.0888691  0.0332515  -0.00701295   0.191018  ⋯
    - 23 │ -12837.4  5.90782  0.0861053  0.0385012  -0.00752605   0.191891  ⋯
    + 1  │ -12802.3  5.93392  0.0864218  0.0488885  -0.0121833    0.192002  ⋯
    + 2  │ -12794.3  5.95776  0.0989839  0.0318746  -0.00666166   0.191977  ⋯
    + 3  │ -12930.6  5.93669  0.0885609  0.020979   -0.000657458  0.191496  ⋯
    + 4  │ -12946.5  5.93165  0.0767126  0.0343559  -0.00499472   0.191438  ⋯
    + 5  │ -12677.5  5.91938  0.0984597  0.0272948  -0.00555745   0.19247   ⋯
    + 6  │ -12869.7  5.96313  0.104457   0.0321634  -0.00719286   0.191751  ⋯
    + 7  │ -12478.1  5.9328   0.0947869  0.0409707  -0.00461601   0.193076  ⋯
    + 8  │ -12463.7  5.94439  0.0977165  0.0321098  -0.00625469   0.193115  ⋯
    + 9  │ -12836.2  5.9728   0.0971347  0.0416622  6.10495e-5    0.191843  ⋯
    + 10 │ -12932.3  5.94709  0.0742449  0.0505276  -0.013146     0.191583  ⋯
    + 11 │ -12736.2  5.93625  0.0728169  0.0479429  -0.0183157    0.192193  ⋯
    + 12 │ -13048.0  5.89421  0.0680605  0.0481654  -0.0214149    0.191101  ⋯
    + 13 │ -13313.8  5.92608  0.0892321  0.0473893  -0.014168     0.190142  ⋯
    + 14 │ -12575.0  5.89235  0.0846175  0.0341529  -0.0061302    0.192728  ⋯
    + 15 │ -12833.1  5.94217  0.0774872  0.0422346  -0.00278944   0.191772  ⋯
    + 16 │ -12504.5  5.94385  0.0898019  0.0429788  -0.00705651   0.192833  ⋯
    + 17 │ -12875.5  5.96624  0.0976096  0.0370809  -0.000719     0.191577  ⋯
    + 18 │ -13287.4  5.97493  0.101651   0.0407506  -0.016322     0.190317  ⋯
    + 19 │ -13088.2  5.95426  0.101523   0.0342395  0.00229645    0.190991  ⋯
    + 20 │ -12820.6  5.92995  0.0775966  0.0394345  -0.0112548    0.191861  ⋯
    + 21 │ -12634.4  5.92989  0.0836737  0.0357486  -0.00206012   0.192456  ⋯
    + 22 │ -13097.6  5.92438  0.0888692  0.0332515  -0.00701294   0.191018  ⋯
    + 23 │ -12837.4  5.90782  0.0861056  0.0385011  -0.00752595   0.191891  ⋯
      ⋮  │    ⋮         ⋮         ⋮          ⋮           ⋮           ⋮      ⋱
    @@ -1205,30 +1202,30 @@

    7.2 Shortest coverage interval

    The upper limit of the interval for the critical CP CTR: sod, CTR: dod is hitting the upper wall of a perfect correlation. This is evidence of singularity. The other intervals do not exhibit such pathologies; they appear to be ok.

    -
    +
    Code -
    confint(samp)
    +
    confint(samp)
    DictTable with 2 columns and 15 rows:
      par   lower       upper
      ────┬───────────────────────
      β1  │ 5.89917     5.97256
    - β2  │ 0.0719307   0.104588
    - β3  │ 0.025118    0.0491669
    - β4  │ -0.020718   0.00268306
    - ρ1  │ 0.243767    0.713091
    - ρ2  │ -0.919031   0.246975
    - ρ3  │ -0.643615   0.569417
    - ρ4  │ -0.138124   0.739276
    - ρ5  │ 0.576496    0.999995
    - ρ6  │ -0.894652   0.436061
    + β2  │ 0.071931    0.104589
    + β3  │ 0.0251181   0.049167
    + β4  │ -0.0207177  0.00268295
    + ρ1  │ 0.24377     0.712955
    + ρ2  │ -0.892234   0.263754
    + ρ3  │ -0.727028   0.505693
    + ρ4  │ -0.138041   0.739151
    + ρ5  │ 0.576378    0.999995
    + ρ6  │ -0.896241   0.438816
      σ   │ 0.19051     0.19359
    - σ1  │ 0.116564    0.16857
    - σ2  │ 0.045519    0.0708047
    - σ3  │ 0.00940216  0.0410695
    - σ4  │ 0.0133062   0.037595
    + σ1 │ 0.116563 0.168549 + σ2 │ 0.045499 0.0708029 + σ3 │ 0.00942641 0.0409754 + σ4 │ 0.014413 0.0386775

    @@ -1237,14 +1234,14 @@

    7.4 Residual

    -
    +
    Code -
    draw(
    -  data(tbl) *
    -  mapping(:σ => "Residual standard deviation") *
    -  density();
    -)
    +
    draw(
    +  data(tbl) *
    +  mapping(:σ => "Residual standard deviation") *
    +  density();
    +)
    @@ -1259,24 +1256,24 @@

    7.5 Fixed effects (w/o GM)

    The shortest coverage interval for the GM ranges from 376 to 404 ms. To keep the plot range small we do not inlcude its density here.

    -
    +
    Code -
    labels = [
    -  "CTR: sod" => "spatial effect",
    -  "CTR: dos" => "object effect",
    -  "CTR: dod" => "attraction effect",
    -  "(Intercept)" => "grand mean",
    -]
    -draw(
    -  data(tbl) *
    -  mapping(
    -    [:β2, :β3, :β4] .=> "Experimental effect size [ms]";
    -    color=dims(1) => renamer(["spatial", "object", "attraction"] .* " effect") =>
    -    "Experimental effects",
    -  ) *
    -  density();
    -)
    +
    labels = [
    +  "CTR: sod" => "spatial effect",
    +  "CTR: dos" => "object effect",
    +  "CTR: dod" => "attraction effect",
    +  "(Intercept)" => "grand mean",
    +]
    +draw(
    +  data(tbl) *
    +  mapping(
    +    [:β2, :β3, :β4] .=> "Experimental effect size [ms]";
    +    color=dims(1) => renamer(["spatial", "object", "attraction"] .* " effect") =>
    +    "Experimental effects",
    +  ) *
    +  density();
    +)
    @@ -1291,19 +1288,19 @@

    7.6 Variance components (VCs)

    -
    +
    Code -
    draw(
    -  data(tbl) *
    -  mapping(
    -    [:σ1, :σ2, :σ3, :σ4] .=> "Standard deviations [ms]";
    -    color=dims(1) => 
    -    renamer(append!(["Grand mean"],["spatial", "object", "attraction"] .* " effect")) =>
    -    "Variance components",
    -  ) *
    -  density();
    -)
    +
    draw(
    +  data(tbl) *
    +  mapping(
    +    [:σ1, :σ2, :σ3, :σ4] .=> "Standard deviations [ms]";
    +    color=dims(1) => 
    +    renamer(append!(["Grand mean"],["spatial", "object", "attraction"] .* " effect")) =>
    +    "Variance components",
    +  ) *
    +  density();
    +)
    @@ -1318,27 +1315,27 @@

    7.7 Correlation parameters (CPs)

    -
    +
    Code -
    let
    -  labels = [
    -    "(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(
    -      [:ρ1, :ρ2, :ρ3, :ρ4, :ρ5, :ρ6] .=> "Correlation";
    -      color=dims(1) => renamer(last.(labels)) => "Correlation parameters",
    -    ) *
    -    density();
    -  )
    -end
    +
    let
    +  labels = [
    +    "(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(
    +      [:ρ1, :ρ2, :ρ3, :ρ4, :ρ5, :ρ6] .=> "Correlation";
    +      color=dims(1) => renamer(last.(labels)) => "Correlation parameters",
    +    ) *
    +    density();
    +  )
    +end
    diff --git a/kwdyz11_files/figure-html/cell-13-output-1.png b/kwdyz11_files/figure-html/cell-13-output-1.png index 2fc7370..c10a7bf 100644 Binary files a/kwdyz11_files/figure-html/cell-13-output-1.png and b/kwdyz11_files/figure-html/cell-13-output-1.png differ diff --git a/kwdyz11_files/figure-html/fig-m1caterpillar-output-1.png b/kwdyz11_files/figure-html/fig-m1caterpillar-output-1.png index 6517bd7..09e3519 100644 Binary files a/kwdyz11_files/figure-html/fig-m1caterpillar-output-1.png and b/kwdyz11_files/figure-html/fig-m1caterpillar-output-1.png differ diff --git a/kwdyz11_files/figure-html/fig-m1corrdens-output-1.png b/kwdyz11_files/figure-html/fig-m1corrdens-output-1.png index 8c18774..6cbe8dc 100644 Binary files a/kwdyz11_files/figure-html/fig-m1corrdens-output-1.png and b/kwdyz11_files/figure-html/fig-m1corrdens-output-1.png differ diff --git a/kwdyz11_files/figure-html/fig-m1fixedeffdens-output-1.png b/kwdyz11_files/figure-html/fig-m1fixedeffdens-output-1.png index 09c50e5..ddf0863 100644 Binary files a/kwdyz11_files/figure-html/fig-m1fixedeffdens-output-1.png and b/kwdyz11_files/figure-html/fig-m1fixedeffdens-output-1.png differ diff --git a/kwdyz11_files/figure-html/fig-m1shrinkage-output-1.png b/kwdyz11_files/figure-html/fig-m1shrinkage-output-1.png index 3f74737..19b0cb3 100644 Binary files a/kwdyz11_files/figure-html/fig-m1shrinkage-output-1.png and b/kwdyz11_files/figure-html/fig-m1shrinkage-output-1.png differ diff --git a/kwdyz11_files/figure-html/fig-m1varcompdens-output-1.png b/kwdyz11_files/figure-html/fig-m1varcompdens-output-1.png index 071c7ae..f393b99 100644 Binary files a/kwdyz11_files/figure-html/fig-m1varcompdens-output-1.png and b/kwdyz11_files/figure-html/fig-m1varcompdens-output-1.png differ diff --git a/kwdyz11_files/figure-html/fig-residstddevdens-output-1.png b/kwdyz11_files/figure-html/fig-residstddevdens-output-1.png index 0582392..d795097 100644 Binary files a/kwdyz11_files/figure-html/fig-residstddevdens-output-1.png and b/kwdyz11_files/figure-html/fig-residstddevdens-output-1.png differ diff --git a/kwdyz11_files/figure-html/fig-resvsfittedhm-output-1.png b/kwdyz11_files/figure-html/fig-resvsfittedhm-output-1.png index 9c90c08..3ab5c70 100644 Binary files a/kwdyz11_files/figure-html/fig-resvsfittedhm-output-1.png and b/kwdyz11_files/figure-html/fig-resvsfittedhm-output-1.png differ diff --git a/kwdyz11_files/figure-html/fig-resvsfittedm1-output-1.png b/kwdyz11_files/figure-html/fig-resvsfittedm1-output-1.png index b085477..8ede46b 100644 Binary files a/kwdyz11_files/figure-html/fig-resvsfittedm1-output-1.png and b/kwdyz11_files/figure-html/fig-resvsfittedm1-output-1.png differ diff --git a/kwdyz11_files/figure-html/fig-standresdens-output-1.png b/kwdyz11_files/figure-html/fig-standresdens-output-1.png index c8637f5..6c3a013 100644 Binary files a/kwdyz11_files/figure-html/fig-standresdens-output-1.png and b/kwdyz11_files/figure-html/fig-standresdens-output-1.png differ diff --git a/largescaledesigned.html b/largescaledesigned.html index 27c4335..7f570b4 100644 --- a/largescaledesigned.html +++ b/largescaledesigned.html @@ -386,7 +386,7 @@

    A large-scale designed experiment

    Load the packages to be used.

    -
    +
    Code
    using AlgebraOfGraphics
    @@ -428,7 +428,7 @@ 

    1 Extracting data

    1.1 Trial-level data from the LDT

    In the lexical decision task the study participant is shown a character string, under carefully controlled conditions, and responds according to whether they identify the string as a word or not. Two responses are recorded: whether the choice of word/non-word is correct and the time that elapsed between exposure to the string and registering a decision.

    Several covariates, some relating to the subject and some relating to the target, were recorded. Initially we consider only the trial-level data.

    -
    +
    ldttrial = dataset(:ELP_ldt_trial)
    Arrow.Table with 2745952 rows, 5 columns, and schema:
    @@ -447,7 +447,7 @@ 

    +
    ldttrial = @transform(DataFrame(ldttrial), :s2 = :seq > 2000)
     describe(ldttrial)
    @@ -550,7 +550,7 @@

    1.2.1 Summaries by item

    To summarize by item we group the trials by item and use combine to produce the various summary statistics. As we will create similar summaries by subject, we incorporate an ‘i’ in the names of these summaries (and an ‘s’ in the name of the summaries by subject) to be able to identify the grouping used.

    -
    +
    byitem = @chain ldttrial begin
       groupby(:item)
       @combine(
    @@ -856,7 +856,7 @@ 

    It can be seen that the items occur in word/nonword pairs and the pairs are sorted alphabetically by the word in the pair (ignoring case). We can add the word/nonword status for the items as

    -
    +
    byitem.isword = isodd.(eachindex(byitem.item))
     describe(byitem)
    @@ -971,7 +971,7 @@

    This table shows that some of the items were never identified correctly. These are

    -
    +
    filter(:iacc => iszero, byitem)
    9×8 DataFrame
    @@ -1107,7 +1107,7 @@

    Notice that these are all words but somewhat obscure words such that none of the subjects exposed to the word identified it correctly.

    We can incorporate characteristics like wrdlen and isword back into the original trial table with a “left join”. This operation joins two tables by values in a common column. It is called a left join because the left (or first) table takes precedence, in the sense that every row in the left table is present in the result. If there is no matching row in the second table then missing values are inserted for the columns from the right table in the result.

    -
    +
    describe(
       leftjoin!(
         ldttrial,
    @@ -1228,7 +1228,7 @@ 

    Notice that the wrdlen and isword variables in this table allow for missing values, because they are derived from the second argument, but there are no missing values for these variables. If there is no need to allow for missing values, there is a slight advantage in disallowing them in the element type, because the code to check for and handle missing values is not needed.

    This could be done separately for each column or for the whole data frame, as in

    -
    +
    describe(disallowmissing!(ldttrial; error=false))
    8×7 DataFrame
    @@ -1358,7 +1358,7 @@

    A barchart of the word length counts, Figure 1, shows that the majority of the items are between 3 and 14 characters.

    -
    +
    Code
    let
    @@ -1380,7 +1380,7 @@ 

    To examine trends in accuracy by word length we plot the proportion accurate versus word-length separately for words and non-words with the area of each marker proportional to the number of observations for that combination (Figure 2).

    -
    +
    Code
    let
    @@ -1420,7 +1420,7 @@ 

    1.2.2 Summaries by subject

    A summary of accuracy and median response time by subject

    -
    +
    bysubj = @chain ldttrial begin
       groupby(:subj)
       @combine(
    @@ -1695,7 +1695,7 @@ 

    shows some anomalies

    -
    +
    describe(bysubj)
    6×7 DataFrame
    @@ -1789,7 +1789,7 @@

    First, some subjects are accurate on only about half of their trials, which is the proportion that would be expected from random guessing. A plot of the median response time versus proportion accurate, Figure 3, shows that the subjects with lower accuracy are some of the fastest responders, further indicating that these subjects are sacrificing accuracy for speed.

    -
    +
    Code
    draw(
    @@ -1812,14 +1812,14 @@ 

    As described in Balota et al. (2007), the participants performed the trials in blocks of 250 followed by a short break. During the break they were given feedback concerning accuracy and response latency in the previous block of trials. If the accuracy was less than 80% the participant was encouraged to improve their accuracy. Similarly, if the mean response latency was greater than 1000 ms, the participant was encouraged to decrease their response time. During the trials immediate feedback was given if the response was incorrect.

    Nevertheless, approximately 15% of the subjects were unable to maintain 80% accuracy on their trials

    -
    +
    count(<(0.8), bysubj.spropacc) / nrow(bysubj)
    0.15233415233415235

    and there is some association of faster response times with low accuracy. The majority of the subjects whose median response time is less than 500 ms. are accurate on less than 75% of their trials. Another way of characterizing the relationship is that none of the subjects with 90% accuracy or greater had a median response time less than 500 ms.

    -
    +
    minimum(@subset(bysubj, :spropacc > 0.9).smedianrt)
    505.0
    @@ -1828,7 +1828,7 @@

    It is common in analyses of response latency in a lexical discrimination task to consider only the latencies on correct identifications and to trim outliers. In Balota et al. (2007) a two-stage outlier removal strategy was used; first removing responses less than 200 ms or greater than 3000 ms then removing responses more than three standard deviations from the participant’s mean response.

    As described in Section 1.2.3 we will analyze these data on a speed scale (the inverse of response time) using only the first-stage outlier removal of response latencies less than 200 ms or greater than 3000 ms. On the speed scale the limits are 0.333 per second up to 5 per second.

    To examine the effects of the fast but inaccurate responders we will fit models to the data from all the participants and to the data from the 85% of participants who maintained an overall accuracy of 80% or greater.

    -
    +
    pruned = @chain ldttrial begin
       @subset(!ismissing(:acc), 200  :rt  3000,)
       leftjoin!(select(bysubj, :subj, :spropacc); on=:subj)
    @@ -1839,7 +1839,7 @@ 

    (2714311, 9)

    -
    +
    describe(pruned)
    9×7 DataFrame
    @@ -1967,7 +1967,7 @@

    1.2.3 Choice of response scale

    As we have indicated, generally the response times are analyzed for the correct identifications only. Furthermore, unrealistically large or small response times are eliminated. For this example we only use the responses between 200 and 3000 ms.

    A density plot of the pruned response times, Figure 4, shows they are skewed to the right.

    -
    +
    Code
    draw(
    @@ -1988,7 +1988,7 @@ 

    In such cases it is common to transform the response to a scale such as the logarithm of the response time or to the speed of the response, which is the inverse of the response time.

    The density of the response speed, in responses per second, is shown in Figure 5.

    -
    +
    Code
    draw(
    @@ -2009,7 +2009,7 @@ 

    Figure 4 and Figure 5 indicate that it may be more reasonable to establish a lower bound of 1/3 second (333 ms) on the response latency, corresponding to an upper bound of 3 per second on the response speed. However, only about one half of one percent of the correct responses have latencies in the range of 200 ms. to 333 ms.

    -
    +
    count(
       r -> !ismissing(r.acc) && 200 < r.rt < 333,
       eachrow(ldttrial),
    @@ -2041,7 +2041,7 @@ 

    1.2.4 Transformation of response and the form of the model

    As noted in Box & Cox (1964), a transformation of the response that produces a more Gaussian distribution often will also produce a simpler model structure. For example, Figure 6 shows the smoothed relationship between word length and response time for words and non-words separately,

    -
    +
    Code
    draw(
    @@ -2063,7 +2063,7 @@ 

    Figure 7 shows the similar relationships for speed

    -
    +
    Code
    draw(
    @@ -2086,7 +2086,7 @@ 

    Figure 7 are reasonably straight. The small amount of curvature is associated with short word lengths, say less than 4 characters, of which there are comparatively few in the study.

    Figure 8 shows a “violin plot” - the empirical density of the response speed by word length separately for words and nonwords. The lines on the plot are fit by linear regression.

    -
    +
    Code
    let
    @@ -2123,7 +2123,7 @@ 

    +
    contrasts = Dict(
       :subj => Grouping(),
       :item => Grouping(),
    @@ -2139,7 +2139,7 @@ 

    +
    elm01 = let
       form = @formula(
         1000 / rt ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)
    @@ -2147,7 +2147,7 @@ 

    fit(MixedModel, form, pruned; contrasts) end

    -
    Minimizing 53    Time: 0:00:06 ( 0.13  s/it)
    +
    Minimizing 53    Time: 0:00:03 (68.13 ms/it)
    @@ -2222,7 +2222,7 @@

    +
    effects(Dict(:isword => [false, true], :wrdlen => 4:2:12), elm01)
    10×6 DataFrame
    @@ -2344,7 +2344,7 @@

    +
    elm02 = let
       form = @formula(
         1000 / rt ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)
    @@ -2353,7 +2353,7 @@ 

    fit(MixedModel, form, dat; contrasts) end

    -
    Minimizing 53    Time: 0:00:04 (83.11 ms/it)
    +
    Minimizing 72    Time: 0:00:03 (45.03 ms/it)

    @@ -2427,7 +2427,7 @@

    +
    effects(Dict(:isword => [false, true], :wrdlen => 4:2:12), elm02)
    10×6 DataFrame
    @@ -2458,7 +2458,7 @@

    4

    - + @@ -2467,7 +2467,7 @@

    6

    - + @@ -2476,7 +2476,7 @@

    8

    - + @@ -2485,7 +2485,7 @@

    10

    - + @@ -2494,7 +2494,7 @@

    12

    - + @@ -2503,7 +2503,7 @@

    4

    - + @@ -2512,7 +2512,7 @@

    6

    - + @@ -2521,7 +2521,7 @@

    8

    - + @@ -2530,7 +2530,7 @@

    10

    - + @@ -2539,7 +2539,7 @@

    12

    - + @@ -2550,7 +2550,7 @@

    +
    Code
    CairoMakie.activate!(; type="png")
    @@ -2608,7 +2608,7 @@ 

    Figure 9 is exactly of the form that would be expected in a sample from a correlated multivariate Gaussian distribution. The correlation of the two sets of conditional means is about 96%.

    -
    +
    cor(Matrix(select(byitem, :elm01, :elm02)))
    2×2 Matrix{Float64}:
    @@ -2618,10 +2618,10 @@ 

    +
    saveoptsum("./fits/elm01.json", elm01);
    -
    +
    elm01a = restoreoptsum!(
       let
         form = @formula(
    @@ -2704,7 +2704,7 @@ 

    +
    elpldtitem = DataFrame(dataset("ELP_ldt_item"))
     describe(elpldtitem)
    @@ -2829,7 +2829,7 @@

    +
    elpldtsubj = DataFrame(dataset("ELP_ldt_subj"))
     describe(elpldtsubj)
    @@ -3064,7 +3064,7 @@

    Figure 10,

    -
    +
    Code
    qqcaterpillar!(
    @@ -3083,7 +3083,7 @@ 

    Figure 11 is the corresponding caterpillar plot for model elm02 fit to the data with inaccurate responders eliminated.

    -
    +
    Code
    qqcaterpillar!(
    @@ -3107,7 +3107,7 @@ 

    +
    itemextended = leftjoin(
       byitem,
       select(elpldtitem, 1:5);
    @@ -3522,7 +3522,7 @@ 

    Figure 12, there does not seem to be a strong relationship between vocabulary age and speed of response by subject.

    -
    +
    Code
    draw(
    @@ -3543,7 +3543,7 @@ 

    +
    Code
    draw(
    @@ -3563,7 +3563,7 @@ 

    +
    Code
    draw(
    @@ -3583,7 +3583,7 @@ 

    +
    Code
    CairoMakie.activate!(; type="png")
    diff --git a/largescaledesigned_files/figure-html/fig-elm01bgmean-output-1.png b/largescaledesigned_files/figure-html/fig-elm01bgmean-output-1.png
    index 74f730a..03bb010 100644
    Binary files a/largescaledesigned_files/figure-html/fig-elm01bgmean-output-1.png and b/largescaledesigned_files/figure-html/fig-elm01bgmean-output-1.png differ
    diff --git a/largescaledesigned_files/figure-html/fig-elm02caterpillarsubj-output-1.svg b/largescaledesigned_files/figure-html/fig-elm02caterpillarsubj-output-1.svg
    index 76969c6..64f757d 100644
    --- a/largescaledesigned_files/figure-html/fig-elm02caterpillarsubj-output-1.svg
    +++ b/largescaledesigned_files/figure-html/fig-elm02caterpillarsubj-output-1.svg
    @@ -2,105 +2,105 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -110,79 +110,79 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -2623,7 +2623,7 @@
     
     
     
    -
    +
     
     
     
    diff --git a/largescaledesigned_files/figure-html/fig-elm02univ-output-1.svg b/largescaledesigned_files/figure-html/fig-elm02univ-output-1.svg
    index c2d7813..cdb16fa 100644
    --- a/largescaledesigned_files/figure-html/fig-elm02univ-output-1.svg
    +++ b/largescaledesigned_files/figure-html/fig-elm02univ-output-1.svg
    @@ -2,402 +2,402 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -409,266 +409,266 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
     
     
     
    @@ -691,211 +691,211 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    diff --git a/largescaledesigned_files/figure-html/fig-itemreelm01vselm02-output-1.png b/largescaledesigned_files/figure-html/fig-itemreelm01vselm02-output-1.png
    index 115cf65..3c74858 100644
    Binary files a/largescaledesigned_files/figure-html/fig-itemreelm01vselm02-output-1.png and b/largescaledesigned_files/figure-html/fig-itemreelm01vselm02-output-1.png differ
    diff --git a/largescaledesigned_files/figure-html/fig-ldtmedianrtvspropacc-output-1.svg b/largescaledesigned_files/figure-html/fig-ldtmedianrtvspropacc-output-1.svg
    index cac28b5..13bede4 100644
    --- a/largescaledesigned_files/figure-html/fig-ldtmedianrtvspropacc-output-1.svg
    +++ b/largescaledesigned_files/figure-html/fig-ldtmedianrtvspropacc-output-1.svg
    @@ -2,237 +2,237 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -244,214 +244,214 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -1267,7 +1267,7 @@
     
     
     
    -
    +
     
     
     
    diff --git a/largescaledesigned_files/figure-html/fig-ldtrtvswrdlen-output-1.svg b/largescaledesigned_files/figure-html/fig-ldtrtvswrdlen-output-1.svg
    index c78d21a..f132c72 100644
    --- a/largescaledesigned_files/figure-html/fig-ldtrtvswrdlen-output-1.svg
    +++ b/largescaledesigned_files/figure-html/fig-ldtrtvswrdlen-output-1.svg
    @@ -2,222 +2,249 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    +
     
     
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -225,224 +252,224 @@
     
     
     
    -
    -
    -
    -
    +
    +
    +
    +
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
    -
    -
    +
    +
     
     
     
     
     
     
    -
    -
    -
    -
    +
    +
    +
    +
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    diff --git a/largescaledesigned_files/figure-html/fig-ldtspeedvswrdlen-output-1.svg b/largescaledesigned_files/figure-html/fig-ldtspeedvswrdlen-output-1.svg
    index 70c8cbb..dfce893 100644
    --- a/largescaledesigned_files/figure-html/fig-ldtspeedvswrdlen-output-1.svg
    +++ b/largescaledesigned_files/figure-html/fig-ldtspeedvswrdlen-output-1.svg
    @@ -2,261 +2,249 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +
     
     
    -
    -
    -
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    +
    +
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -264,241 +252,241 @@
     
     
     
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
    -
    -
    +
    +
     
     
     
     
     
     
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    diff --git a/pkg.html b/pkg.html
    index cf30a8b..de049cf 100644
    --- a/pkg.html
    +++ b/pkg.html
    @@ -353,16 +353,16 @@ 

    Package management and reproducible environments

    Julius Krumbiegel also has a great blog post with more details on Julia environments.

    Julia packages can be configured (in a file called Project.toml) on a per-project basis. The packaged sources and compiled versions are stored in a central location, e.g. ~/.julia/packages and ~/.julia/compiled on Linux systems, but the configuration of packages to be used can be local to a project. The Pkg package is used to modify the local project’s configuration. (An alternative is “package mode” in the read-eval-print-loop or REPL, which we will show at the summer school.) Start julia in the directory of the cloned SMLP2023 repository

    -
    +
    using Pkg        # there's a package called 'Pkg' to manipulate package configs
     Pkg.activate(".")# activate the current directory as the project

    If you’ve received an environment from someone/somewhere else – such as this course repository – then you’ll need to first “instantiate” it (i.e., install all the dependencies).

    -
    +
    Pkg.instantiate()# only needed the first time you work in a project
     Pkg.update()     # get the latest package versions compatible with the project
    -
    +
    Pkg.status()

    Occasionally the Pkg.status function call will give info about new versions being available but blocked by requirements of other packages. This is to be expected - the package system is large and the web of dependencies are complex. Generally the Julia package system is very good at resolving dependencies.

    diff --git a/profiling.html b/profiling.html index 7f5dd85..6d7faec 100644 --- a/profiling.html +++ b/profiling.html @@ -374,7 +374,7 @@

    1 Assessing the v

    1.1 Profiling a model for the kb07 data

    Load the packages to be used

    -
    +
    Code
    using AlgebraOfGraphics
    @@ -390,7 +390,7 @@ 

    +
    contrasts = Dict( # base levels so estimates for speed are positive
       :load => EffectsCoding(; base="yes"),
       :prec => EffectsCoding(; base="break"),
    @@ -428,14 +428,14 @@ 

    +
    pr01 = let f = @formula 1000 / rt_raw ~
         1 + load + spkr + prec + (1 + prec | item) + (1 | subj)
       profile(fit(MixedModel, f, kb07; contrasts))
     end
     println(pr01.m) # model is a property of the profile object
    -
    Minimizing 67    Time: 0:00:00 ( 9.68 ms/it)
    +
    Minimizing 67    Time: 0:00:00 ( 5.92 ms/it)
    Linear mixed model fit by maximum likelihood
    @@ -467,7 +467,7 @@ 

    1.2 Fixing values of parameters

    The information from the profile is encapsulated in a table.

    -
    +
    pr01.tbl
    Table with 15 columns and 249 rows:
    @@ -491,17 +491,17 @@ 

    \(\sigma\), as shown in the p column. In the next set of rows the parameter being held fixed will be \(\beta_1\), the intercept.

    There are blocks of rows for the fixed-effects (\(\boldsymbol{\beta}\)) parameters, the variance components (on the scale of a standard deviation), and the \(\boldsymbol{\theta}\) parameters that generate the covariance factor \(\boldsymbol{\Lambda}_{\boldsymbol{\theta}}\). (At present the correlation parameters are not profiled - we may add them later but that computation is rather awkward.)

    -
    +
    show(unique(pr01.tbl.p))
    [:σ, :β1, :β2, :β3, :β4, :θ1, :θ2, :θ3, :θ4, :σ1, :σ2, :σ3]
    @@ -509,7 +509,7 @@

    \(\sigma=0.130088\), instead of the global estimate \(\hat{\sigma}=0.139458\) in the row for which \(\zeta=0.0\).

    The global estimates are included in every block at the row for which \(\zeta=0.0\).

    -
    +
    filter(r -> iszero(r.ζ), pr01.tbl)
    Table with 15 columns and 12 rows:
    @@ -542,7 +542,7 @@ 

    1.3 Profile zeta plots

    Figure 1 shows, for each of the fixed effects parameters, \(\zeta\) versus the parameter value.

    -
    +
    Code
    zetaplot!(Figure(; resolution=(1200, 350)), pr01; ptyp='β')
    @@ -559,7 +559,7 @@

    The lines on these panels are read like normal probability plots, i.e. QQ plots against a standard normal distribution. Those on the \(\beta_2\) and \(\beta_3\) panels are, to the resolution of the plot, straight lines which indicates that the estimators of those parameters are normally distributed over the region of interest.

    The points in the \(\beta_1\) and \(\beta_4\) panels are slightly over-dispersed relative to the straight line, which means that the estimators of these parameters are distributed like a T-distribution with a moderate number of degrees of freedom.

    The profile-\(\zeta\) function can be used to generate confidence intervals on the parameters

    -
    +
    confint(pr01)
    DictTable with 3 columns and 8 rows:
    @@ -567,7 +567,7 @@ 

    as shown in Figure 2, which shows the absolute value of \(\zeta\), which is simply the square root of the difference in the objective, versus the parameter being profiled.

    -
    +
    Code
    zetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='β', absv=true)
    @@ -591,7 +591,7 @@

    The 95% confidence intervals are the second horizontal lines from the top in each panel, at 1.96 on the vertical scale.

    -
    +
    Code
    zetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='σ', absv=true)
    @@ -606,7 +606,7 @@

    Figure 3 shows similar confidence intervals on the parameters representing standard deviations as does Figure 4 for the \(\theta\) parameters.

    -
    +
    Code
    zetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='θ', absv=true)
    @@ -633,7 +633,7 @@

    2 Comparisons wit

    The main advantage of the bootstrap is that any parameter or any function of the parameters, such as the predicted response at some setting of the experimental factors, can be evaluated and assessed from the sample. When doing so, however, it is necessary to work with large samples so as to avoid undesirable levels of sample re-use.

    Because profiling different parameters requires customized code for each parameter type, it is more difficult to generalize this approach to different types of parameters or predictions. We have already mentioned that the correlation parameters are not profiled in the current version of the code.

    For comparison with the profiling results, we create a table of 2500 bootstrap samples

    -
    +
    Random.seed!(8765678)
     samp01 = parametricbootstrap(2500, pr01.m; optsum_overrides=(; ftol_rel=1e-8))
     confint(samp01)
    @@ -644,9 +644,9 @@

    2 Comparisons wit β1 │ 0.497384 0.562267 β2 │ 0.0147172 0.0274258 β3 │ 0.00481004 0.0169282 - β4 │ 0.0524409 0.0857707 - ρ1 │ -0.557298 0.203936 - σ │ 0.134749 0.144354 + β4 │ 0.0524409 0.0857708 + ρ1 │ -0.557298 0.203915 + σ │ 0.134745 0.144354 σ1 │ 0.0587605 0.0986167 σ2 │ 0.0316134 0.0571327 σ3 │ 0.05724 0.087862

    @@ -654,7 +654,7 @@

    2 Comparisons wit

    Comparing these intervals with those from the profile results shows that the intervals on the fixed-effects parameters from the two methods are quite similar. The intervals on \(\sigma\) from the two methods are quite similar but the bootstrap intervals on the other variance components are shifted to the left relative to those from the profiling results. The reason for this is because the bootstrap intervals are chosen to be the shortest intervals with the desired coverage. In a density that is skewed to the right, as these are, the shortest interval will be to the left of an interval with equal tail coverage, which is how the profile-based intervals are constructed.

    The profile-\(\zeta\) function can be transformed to an equivalent density function which we plot in Figure 5, showing the skewness of the variance component parameters other than \(\sigma\).

    -
    +
    Code
    profiledensity!(Figure(; resolution=(1200, 300)), pr01; share_y_scale=false)
    @@ -669,7 +669,7 @@

    2 Comparisons wit

    Alternatively we can see the skewness in the plots of \(\zeta\)

    -
    +
    Code
    zetaplot!(Figure(; resolution=(1100, 330)), pr01; ptyp='σ')
    @@ -684,7 +684,7 @@

    2 Comparisons wit

    The skewness is less obvious in Figure 7 because of the stochastic nature of the bootstrap sample and the kernel density estimators.

    -
    +
    Code
    let pars=["σ", "σ1", "σ2", "σ3"]
    diff --git a/profiling_files/figure-html/fig-kb07abszetabeta-output-1.svg b/profiling_files/figure-html/fig-kb07abszetabeta-output-1.svg
    index e3eff58..1b0ea1d 100644
    --- a/profiling_files/figure-html/fig-kb07abszetabeta-output-1.svg
    +++ b/profiling_files/figure-html/fig-kb07abszetabeta-output-1.svg
    @@ -2,189 +2,189 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    +
     
     
    -
    -
    +
    +
     
    -
    -
    +
    +
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    -
    +
    +
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -220,88 +220,88 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -310,70 +310,70 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -382,70 +382,70 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -454,72 +454,72 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
    -
    +
     
     
     
    diff --git a/profiling_files/figure-html/fig-kb07abszetasigma-output-1.svg b/profiling_files/figure-html/fig-kb07abszetasigma-output-1.svg
    index 2449596..c54395a 100644
    --- a/profiling_files/figure-html/fig-kb07abszetasigma-output-1.svg
    +++ b/profiling_files/figure-html/fig-kb07abszetasigma-output-1.svg
    @@ -2,189 +2,189 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -219,70 +219,70 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -291,46 +291,46 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -339,70 +339,70 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -411,72 +411,72 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
    -
    +
     
     
     
    diff --git a/profiling_files/figure-html/fig-kb07abszetatheta-output-1.svg b/profiling_files/figure-html/fig-kb07abszetatheta-output-1.svg
    index 0dc12d1..cebc53d 100644
    --- a/profiling_files/figure-html/fig-kb07abszetatheta-output-1.svg
    +++ b/profiling_files/figure-html/fig-kb07abszetatheta-output-1.svg
    @@ -2,183 +2,186 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    +
    +
    +
    +
    +
     
    -
    +
     
     
    -
    -
    +
    +
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -214,73 +217,73 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -289,52 +292,52 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -343,46 +346,46 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -391,46 +394,46 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    diff --git a/profiling_files/figure-html/fig-kb07bskdesigma-output-1.svg b/profiling_files/figure-html/fig-kb07bskdesigma-output-1.svg
    index 0126104..47f4a9a 100644
    --- a/profiling_files/figure-html/fig-kb07bskdesigma-output-1.svg
    +++ b/profiling_files/figure-html/fig-kb07bskdesigma-output-1.svg
    @@ -2,346 +2,343 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
    -
    -
    +
    +
     
     
    -
    -
    -
    +
    +
    +
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    +
    +
     
    -
    -
    +
    +
     
     
    -
    -
    -
    +
    +
    +
     
     
     
    @@ -351,25 +348,25 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    diff --git a/profiling_files/figure-html/fig-kb07densigma-output-1.svg b/profiling_files/figure-html/fig-kb07densigma-output-1.svg
    index 8c10d3e..62fb97b 100644
    --- a/profiling_files/figure-html/fig-kb07densigma-output-1.svg
    +++ b/profiling_files/figure-html/fig-kb07densigma-output-1.svg
    @@ -2,300 +2,282 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
     
    -
    +
     
     
     
    @@ -319,7 +301,7 @@
     
     
     
    -
    +
     
     
     
    @@ -341,423 +323,423 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
    -
    +
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
    -
    +
     
     
     
    @@ -776,7 +758,7 @@
     
     
     
    -
    +
     
     
     
    diff --git a/profiling_files/figure-html/fig-kb07zetabeta-output-1.svg b/profiling_files/figure-html/fig-kb07zetabeta-output-1.svg
    index 944dbd5..60c1dc7 100644
    --- a/profiling_files/figure-html/fig-kb07zetabeta-output-1.svg
    +++ b/profiling_files/figure-html/fig-kb07zetabeta-output-1.svg
    @@ -2,186 +2,189 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
    +
    +
    +
     
     
    -
    -
    +
    +
     
    -
    -
    +
    +
     
    -
    +
     
     
    -
    +
    +
    +
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    -
    -
    -
    -
    -
     
    -
    +
       
     
    -
    +
       
     
    -
    +
       
     
    -
    +
       
     
     
    -
    +
     
     
     
    @@ -225,94 +228,94 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -326,74 +329,74 @@
     
     
     
    -
    +
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -407,74 +410,74 @@
     
     
     
    -
    +
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -488,74 +491,74 @@
     
     
     
    -
    +
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -569,7 +572,7 @@
     
     
     
    -
    +
     
     
     
    diff --git a/profiling_files/figure-html/fig-kb07zetasigma-output-1.svg b/profiling_files/figure-html/fig-kb07zetasigma-output-1.svg
    index 090bcc2..9c56c68 100644
    --- a/profiling_files/figure-html/fig-kb07zetasigma-output-1.svg
    +++ b/profiling_files/figure-html/fig-kb07zetasigma-output-1.svg
    @@ -2,207 +2,207 @@
     
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
    -
    +
     
     
     
    -
    +
       
     
    -
    +
       
     
    -
    +
       
     
    -
    +
       
     
     
    -
    +
     
     
     
    @@ -245,76 +245,76 @@
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -328,50 +328,50 @@
     
     
     
    -
    +
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -385,74 +385,74 @@
     
     
     
    -
    -
    +
    +
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -466,74 +466,74 @@
     
     
     
    -
    +
     
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
    -  
    +  
     
     
     
    @@ -546,7 +546,7 @@
     
     
     
    -
    +
     
     
     
    diff --git a/search.json b/search.json
    index 51235cc..5541e69 100644
    --- a/search.json
    +++ b/search.json
    @@ -95,7 +95,7 @@
         "href": "sleepstudy.html",
         "title": "Analysis of the sleepstudy data",
         "section": "",
    -    "text": "The sleepstudy data are from a study of the effects of sleep deprivation on response time reported in Balkin et al. (2000) and in Belenky et al. (2003). Eighteen subjects were allowed only 3 hours of time to sleep each night for 9 successive nights. Their reaction time was measured each day, starting the day before the first night of sleep deprivation, when the subjects were on their regular sleep schedule.\n\n\n\n\n\n\nNote\n\n\n\nThis description is inaccurate. In fact the first two days were acclimatization, the third was a baseline and sleep deprivation was only enforced after day 2. To allow for comparison with earlier analyses of these data we retain the old data description for this notebook only.\n\n\n\n1 Loading the data\nFirst attach the MixedModels package and other packages for plotting. The CairoMakie package allows the Makie graphics system (Danisch & Krumbiegel, 2021) to generate high quality static images. Activate that package with the SVG (Scalable Vector Graphics) backend.\n\n\nCode\nusing CairoMakie       # graphics back-end\nusing DataFrames\nusing KernelDensity    # density estimation\nusing MixedModels\nusing MixedModelsMakie # diagnostic plots\nusing ProgressMeter\nusing Random           # random number generators\nusing RCall            # call R from Julia\nusing SMLP2023\nusing SMLP2023: dataset\n\nProgressMeter.ijulia_behavior(:clear)\nCairoMakie.activate!(; type=\"svg\")\n\n\nThe sleepstudy data are one of the datasets available with the MixedModels package. It is re-exported by the SMLP2023 package’s dataset function.\n\nsleepstudy = dataset(\"sleepstudy\")\n\nArrow.Table with 180 rows, 3 columns, and schema:\n :subj      String\n :days      Int8\n :reaction  Float64\n\n\nFigure 1 displays the data in a multi-panel plot created with the lattice package in R (Sarkar, 2008), using RCall.jl.\n\n\nCode\nRCall.ijulia_setdevice(MIME(\"image/svg+xml\"); width=10, height=4.5)\nR\"\"\"\nrequire(\"lattice\", quietly=TRUE)\nprint(xyplot(reaction ~ days | subj,\n  $(DataFrame(sleepstudy)),\n  aspect=\"xy\",\n  layout=c(9,2),\n  type=c(\"g\", \"p\", \"r\"),\n  index.cond=function(x,y) coef(lm(y ~ x))[1],\n  xlab = \"Days of sleep deprivation\",\n  ylab = \"Average reaction time (ms)\"\n))\n\"\"\";\n\n\n\n\n\nFigure 1: Average response time versus days of sleep deprivation by subject\n\n\n\n\nEach panel shows the data from one subject and a line fit by least squares to that subject’s data. Starting at the lower left panel and proceeding across rows, the panels are ordered by increasing intercept of the least squares line.\nThere are some deviations from linearity within the panels but the deviations are neither substantial nor systematic.\n\n\n2 Fitting an initial model\n\ncontrasts = Dict{Symbol,Any}(:subj => Grouping())\nm1 = let f = @formula(reaction ~ 1 + days + (1 + days | subj))\n  fit(MixedModel, f, sleepstudy; contrasts)\nend\n\nMinimizing 57    Time: 0:00:00 ( 4.14 ms/it)\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\n\n\n\n\n(Intercept)\n251.4051\n6.6323\n37.91\n<1e-99\n23.7805\n\n\ndays\n10.4673\n1.5022\n6.97\n<1e-11\n5.7168\n\n\nResidual\n25.5918\n\n\n\n\n\n\n\n\n\nThis model includes fixed effects for the intercept, representing the typical reaction time at the beginning of the experiment with zero days of sleep deprivation, and the slope w.r.t. days of sleep deprivation. The parameter estimates are about 250 ms. typical reaction time without deprivation and a typical increase of 10.5 ms. per day of sleep deprivation.\nThe random effects represent shifts from the typical behavior for each subject. The shift in the intercept has a standard deviation of about 24 ms. which would suggest a range of about 200 ms. to 300 ms. in the intercepts. Similarly within-subject slopes would be expected to have a range of about 0 ms./day up to 20 ms./day.\nThe random effects for the slope and for the intercept are allowed to be correlated within subject. The estimated correlation, 0.08, is small. This estimate is not shown in the default display above but is shown in the output from VarCorr (variance components and correlations).\n\nVarCorr(m1)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nsubj\n(Intercept)\n565.51066\n23.78047\n\n\n\n\ndays\n32.68212\n5.71683\n+0.08\n\n\nResidual\n\n654.94145\n25.59182\n\n\n\n\n\n\nTechnically, the random effects for each subject are unobserved random variables and are not “parameters” in the model per se. Hence we do not report standard errors or confidence intervals for these deviations. However, we can produce prediction intervals on the random effects for each subject. Because the experimental design is balanced, these intervals will have the same width for all subjects.\nA plot of the prediction intervals versus the level of the grouping factor (subj, in this case) is sometimes called a caterpillar plot because it can look like a fuzzy caterpillar if there are many levels of the grouping factor. By default, the levels of the grouping factor are sorted by increasing value of the first random effect.\n\n\nCode\ncaterpillar(m1; vline_at_zero=true)\n\n\n\n\n\nFigure 2: Prediction intervals on random effects for model m1\n\n\n\n\nFigure 2 reinforces the conclusion that there is little correlation between the random effect for intercept and the random effect for slope.\n\n\n3 A model with uncorrelated random effects\nThe zerocorr function applied to a random-effects term creates uncorrelated vector-valued per-subject random effects.\n\nm2 = let f = @formula reaction ~ 1 + days + zerocorr(1 + days | subj)\n  fit(MixedModel, f, sleepstudy; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\n\n\n\n\n(Intercept)\n251.4051\n6.7077\n37.48\n<1e-99\n24.1714\n\n\ndays\n10.4673\n1.5193\n6.89\n<1e-11\n5.7994\n\n\nResidual\n25.5561\n\n\n\n\n\n\n\n\n\nAgain, the default display doesn’t show that there is no correlation parameter to be estimated in this model, but the VarCorr display does.\n\nVarCorr(m2)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nsubj\n(Intercept)\n584.25897\n24.17145\n\n\n\n\ndays\n33.63281\n5.79938\n.\n\n\nResidual\n\n653.11578\n25.55613\n\n\n\n\n\n\nThis model has a slightly lower log-likelihood than does m1 and one fewer parameter than m1. A likelihood-ratio test can be used to compare these nested models.\n\nMixedModels.likelihoodratiotest(m2, m1)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nreaction ~ 1 + days + zerocorr(1 + days | subj)\n5\n1752\n\n\n\n\n\nreaction ~ 1 + days + (1 + days | subj)\n6\n1752\n0\n1\n0.8004\n\n\n\n\n\nAlternatively, the AIC or BIC values can be compared.\n\n\nCode\nlet mods = [m2, m1]\n  Table(;\n    model=[:m2, :m1],\n    pars=dof.(mods),\n    geomdof=(sum ∘ leverage).(mods),\n    AIC=aic.(mods),\n    BIC=bic.(mods),\n    AICc=aicc.(mods),\n  )\nend\n\n\nTable with 6 columns and 2 rows:\n     model  pars  geomdof  AIC      BIC      AICc\n   ┌────────────────────────────────────────────────\n 1 │ m2     5     29.045   1762.0   1777.97  1762.35\n 2 │ m1     6     28.6115  1763.94  1783.1   1764.42\n\n\nThe goodness of fit measures: AIC, BIC, and AICc, are all on a “smaller is better” scale and, hence, they all prefer m2.\nThe pars column, which is the same as the model-dof column in the likelihood ratio test output, is simply a count of the number of parameters to be estimated when fitting the model. For example, in m2 there are two fixed-effects parameters and three variance components (including the residual variance).\nAn alternative, more geometrically inspired definition of “degrees of freedom”, is the sum of the leverage values, called geomdof in this table.\nInterestingly, the model with fewer parameters, m2, has a greater sum of the leverage values than the model with more parameters, m1. We’re not sure what to make of that.\nIn both cases the sum of the leverage values is toward the upper end of the range of possible values, which is the rank of the fixed-effects model matrix (2) up to the rank of the fixed-effects plus the random effects model matrix (2 + 36 = 38).\n\n\n\n\n\n\nNote\n\n\n\nI think that the upper bound may be 36, not 38, because the two columns of X lie in the column span of Z\n\n\nThis comparison does show, however, that a simple count of the parameters in a mixed-effects model can underestimate, sometimes drastically, the model complexity. This is because a single variance component or multiple components can add many dimensions to the linear predictor.\n\n\n4 Some diagnostic plots\nIn mixed-effects models the linear predictor expression incorporates fixed-effects parameters, which summarize trends for the population or certain well-defined subpopulations, and random effects which represent deviations associated with the experimental units or observational units - individual subjects, in this case. The random effects are modeled as unobserved random variables.\nThe conditional means of these random variables, sometimes called the BLUPs or Best Linear Unbiased Predictors, are not simply the least squares estimates. They are attenuated or shrunk towards zero to reflect the fact that the individuals are assumed to come from a population. A shrinkage plot, Figure 3, shows the BLUPs from the model fit compared to the values without any shrinkage. If the BLUPs are similar to the unshrunk values then the more complicated model accounting for individual differences is supported. If the BLUPs are strongly shrunk towards zero then the additional complexity in the model to account for individual differences is not providing sufficient increase in fidelity to the data to warrant inclusion.\n\n\nCode\nshrinkageplot!(Figure(; resolution=(500, 500)), m1)\n\n\n\n\n\nFigure 3: Shrinkage plot of means of the random effects in model m1\n\n\n\n\n\n\n\n\n\n\nNote\n\n\n\nThis plot could be drawn as shrinkageplot(m1). The reason for explicitly creating a Figure to be modified by shrinkageplot! is to control the resolution.\n\n\nThis plot shows an intermediate pattern. The random effects are somewhat shrunk toward the origin, a model simplification trend, but not completely shrunk - indicating that fidelity to the data is enhanced with these additional coefficients in the linear predictor.\nIf the shrinkage were primarily in one direction - for example, if the arrows from the unshrunk values to the shrunk values were mostly in the vertical direction - then we would get an indication that we could drop the random effect for slope and revert to a simpler model. This is not the case here.\nAs would be expected, the unshrunk values that are further from the origin tend to be shrunk more toward the origin. That is, the arrows that originate furthest from the origin are longer. However, that is not always the case. The arrow in the upper right corner, from S337, is relatively short. Examination of the panel for S337 in the data plot shows a strong linear trend, even though both the intercept and the slope are unusually large. The neighboring panels in the data plot, S330 and S331, have more variability around the least squares line and are subject to a greater amount of shrinkage in the model. (They correspond to the two arrows on the right hand side of the figure around -5 on the vertical scale.)\n\n\n5 Assessing variability by bootstrapping\nThe speed of fitting linear mixed-effects models using MixedModels.jl allows for using simulation-based approaches to inference instead of relying on approximate standard errors. A parametric bootstrap sample for model m is a collection of models of the same form as m fit to data values simulated from m. That is, we pretend that m and its parameter values are the true parameter values, simulate data from these values, and estimate parameters from the simulated data.\nSimulating and fitting a substantial number of model fits, 5000 in this case, takes only a few seconds, following which we extract a data frame of the parameter estimates and plot densities of some of these estimates.\n\nrng = Random.seed!(42)    # initialize a random number generator\nm1bstp = parametricbootstrap(rng, 5000, m1; hide_progress=true)\ntbl = m1bstp.tbl\n\nTable with 10 columns and 5000 rows:\n      obj      β1       β2       σ        σ1       σ2       ρ1          ⋯\n    ┌────────────────────────────────────────────────────────────────────\n 1  │ 1717.29  260.712  9.84975  23.4092  15.3314  6.40292  -0.0259483  ⋯\n 2  │ 1744.06  262.253  12.3008  25.7047  16.3183  5.54687  0.552609    ⋯\n 3  │ 1714.16  253.149  12.879   22.2753  25.4787  6.1444   0.0691544   ⋯\n 4  │ 1711.54  263.376  11.5798  23.3128  18.8039  4.65569  0.103361    ⋯\n 5  │ 1741.66  248.429  9.39444  25.4355  20.1412  5.27358  -0.163606   ⋯\n 6  │ 1754.81  256.794  8.024    26.5089  10.6769  7.14153  0.335544    ⋯\n 7  │ 1777.73  253.388  8.83556  27.8623  17.8322  7.17385  0.00379492  ⋯\n 8  │ 1768.59  254.441  11.4479  27.4034  16.2487  6.67041  0.725384    ⋯\n 9  │ 1753.56  244.906  11.3423  25.6046  25.3607  5.98654  -0.171821   ⋯\n 10 │ 1722.61  257.088  9.18397  23.3386  24.9274  5.18012  0.181143    ⋯\n 11 │ 1738.16  251.262  11.6568  25.7823  17.6665  4.07214  0.258136    ⋯\n 12 │ 1747.76  258.302  12.8015  26.1085  19.2398  5.06067  0.879704    ⋯\n 13 │ 1745.91  254.57   11.8062  24.8863  24.2513  6.14642  0.0126995   ⋯\n 14 │ 1738.8   251.179  10.3226  24.2672  23.7195  6.32645  0.368592    ⋯\n 15 │ 1724.76  238.603  11.5045  25.2301  19.026   3.64035  -0.346558   ⋯\n 16 │ 1777.7   254.133  8.26397  26.9846  26.3715  7.8283   -0.288773   ⋯\n 17 │ 1748.33  251.571  9.5294   26.2927  21.9611  4.31316  -0.150104   ⋯\n 18 │ 1708.99  245.607  12.8175  24.4135  12.494   5.11304  -0.694452   ⋯\n 19 │ 1732.8   256.87   12.2719  23.9952  20.2663  6.58464  0.147647    ⋯\n 20 │ 1746.12  247.428  10.4695  24.319   32.9351  5.78109  0.0337611   ⋯\n 21 │ 1788.6   254.067  9.11893  27.8716  29.9888  6.74499  -0.0317739  ⋯\n 22 │ 1772.12  245.629  10.4063  28.3482  17.6055  5.14085  -0.0573809  ⋯\n 23 │ 1749.18  245.683  11.673   25.3641  26.4956  5.18958  0.469144    ⋯\n ⋮  │    ⋮        ⋮        ⋮        ⋮        ⋮        ⋮         ⋮       ⋱\n\n\nAn empirical density plot of the estimates for the fixed-effects coefficients, Figure 4, shows the normal distribution, “bell-curve”, shape as we might expect.\n\n\nCode\nbegin\n  f1 = Figure(; resolution=(1000, 400))\n  CairoMakie.density!(\n    Axis(f1[1, 1]; xlabel=\"Intercept [ms]\"), tbl.β1\n  )\n  CairoMakie.density!(\n    Axis(f1[1, 2]; xlabel=\"Coefficient of days [ms/day]\"),\n    tbl.β2\n  )\n  f1\nend\n\n\n\n\n\nFigure 4: Empirical density plots of bootstrap replications of fixed-effects parameter estimates\n\n\n\n\nIt is also possible to create interval estimates of the parameters from the bootstrap replicates. We define the 1-α shortestcovint to be the shortest interval that contains a proportion 1-α (defaults to 95%) of the bootstrap estimates of the parameter.\n\nTable(shortestcovint(m1bstp))\n\nTable with 5 columns and 6 rows:\n     type  group     names              lower     upper\n   ┌─────────────────────────────────────────────────────\n 1 │ β     missing   (Intercept)        239.64    265.228\n 2 │ β     missing   days               7.42347   13.1607\n 3 │ σ     subj      (Intercept)        10.1722   33.0876\n 4 │ σ     subj      days               2.9948    7.66117\n 5 │ ρ     subj      (Intercept), days  -0.40135  1.0\n 6 │ σ     residual  missing            22.701    28.5016\n\n\nThe intervals look reasonable except that the upper end point of the interval for ρ1, the correlation coefficient, is 1.0 . It turns out that the estimates of ρ have a great deal of variability.\nBecause there are several values on the boundary (ρ = 1.0) and a pulse like this is not handled well by a density plot, we plot this sample as a histogram, Figure 5.\n\n\nCode\nhist(\n  tbl.ρ1;\n  bins=40,\n  axis=(; xlabel=\"Estimated correlation of the random effects\"),\n  figure=(; resolution=(500, 500)),\n)\n\n\n\n\n\nFigure 5: Histogram of bootstrap replications of the within-subject correlation parameter\n\n\n\n\nFinally, density plots for the variance components (but on the scale of the standard deviation), Figure 6, show reasonable symmetry.\n\n\nCode\nbegin\n  f2 = Figure(; resolution=(1000, 300))\n  CairoMakie.density!(\n    Axis(f2[1, 1]; xlabel=\"Residual σ\"),\n    tbl.σ,\n  )\n  CairoMakie.density!(\n    Axis(f2[1, 2]; xlabel=\"subj-Intercept σ\"),\n    tbl.σ1,\n  )\n  CairoMakie.density!(\n    Axis(f2[1, 3]; xlabel=\"subj-slope σ\"),\n    tbl.σ2,\n  )\n  f2\nend\n\n\n\n\n\nFigure 6: Empirical density plots of bootstrap replicates of standard deviation estimates\n\n\n\n\nThe estimates of the coefficients, β₁ and β₂, are not highly correlated as shown in a scatterplot of the bootstrap estimates, Figure 7 .\n\nvcov(m1; corr=true)  # correlation estimate from the model\n\n2×2 Matrix{Float64}:\n  1.0       -0.137545\n -0.137545   1.0\n\n\n\n\nCode\nlet\n  scatter(\n    tbl.β1, tbl.β2,\n    color=(:blue, 0.20),\n    axis=(; xlabel=\"Intercept\", ylabel=\"Coefficient of days\"),\n    figure=(; resolution=(500, 500)),\n  )\n  contour!(kde((tbl.β1, tbl.β2)))\n  current_figure()\nend\n\n\n\n\n\nFigure 7: Scatter-plot of bootstrap replicates of fixed-effects estimates with contours\n\n\n\n\n\n\n6 References\n\n\nBalkin, T., Thome, D., Sing, H., Thomas, M., Redmond, D., Wesensten, N., Williams, J., Hall, S., & Belenky, G. (2000). Effects of sleep schedules on commercial motor vehicle driver performance (DOT-MC-00-133). Federal Motor Carrier Safety Administration. https://doi.org/10.21949/1503015.\n\n\nBelenky, G., Wesensten, N. J., Thorne, D. R., Thomas, M. L., Sing, H. C., Redmond, D. P., Russo, M. B., & Balkin, T. J. (2003). Patterns of performance degradation and restoration during sleep restriction and subsequent recovery: A sleep dose-response study. Journal of Sleep Research, 12(1), 1–12. https://doi.org/10.1046/j.1365-2869.2003.00337.x\n\n\nDanisch, S., & Krumbiegel, J. (2021). Makie.jl: Flexible high-performance data visualization for julia. Journal of Open Source Software, 6(65), 3349. https://doi.org/10.21105/joss.03349\n\n\nSarkar, D. (2008). Lattice: Mutivariate data visualization with r. Springer-Verlag GmbH. https://www.ebook.de/de/product/11429038/deepayan_sarkar_lattice.html\n\n\n\n\n\n\n Back to top"
    +    "text": "The sleepstudy data are from a study of the effects of sleep deprivation on response time reported in Balkin et al. (2000) and in Belenky et al. (2003). Eighteen subjects were allowed only 3 hours of time to sleep each night for 9 successive nights. Their reaction time was measured each day, starting the day before the first night of sleep deprivation, when the subjects were on their regular sleep schedule.\n\n\n\n\n\n\nNote\n\n\n\nThis description is inaccurate. In fact the first two days were acclimatization, the third was a baseline and sleep deprivation was only enforced after day 2. To allow for comparison with earlier analyses of these data we retain the old data description for this notebook only.\n\n\n\n1 Loading the data\nFirst attach the MixedModels package and other packages for plotting. The CairoMakie package allows the Makie graphics system (Danisch & Krumbiegel, 2021) to generate high quality static images. Activate that package with the SVG (Scalable Vector Graphics) backend.\n\n\nCode\nusing CairoMakie       # graphics back-end\nusing DataFrames\nusing KernelDensity    # density estimation\nusing MixedModels\nusing MixedModelsMakie # diagnostic plots\nusing ProgressMeter\nusing Random           # random number generators\nusing RCall            # call R from Julia\nusing SMLP2023\nusing SMLP2023: dataset\n\nProgressMeter.ijulia_behavior(:clear)\nCairoMakie.activate!(; type=\"svg\")\n\n\nThe sleepstudy data are one of the datasets available with the MixedModels package. It is re-exported by the SMLP2023 package’s dataset function.\n\nsleepstudy = dataset(\"sleepstudy\")\n\nArrow.Table with 180 rows, 3 columns, and schema:\n :subj      String\n :days      Int8\n :reaction  Float64\n\n\nFigure 1 displays the data in a multi-panel plot created with the lattice package in R (Sarkar, 2008), using RCall.jl.\n\n\nCode\nRCall.ijulia_setdevice(MIME(\"image/svg+xml\"); width=10, height=4.5)\nR\"\"\"\nrequire(\"lattice\", quietly=TRUE)\nprint(xyplot(reaction ~ days | subj,\n  $(DataFrame(sleepstudy)),\n  aspect=\"xy\",\n  layout=c(9,2),\n  type=c(\"g\", \"p\", \"r\"),\n  index.cond=function(x,y) coef(lm(y ~ x))[1],\n  xlab = \"Days of sleep deprivation\",\n  ylab = \"Average reaction time (ms)\"\n))\n\"\"\";\n\n\n\n\n\nFigure 1: Average response time versus days of sleep deprivation by subject\n\n\n\n\nEach panel shows the data from one subject and a line fit by least squares to that subject’s data. Starting at the lower left panel and proceeding across rows, the panels are ordered by increasing intercept of the least squares line.\nThere are some deviations from linearity within the panels but the deviations are neither substantial nor systematic.\n\n\n2 Fitting an initial model\n\ncontrasts = Dict{Symbol,Any}(:subj => Grouping())\nm1 = let f = @formula(reaction ~ 1 + days + (1 + days | subj))\n  fit(MixedModel, f, sleepstudy; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\n\n\n\n\n(Intercept)\n251.4051\n6.6323\n37.91\n<1e-99\n23.7805\n\n\ndays\n10.4673\n1.5022\n6.97\n<1e-11\n5.7168\n\n\nResidual\n25.5918\n\n\n\n\n\n\n\n\n\nThis model includes fixed effects for the intercept, representing the typical reaction time at the beginning of the experiment with zero days of sleep deprivation, and the slope w.r.t. days of sleep deprivation. The parameter estimates are about 250 ms. typical reaction time without deprivation and a typical increase of 10.5 ms. per day of sleep deprivation.\nThe random effects represent shifts from the typical behavior for each subject. The shift in the intercept has a standard deviation of about 24 ms. which would suggest a range of about 200 ms. to 300 ms. in the intercepts. Similarly within-subject slopes would be expected to have a range of about 0 ms./day up to 20 ms./day.\nThe random effects for the slope and for the intercept are allowed to be correlated within subject. The estimated correlation, 0.08, is small. This estimate is not shown in the default display above but is shown in the output from VarCorr (variance components and correlations).\n\nVarCorr(m1)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nsubj\n(Intercept)\n565.51068\n23.78047\n\n\n\n\ndays\n32.68212\n5.71683\n+0.08\n\n\nResidual\n\n654.94145\n25.59182\n\n\n\n\n\n\nTechnically, the random effects for each subject are unobserved random variables and are not “parameters” in the model per se. Hence we do not report standard errors or confidence intervals for these deviations. However, we can produce prediction intervals on the random effects for each subject. Because the experimental design is balanced, these intervals will have the same width for all subjects.\nA plot of the prediction intervals versus the level of the grouping factor (subj, in this case) is sometimes called a caterpillar plot because it can look like a fuzzy caterpillar if there are many levels of the grouping factor. By default, the levels of the grouping factor are sorted by increasing value of the first random effect.\n\n\nCode\ncaterpillar(m1)\n\n\n\n\n\nFigure 2: Prediction intervals on random effects for model m1\n\n\n\n\nFigure 2 reinforces the conclusion that there is little correlation between the random effect for intercept and the random effect for slope.\n\n\n3 A model with uncorrelated random effects\nThe zerocorr function applied to a random-effects term creates uncorrelated vector-valued per-subject random effects.\n\nm2 = let f = @formula reaction ~ 1 + days + zerocorr(1 + days | subj)\n  fit(MixedModel, f, sleepstudy; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\n\n\n\n\n(Intercept)\n251.4051\n6.7077\n37.48\n<1e-99\n24.1714\n\n\ndays\n10.4673\n1.5193\n6.89\n<1e-11\n5.7994\n\n\nResidual\n25.5561\n\n\n\n\n\n\n\n\n\nAgain, the default display doesn’t show that there is no correlation parameter to be estimated in this model, but the VarCorr display does.\n\nVarCorr(m2)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nsubj\n(Intercept)\n584.25897\n24.17145\n\n\n\n\ndays\n33.63281\n5.79938\n.\n\n\nResidual\n\n653.11578\n25.55613\n\n\n\n\n\n\nThis model has a slightly lower log-likelihood than does m1 and one fewer parameter than m1. A likelihood-ratio test can be used to compare these nested models.\n\nMixedModels.likelihoodratiotest(m2, m1)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nreaction ~ 1 + days + zerocorr(1 + days | subj)\n5\n1752\n\n\n\n\n\nreaction ~ 1 + days + (1 + days | subj)\n6\n1752\n0\n1\n0.8004\n\n\n\n\n\nAlternatively, the AIC or BIC values can be compared.\n\n\nCode\nlet mods = [m2, m1]\n  Table(;\n    model=[:m2, :m1],\n    pars=dof.(mods),\n    geomdof=(sum ∘ leverage).(mods),\n    AIC=aic.(mods),\n    BIC=bic.(mods),\n    AICc=aicc.(mods),\n  )\nend\n\n\nTable with 6 columns and 2 rows:\n     model  pars  geomdof  AIC      BIC      AICc\n   ┌────────────────────────────────────────────────\n 1 │ m2     5     29.045   1762.0   1777.97  1762.35\n 2 │ m1     6     28.6115  1763.94  1783.1   1764.42\n\n\nThe goodness of fit measures: AIC, BIC, and AICc, are all on a “smaller is better” scale and, hence, they all prefer m2.\nThe pars column, which is the same as the model-dof column in the likelihood ratio test output, is simply a count of the number of parameters to be estimated when fitting the model. For example, in m2 there are two fixed-effects parameters and three variance components (including the residual variance).\nAn alternative, more geometrically inspired definition of “degrees of freedom”, is the sum of the leverage values, called geomdof in this table.\nInterestingly, the model with fewer parameters, m2, has a greater sum of the leverage values than the model with more parameters, m1. We’re not sure what to make of that.\nIn both cases the sum of the leverage values is toward the upper end of the range of possible values, which is the rank of the fixed-effects model matrix (2) up to the rank of the fixed-effects plus the random effects model matrix (2 + 36 = 38).\n\n\n\n\n\n\nNote\n\n\n\nI think that the upper bound may be 36, not 38, because the two columns of X lie in the column span of Z\n\n\nThis comparison does show, however, that a simple count of the parameters in a mixed-effects model can underestimate, sometimes drastically, the model complexity. This is because a single variance component or multiple components can add many dimensions to the linear predictor.\n\n\n4 Some diagnostic plots\nIn mixed-effects models the linear predictor expression incorporates fixed-effects parameters, which summarize trends for the population or certain well-defined subpopulations, and random effects which represent deviations associated with the experimental units or observational units - individual subjects, in this case. The random effects are modeled as unobserved random variables.\nThe conditional means of these random variables, sometimes called the BLUPs or Best Linear Unbiased Predictors, are not simply the least squares estimates. They are attenuated or shrunk towards zero to reflect the fact that the individuals are assumed to come from a population. A shrinkage plot, Figure 3, shows the BLUPs from the model fit compared to the values without any shrinkage. If the BLUPs are similar to the unshrunk values then the more complicated model accounting for individual differences is supported. If the BLUPs are strongly shrunk towards zero then the additional complexity in the model to account for individual differences is not providing sufficient increase in fidelity to the data to warrant inclusion.\n\n\nCode\nshrinkageplot!(Figure(; resolution=(500, 500)), m1)\n\n\n\n\n\nFigure 3: Shrinkage plot of means of the random effects in model m1\n\n\n\n\n\n\n\n\n\n\nNote\n\n\n\nThis plot could be drawn as shrinkageplot(m1). The reason for explicitly creating a Figure to be modified by shrinkageplot! is to control the resolution.\n\n\nThis plot shows an intermediate pattern. The random effects are somewhat shrunk toward the origin, a model simplification trend, but not completely shrunk - indicating that fidelity to the data is enhanced with these additional coefficients in the linear predictor.\nIf the shrinkage were primarily in one direction - for example, if the arrows from the unshrunk values to the shrunk values were mostly in the vertical direction - then we would get an indication that we could drop the random effect for slope and revert to a simpler model. This is not the case here.\nAs would be expected, the unshrunk values that are further from the origin tend to be shrunk more toward the origin. That is, the arrows that originate furthest from the origin are longer. However, that is not always the case. The arrow in the upper right corner, from S337, is relatively short. Examination of the panel for S337 in the data plot shows a strong linear trend, even though both the intercept and the slope are unusually large. The neighboring panels in the data plot, S330 and S331, have more variability around the least squares line and are subject to a greater amount of shrinkage in the model. (They correspond to the two arrows on the right hand side of the figure around -5 on the vertical scale.)\n\n\n5 Assessing variability by bootstrapping\nThe speed of fitting linear mixed-effects models using MixedModels.jl allows for using simulation-based approaches to inference instead of relying on approximate standard errors. A parametric bootstrap sample for model m is a collection of models of the same form as m fit to data values simulated from m. That is, we pretend that m and its parameter values are the true parameter values, simulate data from these values, and estimate parameters from the simulated data.\nSimulating and fitting a substantial number of model fits, 5000 in this case, takes only a few seconds, following which we extract a data frame of the parameter estimates and plot densities of some of these estimates.\n\nrng = Random.seed!(42)    # initialize a random number generator\nm1bstp = parametricbootstrap(rng, 5000, m1; hide_progress=true)\ntbl = m1bstp.tbl\n\nTable with 10 columns and 5000 rows:\n      obj      β1       β2       σ        σ1       σ2       ρ1          ⋯\n    ┌────────────────────────────────────────────────────────────────────\n 1  │ 1717.29  260.712  9.84975  23.4092  15.3314  6.40292  -0.0259482  ⋯\n 2  │ 1744.06  262.253  12.3008  25.7047  16.3183  5.54688  0.552607    ⋯\n 3  │ 1714.16  253.149  12.879   22.2753  25.4787  6.1444   0.0691545   ⋯\n 4  │ 1711.54  263.376  11.5798  23.3128  18.8039  4.6557   0.103361    ⋯\n 5  │ 1741.66  248.429  9.39444  25.4355  20.141   5.27357  -0.163607   ⋯\n 6  │ 1754.81  256.794  8.024    26.5088  10.6776  7.14168  0.335501    ⋯\n 7  │ 1777.73  253.388  8.83556  27.8623  17.8321  7.17386  0.00379771  ⋯\n 8  │ 1768.59  254.441  11.4479  27.4034  16.2483  6.67044  0.725389    ⋯\n 9  │ 1753.56  244.906  11.3423  25.6046  25.3607  5.98654  -0.171821   ⋯\n 10 │ 1722.61  257.088  9.18397  23.3386  24.9274  5.18012  0.181143    ⋯\n 11 │ 1738.16  251.262  11.6568  25.7822  17.6669  4.07207  0.258267    ⋯\n 12 │ 1747.76  258.302  12.8015  26.1085  19.2398  5.06066  0.879712    ⋯\n 13 │ 1745.91  254.57   11.8062  24.8863  24.2513  6.14642  0.0126996   ⋯\n 14 │ 1738.8   251.179  10.3226  24.2672  23.7195  6.32645  0.368592    ⋯\n 15 │ 1724.76  238.603  11.5045  25.23    19.0264  3.6404   -0.346579   ⋯\n 16 │ 1777.7   254.133  8.26397  26.9846  26.3715  7.8283   -0.288773   ⋯\n 17 │ 1748.33  251.571  9.5294   26.2927  21.9611  4.31316  -0.150104   ⋯\n 18 │ 1708.99  245.607  12.8175  24.4135  12.494   5.11304  -0.694452   ⋯\n 19 │ 1732.8   256.87   12.2719  23.9952  20.2665  6.58464  0.147646    ⋯\n 20 │ 1746.12  247.428  10.4695  24.319   32.9351  5.78109  0.0337611   ⋯\n 21 │ 1788.6   254.067  9.11893  27.8716  29.9888  6.74499  -0.0317739  ⋯\n 22 │ 1772.12  245.629  10.4063  28.3482  17.6055  5.14085  -0.0573815  ⋯\n 23 │ 1749.18  245.683  11.673   25.3641  26.4956  5.18958  0.469144    ⋯\n ⋮  │    ⋮        ⋮        ⋮        ⋮        ⋮        ⋮         ⋮       ⋱\n\n\nAn empirical density plot of the estimates for the fixed-effects coefficients, Figure 4, shows the normal distribution, “bell-curve”, shape as we might expect.\n\n\nCode\nbegin\n  f1 = Figure(; resolution=(1000, 400))\n  CairoMakie.density!(\n    Axis(f1[1, 1]; xlabel=\"Intercept [ms]\"), tbl.β1\n  )\n  CairoMakie.density!(\n    Axis(f1[1, 2]; xlabel=\"Coefficient of days [ms/day]\"),\n    tbl.β2\n  )\n  f1\nend\n\n\n\n\n\nFigure 4: Empirical density plots of bootstrap replications of fixed-effects parameter estimates\n\n\n\n\nIt is also possible to create interval estimates of the parameters from the bootstrap replicates. We define the 1-α shortestcovint to be the shortest interval that contains a proportion 1-α (defaults to 95%) of the bootstrap estimates of the parameter.\n\nTable(shortestcovint(m1bstp))\n\nTable with 5 columns and 6 rows:\n     type  group     names              lower      upper\n   ┌──────────────────────────────────────────────────────\n 1 │ β     missing   (Intercept)        239.64     265.228\n 2 │ β     missing   days               7.42347    13.1607\n 3 │ σ     subj      (Intercept)        10.1722    33.0875\n 4 │ σ     subj      days               2.99496    7.66115\n 5 │ ρ     subj      (Intercept), days  -0.401354  1.0\n 6 │ σ     residual  missing            22.701     28.5016\n\n\nThe intervals look reasonable except that the upper end point of the interval for ρ1, the correlation coefficient, is 1.0 . It turns out that the estimates of ρ have a great deal of variability.\nBecause there are several values on the boundary (ρ = 1.0) and a pulse like this is not handled well by a density plot, we plot this sample as a histogram, Figure 5.\n\n\nCode\nhist(\n  tbl.ρ1;\n  bins=40,\n  axis=(; xlabel=\"Estimated correlation of the random effects\"),\n  figure=(; resolution=(500, 500)),\n)\n\n\n\n\n\nFigure 5: Histogram of bootstrap replications of the within-subject correlation parameter\n\n\n\n\nFinally, density plots for the variance components (but on the scale of the standard deviation), Figure 6, show reasonable symmetry.\n\n\nCode\nbegin\n  f2 = Figure(; resolution=(1000, 300))\n  CairoMakie.density!(\n    Axis(f2[1, 1]; xlabel=\"Residual σ\"),\n    tbl.σ,\n  )\n  CairoMakie.density!(\n    Axis(f2[1, 2]; xlabel=\"subj-Intercept σ\"),\n    tbl.σ1,\n  )\n  CairoMakie.density!(\n    Axis(f2[1, 3]; xlabel=\"subj-slope σ\"),\n    tbl.σ2,\n  )\n  f2\nend\n\n\n\n\n\nFigure 6: Empirical density plots of bootstrap replicates of standard deviation estimates\n\n\n\n\nThe estimates of the coefficients, β₁ and β₂, are not highly correlated as shown in a scatterplot of the bootstrap estimates, Figure 7 .\n\nvcov(m1; corr=true)  # correlation estimate from the model\n\n2×2 Matrix{Float64}:\n  1.0       -0.137545\n -0.137545   1.0\n\n\n\n\nCode\nlet\n  scatter(\n    tbl.β1, tbl.β2,\n    color=(:blue, 0.20),\n    axis=(; xlabel=\"Intercept\", ylabel=\"Coefficient of days\"),\n    figure=(; resolution=(500, 500)),\n  )\n  contour!(kde((tbl.β1, tbl.β2)))\n  current_figure()\nend\n\n\n\n\n\nFigure 7: Scatter-plot of bootstrap replicates of fixed-effects estimates with contours\n\n\n\n\n\n\n6 References\n\n\nBalkin, T., Thome, D., Sing, H., Thomas, M., Redmond, D., Wesensten, N., Williams, J., Hall, S., & Belenky, G. (2000). Effects of sleep schedules on commercial motor vehicle driver performance (DOT-MC-00-133). Federal Motor Carrier Safety Administration. https://doi.org/10.21949/1503015.\n\n\nBelenky, G., Wesensten, N. J., Thorne, D. R., Thomas, M. L., Sing, H. C., Redmond, D. P., Russo, M. B., & Balkin, T. J. (2003). Patterns of performance degradation and restoration during sleep restriction and subsequent recovery: A sleep dose-response study. Journal of Sleep Research, 12(1), 1–12. https://doi.org/10.1046/j.1365-2869.2003.00337.x\n\n\nDanisch, S., & Krumbiegel, J. (2021). Makie.jl: Flexible high-performance data visualization for julia. Journal of Open Source Software, 6(65), 3349. https://doi.org/10.21105/joss.03349\n\n\nSarkar, D. (2008). Lattice: Mutivariate data visualization with r. Springer-Verlag GmbH. https://www.ebook.de/de/product/11429038/deepayan_sarkar_lattice.html\n\n\n\n\n\n\n Back to top"
       },
       {
         "objectID": "selection.html",
    @@ -165,14 +165,14 @@
         "href": "kwdyz11.html#generate-a-bootstrap-sample",
         "title": "RePsychLing Kliegl et al. (2010)",
         "section": "7.1 Generate a bootstrap sample",
    -    "text": "7.1 Generate a bootstrap sample\nWe generate 2500 samples for the 15 model parameters (4 fixed effect, 4 VCs, 6 CPs, and 1 residual).\n\n\nCode\nRandom.seed!(1234321)\nsamp = parametricbootstrap(2500, m1; hide_progress=true)\ntbl = samp.tbl\n\n\nTable with 26 columns and 2500 rows:\n      obj       β1       β2         β3         β4            σ         ⋯\n    ┌───────────────────────────────────────────────────────────────────\n 1  │ -12802.3  5.93392  0.0864217  0.0488883  -0.0121833    0.192002  ⋯\n 2  │ -12794.3  5.95776  0.0989839  0.0318746  -0.00666147   0.191977  ⋯\n 3  │ -12930.6  5.93669  0.0885609  0.0209792  -0.000657475  0.191496  ⋯\n 4  │ -12946.5  5.93165  0.0767127  0.0343559  -0.00499478   0.191438  ⋯\n 5  │ -12677.5  5.91938  0.0984593  0.0272951  -0.00555746   0.19247   ⋯\n 6  │ -12869.7  5.96313  0.104457   0.0321632  -0.00719273   0.191751  ⋯\n 7  │ -12478.1  5.9328   0.0947866  0.0409707  -0.00461589   0.193076  ⋯\n 8  │ -12463.7  5.94439  0.0977165  0.0321098  -0.00625459   0.193115  ⋯\n 9  │ -12836.2  5.9728   0.097135   0.0416619  6.11913e-5    0.191843  ⋯\n 10 │ -12932.3  5.94709  0.0742452  0.0505274  -0.013146     0.191583  ⋯\n 11 │ -12736.2  5.93625  0.0728171  0.0479427  -0.0183158    0.192193  ⋯\n 12 │ -13048.0  5.89421  0.0680602  0.0481655  -0.0214151    0.191101  ⋯\n 13 │ -13313.8  5.92608  0.0892319  0.0473893  -0.014168     0.190142  ⋯\n 14 │ -12575.0  5.89235  0.0846171  0.0341531  -0.00613035   0.192728  ⋯\n 15 │ -12833.1  5.94217  0.0774874  0.0422344  -0.00278949   0.191772  ⋯\n 16 │ -12504.5  5.94385  0.0898019  0.0429787  -0.00705642   0.192833  ⋯\n 17 │ -12875.5  5.96624  0.0976097  0.0370807  -0.00071883   0.191576  ⋯\n 18 │ -13287.4  5.97493  0.101651   0.0407504  -0.0163219    0.190317  ⋯\n 19 │ -13088.2  5.95426  0.101522   0.0342395  0.00229663    0.190991  ⋯\n 20 │ -12820.6  5.92995  0.0775967  0.0394345  -0.0112548    0.191861  ⋯\n 21 │ -12634.4  5.92989  0.0836736  0.0357487  -0.00206017   0.192456  ⋯\n 22 │ -13097.6  5.92438  0.0888691  0.0332515  -0.00701295   0.191018  ⋯\n 23 │ -12837.4  5.90782  0.0861053  0.0385012  -0.00752605   0.191891  ⋯\n ⋮  │    ⋮         ⋮         ⋮          ⋮           ⋮           ⋮      ⋱"
    +    "text": "7.1 Generate a bootstrap sample\nWe generate 2500 samples for the 15 model parameters (4 fixed effect, 4 VCs, 6 CPs, and 1 residual).\n\n\nCode\nRandom.seed!(1234321)\nsamp = parametricbootstrap(2500, m1; hide_progress=true)\ntbl = samp.tbl\n\n\nTable with 26 columns and 2500 rows:\n      obj       β1       β2         β3         β4            σ         ⋯\n    ┌───────────────────────────────────────────────────────────────────\n 1  │ -12802.3  5.93392  0.0864218  0.0488885  -0.0121833    0.192002  ⋯\n 2  │ -12794.3  5.95776  0.0989839  0.0318746  -0.00666166   0.191977  ⋯\n 3  │ -12930.6  5.93669  0.0885609  0.020979   -0.000657458  0.191496  ⋯\n 4  │ -12946.5  5.93165  0.0767126  0.0343559  -0.00499472   0.191438  ⋯\n 5  │ -12677.5  5.91938  0.0984597  0.0272948  -0.00555745   0.19247   ⋯\n 6  │ -12869.7  5.96313  0.104457   0.0321634  -0.00719286   0.191751  ⋯\n 7  │ -12478.1  5.9328   0.0947869  0.0409707  -0.00461601   0.193076  ⋯\n 8  │ -12463.7  5.94439  0.0977165  0.0321098  -0.00625469   0.193115  ⋯\n 9  │ -12836.2  5.9728   0.0971347  0.0416622  6.10495e-5    0.191843  ⋯\n 10 │ -12932.3  5.94709  0.0742449  0.0505276  -0.013146     0.191583  ⋯\n 11 │ -12736.2  5.93625  0.0728169  0.0479429  -0.0183157    0.192193  ⋯\n 12 │ -13048.0  5.89421  0.0680605  0.0481654  -0.0214149    0.191101  ⋯\n 13 │ -13313.8  5.92608  0.0892321  0.0473893  -0.014168     0.190142  ⋯\n 14 │ -12575.0  5.89235  0.0846175  0.0341529  -0.0061302    0.192728  ⋯\n 15 │ -12833.1  5.94217  0.0774872  0.0422346  -0.00278944   0.191772  ⋯\n 16 │ -12504.5  5.94385  0.0898019  0.0429788  -0.00705651   0.192833  ⋯\n 17 │ -12875.5  5.96624  0.0976096  0.0370809  -0.000719     0.191577  ⋯\n 18 │ -13287.4  5.97493  0.101651   0.0407506  -0.016322     0.190317  ⋯\n 19 │ -13088.2  5.95426  0.101523   0.0342395  0.00229645    0.190991  ⋯\n 20 │ -12820.6  5.92995  0.0775966  0.0394345  -0.0112548    0.191861  ⋯\n 21 │ -12634.4  5.92989  0.0836737  0.0357486  -0.00206012   0.192456  ⋯\n 22 │ -13097.6  5.92438  0.0888692  0.0332515  -0.00701294   0.191018  ⋯\n 23 │ -12837.4  5.90782  0.0861056  0.0385011  -0.00752595   0.191891  ⋯\n ⋮  │    ⋮         ⋮         ⋮          ⋮           ⋮           ⋮      ⋱"
       },
       {
         "objectID": "kwdyz11.html#shortest-coverage-interval",
         "href": "kwdyz11.html#shortest-coverage-interval",
         "title": "RePsychLing Kliegl et al. (2010)",
         "section": "7.2 Shortest coverage interval",
    -    "text": "7.2 Shortest coverage interval\nThe upper limit of the interval for the critical CP CTR: sod, CTR: dod is hitting the upper wall of a perfect correlation. This is evidence of singularity. The other intervals do not exhibit such pathologies; they appear to be ok.\n\n\nCode\nconfint(samp)\n\n\nDictTable with 2 columns and 15 rows:\n par   lower       upper\n ────┬───────────────────────\n β1  │ 5.89917     5.97256\n β2  │ 0.0719307   0.104588\n β3  │ 0.025118    0.0491669\n β4  │ -0.020718   0.00268306\n ρ1  │ 0.243767    0.713091\n ρ2  │ -0.919031   0.246975\n ρ3  │ -0.643615   0.569417\n ρ4  │ -0.138124   0.739276\n ρ5  │ 0.576496    0.999995\n ρ6  │ -0.894652   0.436061\n σ   │ 0.19051     0.19359\n σ1  │ 0.116564    0.16857\n σ2  │ 0.045519    0.0708047\n σ3  │ 0.00940216  0.0410695\n σ4  │ 0.0133062   0.037595"
    +    "text": "7.2 Shortest coverage interval\nThe upper limit of the interval for the critical CP CTR: sod, CTR: dod is hitting the upper wall of a perfect correlation. This is evidence of singularity. The other intervals do not exhibit such pathologies; they appear to be ok.\n\n\nCode\nconfint(samp)\n\n\nDictTable with 2 columns and 15 rows:\n par   lower       upper\n ────┬───────────────────────\n β1  │ 5.89917     5.97256\n β2  │ 0.071931    0.104589\n β3  │ 0.0251181   0.049167\n β4  │ -0.0207177  0.00268295\n ρ1  │ 0.24377     0.712955\n ρ2  │ -0.892234   0.263754\n ρ3  │ -0.727028   0.505693\n ρ4  │ -0.138041   0.739151\n ρ5  │ 0.576378    0.999995\n ρ6  │ -0.896241   0.438816\n σ   │ 0.19051     0.19359\n σ1  │ 0.116563    0.168549\n σ2  │ 0.045499    0.0708029\n σ3  │ 0.00942641  0.0409754\n σ4  │ 0.014413    0.0386775"
       },
       {
         "objectID": "kwdyz11.html#comparative-density-plots-of-bootstrapped-parameter-estimates",
    @@ -214,7 +214,7 @@
         "href": "kb07.html",
         "title": "Bootstrapping a fitted model",
         "section": "",
    -    "text": "Begin by loading the packages to be used.\n\n\nCode\nusing AlgebraOfGraphics\nusing CairoMakie\nusing DataFrameMacros\nusing DataFrames\nusing MixedModels\nusing ProgressMeter\nusing Random\nusing SMLP2023: dataset\n\nCairoMakie.activate!(; type=\"svg\")\n\nimport ProgressMeter\nProgressMeter.ijulia_behavior(:clear)\n\n\n\n1 Data set and model\nThe kb07 data (Kronmüller & Barr, 2007) are one of the datasets provided by the MixedModels package.\n\nkb07 = dataset(:kb07)\n\nArrow.Table with 1789 rows, 7 columns, and schema:\n :subj      String\n :item      String\n :spkr      String\n :prec      String\n :load      String\n :rt_trunc  Int16\n :rt_raw    Int16\n\n\nConvert the table to a DataFrame for summary.\n\ndescribe(DataFrame(kb07))\n\n7×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nDataType\n\n\n\n\n1\nsubj\n\nS030\n\nS103\n0\nString\n\n\n2\nitem\n\nI01\n\nI32\n0\nString\n\n\n3\nspkr\n\nnew\n\nold\n0\nString\n\n\n4\nprec\n\nbreak\n\nmaintain\n0\nString\n\n\n5\nload\n\nno\n\nyes\n0\nString\n\n\n6\nrt_trunc\n2182.2\n579\n1940.0\n5171\n0\nInt16\n\n\n7\nrt_raw\n2226.24\n579\n1940.0\n15923\n0\nInt16\n\n\n\n\n\n\nThe experimental factors; spkr, prec, and load, are two-level factors. The EffectsCoding contrast is used with these to create a \\(\\pm1\\) encoding. Furthermore, Grouping constrasts are assigned to the subj and item factors. This is not a contrast per-se but an indication that these factors will be used as grouping factors for random effects and, therefore, there is no need to create a contrast matrix. For large numbers of levels in a grouping factor, an attempt to create a contrast matrix may cause memory overflow.\nIt is not important in these cases but a good practice in any case.\n\ncontrasts = merge(\n  Dict(nm => EffectsCoding() for nm in (:spkr, :prec, :load)),\n  Dict(nm => Grouping() for nm in (:subj, :item)),\n)\n\nThe display of an initial model fit\n\nkbm01 = let\n  form = @formula(\n    rt_trunc ~\n      1 +\n      spkr * prec * load +\n      (1 + spkr + prec + load | subj) +\n      (1 + spkr + prec + load | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\nMinimizing 799   Time: 0:00:01 ( 1.68 ms/it)\n  objective:  28637.123623229592\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\nσ_item\n\n\n\n\n(Intercept)\n2181.6729\n77.3136\n28.22\n<1e-99\n301.8062\n362.2579\n\n\nspkr: old\n67.7491\n18.2664\n3.71\n0.0002\n42.3795\n40.6807\n\n\nprec: maintain\n-333.9205\n47.1558\n-7.08\n<1e-11\n61.9630\n246.9158\n\n\nload: yes\n78.7702\n19.5298\n4.03\n<1e-04\n64.9751\n42.3890\n\n\nspkr: old & prec: maintain\n-21.9655\n15.8074\n-1.39\n0.1647\n\n\n\n\nspkr: old & load: yes\n18.3837\n15.8074\n1.16\n0.2448\n\n\n\n\nprec: maintain & load: yes\n4.5333\n15.8074\n0.29\n0.7743\n\n\n\n\nspkr: old & prec: maintain & load: yes\n23.6073\n15.8074\n1.49\n0.1353\n\n\n\n\nResidual\n668.5542\n\n\n\n\n\n\n\n\n\n\ndoes not include the estimated correlations of the random effects.\nThe VarCorr extractor displays these.\n\nVarCorr(kbm01)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\nsubj\n(Intercept)\n91087.0055\n301.8062\n\n\n\n\n\n\nspkr: old\n1796.0221\n42.3795\n+0.79\n\n\n\n\n\nprec: maintain\n3839.4126\n61.9630\n-0.59\n+0.02\n\n\n\n\nload: yes\n4221.7638\n64.9751\n+0.36\n+0.85\n+0.54\n\n\nitem\n(Intercept)\n131230.7914\n362.2579\n\n\n\n\n\n\nspkr: old\n1654.9232\n40.6807\n+0.44\n\n\n\n\n\nprec: maintain\n60967.4037\n246.9158\n-0.69\n+0.35\n\n\n\n\nload: yes\n1796.8284\n42.3890\n+0.32\n+0.16\n-0.14\n\n\nResidual\n\n446964.7062\n668.5542\n\n\n\n\n\n\n\n\nNone of the two-factor or three-factor interaction terms in the fixed-effects are significant. In the random-effects terms only the scalar random effects and the prec random effect for item appear to be warranted, leading to the reduced formula\n\nkbm02 = let\n  form = @formula(\n    rt_trunc ~\n      1 + spkr + prec + load + (1 | subj) + (1 + prec | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.8526\n77.4681\n28.16\n<1e-99\n364.7125\n298.0259\n\n\nspkr: old\n67.8790\n16.0785\n4.22\n<1e-04\n\n\n\n\nprec: maintain\n-333.7906\n47.4472\n-7.03\n<1e-11\n252.5212\n\n\n\nload: yes\n78.5904\n16.0785\n4.89\n<1e-05\n\n\n\n\nResidual\n680.0319\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(kbm02)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133015.242\n364.713\n\n\n\n\nprec: maintain\n63766.937\n252.521\n-0.70\n\n\nsubj\n(Intercept)\n88819.438\n298.026\n\n\n\nResidual\n\n462443.388\n680.032\n\n\n\n\n\n\nThese two models are nested and can be compared with a likelihood-ratio test.\n\nMixedModels.likelihoodratiotest(kbm02, kbm01)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nrt_trunc ~ 1 + spkr + prec + load + (1 | subj) + (1 + prec | item)\n9\n28664\n\n\n\n\n\nrt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item)\n29\n28637\n27\n20\n0.1431\n\n\n\n\n\nThe p-value of approximately 17% leads us to prefer the simpler model, kbm02, to the more complex, kbm01.\n\n\n2 A bootstrap sample\nCreate a bootstrap sample of a few thousand parameter estimates from the reduced model. The pseudo-random number generator is initialized to a fixed value for reproducibility.\n\nRandom.seed!(1234321)\nhide_progress = true\nkbm02samp = parametricbootstrap(2000, kbm02; hide_progress)\nkbm02tbl = kbm02samp.tbl\n\nTable with 14 columns and 2000 rows:\n      obj      β1       β2       β3        β4       σ        σ1       σ2       ⋯\n    ┌───────────────────────────────────────────────────────────────────────────\n 1  │ 28769.9  2152.69  60.3921  -359.134  54.1231  702.317  421.683  212.915  ⋯\n 2  │ 28775.3  2221.81  61.7318  -349.417  71.1992  697.028  442.809  278.934  ⋯\n 3  │ 28573.6  2325.31  53.9668  -404.225  81.3407  657.746  364.354  274.392  ⋯\n 4  │ 28682.9  2274.65  52.9438  -384.66   69.6788  682.801  398.9    319.726  ⋯\n 5  │ 28616.1  2191.34  54.7785  -357.919  111.829  673.878  253.248  235.913  ⋯\n 6  │ 28634.1  2176.73  95.9793  -378.383  82.1559  671.685  510.996  309.876  ⋯\n 7  │ 28620.4  2128.07  57.6928  -267.747  60.4621  666.986  396.878  295.009  ⋯\n 8  │ 28665.9  2152.59  55.8208  -274.382  76.5128  684.746  369.091  274.446  ⋯\n 9  │ 28651.2  2088.3   76.4636  -296.14   95.6124  680.282  265.684  186.041  ⋯\n 10 │ 28679.9  2375.23  72.2422  -423.922  94.0833  680.729  425.72   287.686  ⋯\n 11 │ 28686.8  2034.11  59.9149  -224.859  59.5448  682.433  308.675  272.181  ⋯\n 12 │ 28702.2  2130.98  83.3953  -271.61   79.974   689.679  401.974  264.255  ⋯\n 13 │ 28625.0  2055.35  55.3526  -363.937  67.7128  676.817  309.154  265.796  ⋯\n 14 │ 28570.3  2160.73  81.5575  -321.913  108.979  661.524  426.869  259.825  ⋯\n 15 │ 28613.6  2237.73  36.9996  -362.443  82.1812  673.873  312.861  241.595  ⋯\n 16 │ 28681.4  2306.64  43.8801  -429.983  103.082  686.437  360.536  204.514  ⋯\n 17 │ 28577.2  2143.78  66.2959  -373.598  93.157   668.15   321.47   183.119  ⋯\n 18 │ 28616.1  2197.03  55.9111  -356.06   74.1476  675.709  302.678  212.917  ⋯\n 19 │ 28771.6  2067.71  56.5032  -324.984  64.804   699.136  344.776  225.602  ⋯\n 20 │ 28674.3  2181.99  40.6566  -251.315  63.1301  683.81   340.569  295.054  ⋯\n 21 │ 28677.6  2129.89  72.7198  -245.006  84.7693  681.416  359.088  287.655  ⋯\n 22 │ 28582.1  2179.8   74.8364  -405.798  68.2978  664.168  357.697  231.402  ⋯\n 23 │ 28714.9  2326.34  74.7091  -400.441  67.79    692.381  354.032  259.052  ⋯\n ⋮  │    ⋮        ⋮        ⋮        ⋮         ⋮        ⋮        ⋮        ⋮     ⋱\n\n\nOne of the uses of such a sample is to form “confidence intervals” on the parameters by obtaining the shortest interval that covers a given proportion (95%, by default) of the sample.\n\nconfint(kbm02samp)\n\nDictTable with 2 columns and 9 rows:\n par   lower      upper\n ────┬─────────────────────\n β1  │ 2028.01    2337.92\n β2  │ 38.431     99.5944\n β3  │ -439.321   -245.864\n β4  │ 46.0262    107.511\n ρ1  │ -0.897984  -0.445598\n σ   │ 655.249    701.497\n σ1  │ 261.196    448.512\n σ2  │ 175.489    312.049\n σ3  │ 228.099    357.789\n\n\nA sample like this can be used for more than just creating an interval because it approximates the distribution of the estimator. For the fixed-effects parameters the estimators are close to being normally distributed, Figure 1.\n\n\nCode\ndraw(\n  data(kbm02samp.β) * mapping(:β; color=:coefname) * AlgebraOfGraphics.density();\n  figure=(; resolution=(800, 450)),\n)\n\n\n\n\n\nFigure 1: Comparative densities of the fixed-effects coefficients in kbm02samp\n\n\n\n\n\n\nCode\nlet pars = [\"σ1\", \"σ2\", \"σ3\"]\n  draw(\n    data(kbm02tbl) *\n    mapping(pars .=> \"σ\"; color=dims(1) => renamer(pars)) *\n    AlgebraOfGraphics.density();\n    figure=(; resolution=(800, 450)),\n  )\nend\n\n\n\n\n\nFigure 2: Density plot of bootstrap samples standard deviation of random effects\n\n\n\n\n\n\nCode\ndraw(\n  data(kbm02tbl) *\n  mapping(:ρ1 => \"Correlation\") *\n  AlgebraOfGraphics.density();\n  figure=(; resolution=(800, 450)),\n)\n\n\n\n\n\nFigure 3: Density plot of correlation parameters in bootstrap sample from model kbm02\n\n\n\n\n\n\n3 References\n\n\nKronmüller, E., & Barr, D. J. (2007). Perspective-free pragmatics: Broken precedents and the recovery-from-preemption hypothesis. Journal of Memory and Language, 56(3), 436–455. https://doi.org/10.1016/j.jml.2006.05.002\n\n\n\n\n\n\n Back to top"
    +    "text": "Begin by loading the packages to be used.\n\n\nCode\nusing AlgebraOfGraphics\nusing CairoMakie\nusing DataFrames\nusing MixedModels\nusing Random\nusing SMLP2023: dataset\n\nCairoMakie.activate!(; type=\"svg\")\n\nimport ProgressMeter\nProgressMeter.ijulia_behavior(:clear)\n\n\n\n1 Data set and model\nThe kb07 data (Kronmüller & Barr, 2007) are one of the datasets provided by the MixedModels package.\n\nkb07 = dataset(:kb07)\n\nArrow.Table with 1789 rows, 7 columns, and schema:\n :subj      String\n :item      String\n :spkr      String\n :prec      String\n :load      String\n :rt_trunc  Int16\n :rt_raw    Int16\n\n\nConvert the table to a DataFrame for summary.\n\ndescribe(DataFrame(kb07))\n\n7×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nDataType\n\n\n\n\n1\nsubj\n\nS030\n\nS103\n0\nString\n\n\n2\nitem\n\nI01\n\nI32\n0\nString\n\n\n3\nspkr\n\nnew\n\nold\n0\nString\n\n\n4\nprec\n\nbreak\n\nmaintain\n0\nString\n\n\n5\nload\n\nno\n\nyes\n0\nString\n\n\n6\nrt_trunc\n2182.2\n579\n1940.0\n5171\n0\nInt16\n\n\n7\nrt_raw\n2226.24\n579\n1940.0\n15923\n0\nInt16\n\n\n\n\n\n\nThe experimental factors; spkr, prec, and load, are two-level factors. The EffectsCoding contrast is used with these to create a \\(\\pm1\\) encoding. Furthermore, Grouping constrasts are assigned to the subj and item factors. This is not a contrast per-se but an indication that these factors will be used as grouping factors for random effects and, therefore, there is no need to create a contrast matrix. For large numbers of levels in a grouping factor, an attempt to create a contrast matrix may cause memory overflow.\nIt is not important in these cases but a good practice in any case.\n\ncontrasts = merge(\n  Dict(nm => EffectsCoding() for nm in (:spkr, :prec, :load)),\n  Dict(nm => Grouping() for nm in (:subj, :item)),\n)\n\nThe display of an initial model fit\n\nkbm01 = let\n  form = @formula(\n    rt_trunc ~\n      1 +\n      spkr * prec * load +\n      (1 + spkr + prec + load | subj) +\n      (1 + spkr + prec + load | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\nMinimizing 894   Time: 0:00:00 ( 0.79 ms/it)\n  objective:  28637.97101084821\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\nσ_item\n\n\n\n\n(Intercept)\n2181.6424\n77.3505\n28.20\n<1e-99\n301.8688\n362.4643\n\n\nspkr: old\n67.7496\n17.9604\n3.77\n0.0002\n33.0582\n41.1114\n\n\nprec: maintain\n-333.9200\n47.1534\n-7.08\n<1e-11\n58.8506\n247.3123\n\n\nload: yes\n78.8006\n19.7270\n3.99\n<1e-04\n66.9612\n43.3929\n\n\nspkr: old & prec: maintain\n-21.9960\n15.8191\n-1.39\n0.1644\n\n\n\n\nspkr: old & load: yes\n18.3832\n15.8191\n1.16\n0.2452\n\n\n\n\nprec: maintain & load: yes\n4.5327\n15.8191\n0.29\n0.7745\n\n\n\n\nspkr: old & prec: maintain & load: yes\n23.6377\n15.8191\n1.49\n0.1351\n\n\n\n\nResidual\n669.0519\n\n\n\n\n\n\n\n\n\n\ndoes not include the estimated correlations of the random effects.\nThe VarCorr extractor displays these.\n\nVarCorr(kbm01)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\nsubj\n(Intercept)\n91124.7853\n301.8688\n\n\n\n\n\n\nspkr: old\n1092.8468\n33.0582\n+1.00\n\n\n\n\n\nprec: maintain\n3463.3971\n58.8506\n-0.62\n-0.62\n\n\n\n\nload: yes\n4483.7997\n66.9612\n+0.36\n+0.36\n+0.51\n\n\nitem\n(Intercept)\n131380.3392\n362.4643\n\n\n\n\n\n\nspkr: old\n1690.1464\n41.1114\n+0.42\n\n\n\n\n\nprec: maintain\n61163.3893\n247.3123\n-0.69\n+0.37\n\n\n\n\nload: yes\n1882.9463\n43.3929\n+0.29\n+0.14\n-0.13\n\n\nResidual\n\n447630.5113\n669.0519\n\n\n\n\n\n\n\n\nNone of the two-factor or three-factor interaction terms in the fixed-effects are significant. In the random-effects terms only the scalar random effects and the prec random effect for item appear to be warranted, leading to the reduced formula\n\nkbm02 = let\n  form = @formula(\n    rt_trunc ~\n      1 + spkr + prec + load + (1 | subj) + (1 + prec | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.8526\n77.4681\n28.16\n<1e-99\n364.7125\n298.0259\n\n\nspkr: old\n67.8790\n16.0785\n4.22\n<1e-04\n\n\n\n\nprec: maintain\n-333.7906\n47.4472\n-7.03\n<1e-11\n252.5212\n\n\n\nload: yes\n78.5904\n16.0785\n4.89\n<1e-05\n\n\n\n\nResidual\n680.0319\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(kbm02)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133015.242\n364.713\n\n\n\n\nprec: maintain\n63766.936\n252.521\n-0.70\n\n\nsubj\n(Intercept)\n88819.437\n298.026\n\n\n\nResidual\n\n462443.388\n680.032\n\n\n\n\n\n\nThese two models are nested and can be compared with a likelihood-ratio test.\n\nMixedModels.likelihoodratiotest(kbm02, kbm01)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nrt_trunc ~ 1 + spkr + prec + load + (1 | subj) + (1 + prec | item)\n9\n28664\n\n\n\n\n\nrt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item)\n29\n28638\n26\n20\n0.1698\n\n\n\n\n\nThe p-value of approximately 17% leads us to prefer the simpler model, kbm02, to the more complex, kbm01.\n\n\n2 A bootstrap sample\nCreate a bootstrap sample of a few thousand parameter estimates from the reduced model. The pseudo-random number generator is initialized to a fixed value for reproducibility.\n\nRandom.seed!(1234321)\nhide_progress = true\nkbm02samp = parametricbootstrap(2000, kbm02; hide_progress)\nkbm02tbl = kbm02samp.tbl\n\nTable with 14 columns and 2000 rows:\n      obj      β1       β2       β3        β4       σ        σ1       σ2       ⋯\n    ┌───────────────────────────────────────────────────────────────────────────\n 1  │ 28769.9  2152.69  60.3921  -359.134  54.1231  702.318  421.682  212.915  ⋯\n 2  │ 28775.3  2221.81  61.7318  -349.417  71.1992  697.027  442.823  278.938  ⋯\n 3  │ 28573.6  2325.31  53.9668  -404.225  81.3407  657.746  364.354  274.392  ⋯\n 4  │ 28682.9  2274.65  52.9438  -384.66   69.6788  682.801  398.902  319.725  ⋯\n 5  │ 28616.1  2191.34  54.7785  -357.919  111.829  673.878  253.248  235.914  ⋯\n 6  │ 28634.1  2176.73  95.9793  -378.383  82.1559  671.685  510.996  309.875  ⋯\n 7  │ 28620.4  2128.07  57.6928  -267.747  60.4621  666.986  396.878  295.008  ⋯\n 8  │ 28665.9  2152.59  55.8208  -274.382  76.5128  684.746  369.091  274.446  ⋯\n 9  │ 28651.2  2088.3   76.4636  -296.14   95.6124  680.282  265.684  186.041  ⋯\n 10 │ 28679.9  2375.23  72.2422  -423.922  94.0833  680.729  425.719  287.686  ⋯\n 11 │ 28686.8  2034.11  59.9149  -224.859  59.5448  682.432  308.691  272.187  ⋯\n 12 │ 28702.2  2130.98  83.3953  -271.61   79.974   689.679  401.978  264.25   ⋯\n 13 │ 28625.0  2055.35  55.3526  -363.937  67.7128  676.817  309.146  265.792  ⋯\n 14 │ 28570.3  2160.73  81.5575  -321.913  108.979  661.524  426.868  259.825  ⋯\n 15 │ 28613.6  2237.73  36.9996  -362.443  82.1812  673.873  312.86   241.593  ⋯\n 16 │ 28681.4  2306.64  43.8801  -429.983  103.082  686.437  360.536  204.514  ⋯\n 17 │ 28577.2  2143.78  66.2959  -373.598  93.157   668.15   321.468  183.119  ⋯\n 18 │ 28616.1  2197.03  55.9111  -356.06   74.1476  675.711  302.638  212.898  ⋯\n 19 │ 28771.6  2067.71  56.5033  -324.984  64.804   699.14   344.805  225.657  ⋯\n 20 │ 28674.3  2181.99  40.6566  -251.315  63.1301  683.81   340.57   295.054  ⋯\n 21 │ 28677.6  2129.89  72.7198  -245.006  84.7693  681.416  359.085  287.655  ⋯\n 22 │ 28582.1  2179.8   74.8364  -405.798  68.2978  664.169  357.698  231.401  ⋯\n 23 │ 28714.9  2326.34  74.7091  -400.441  67.79    692.381  354.032  259.052  ⋯\n ⋮  │    ⋮        ⋮        ⋮        ⋮         ⋮        ⋮        ⋮        ⋮     ⋱\n\n\nOne of the uses of such a sample is to form “confidence intervals” on the parameters by obtaining the shortest interval that covers a given proportion (95%, by default) of the sample.\n\nconfint(kbm02samp)\n\nDictTable with 2 columns and 9 rows:\n par   lower     upper\n ────┬────────────────────\n β1  │ 2028.01   2337.92\n β2  │ 38.431    99.5944\n β3  │ -439.321  -245.864\n β4  │ 46.0262   107.511\n ρ1  │ -0.89799  -0.445596\n σ   │ 655.249   701.497\n σ1  │ 261.196   448.51\n σ2  │ 175.489   312.044\n σ3  │ 228.099   357.789\n\n\nA sample like this can be used for more than just creating an interval because it approximates the distribution of the estimator. For the fixed-effects parameters the estimators are close to being normally distributed, Figure 1.\n\n\nCode\ndraw(\n  data(kbm02samp.β) * mapping(:β; color=:coefname) * AlgebraOfGraphics.density();\n  figure=(; resolution=(800, 450)),\n)\n\n\n\n\n\nFigure 1: Comparative densities of the fixed-effects coefficients in kbm02samp\n\n\n\n\n\n\nCode\nlet pars = [\"σ1\", \"σ2\", \"σ3\"]\n  draw(\n    data(kbm02tbl) *\n    mapping(pars .=> \"σ\"; color=dims(1) => renamer(pars)) *\n    AlgebraOfGraphics.density();\n    figure=(; resolution=(800, 450)),\n  )\nend\n\n\n\n\n\nFigure 2: Density plot of bootstrap samples standard deviation of random effects\n\n\n\n\n\n\nCode\ndraw(\n  data(kbm02tbl) *\n  mapping(:ρ1 => \"Correlation\") *\n  AlgebraOfGraphics.density();\n  figure=(; resolution=(800, 450)),\n)\n\n\n\n\n\nFigure 3: Density plot of correlation parameters in bootstrap sample from model kbm02\n\n\n\n\n\n\n3 References\n\n\nKronmüller, E., & Barr, D. J. (2007). Perspective-free pragmatics: Broken precedents and the recovery-from-preemption hypothesis. Journal of Memory and Language, 56(3), 436–455. https://doi.org/10.1016/j.jml.2006.05.002\n\n\n\n\n\n\n Back to top"
       },
       {
         "objectID": "glmm.html",
    @@ -228,7 +228,7 @@
         "href": "glmm.html#matrix-notation-for-the-sleepstudy-model",
         "title": "Generalized linear mixed models",
         "section": "1 Matrix notation for the sleepstudy model",
    -    "text": "1 Matrix notation for the sleepstudy model\n\nsleepstudy = DataFrame(dataset(:sleepstudy))\n\n180×3 DataFrame155 rows omitted\n\n\n\nRow\nsubj\ndays\nreaction\n\n\n\nString\nInt8\nFloat64\n\n\n\n\n1\nS308\n0\n249.56\n\n\n2\nS308\n1\n258.705\n\n\n3\nS308\n2\n250.801\n\n\n4\nS308\n3\n321.44\n\n\n5\nS308\n4\n356.852\n\n\n6\nS308\n5\n414.69\n\n\n7\nS308\n6\n382.204\n\n\n8\nS308\n7\n290.149\n\n\n9\nS308\n8\n430.585\n\n\n10\nS308\n9\n466.353\n\n\n11\nS309\n0\n222.734\n\n\n12\nS309\n1\n205.266\n\n\n13\nS309\n2\n202.978\n\n\n⋮\n⋮\n⋮\n⋮\n\n\n169\nS371\n8\n350.781\n\n\n170\nS371\n9\n369.469\n\n\n171\nS372\n0\n269.412\n\n\n172\nS372\n1\n273.474\n\n\n173\nS372\n2\n297.597\n\n\n174\nS372\n3\n310.632\n\n\n175\nS372\n4\n287.173\n\n\n176\nS372\n5\n329.608\n\n\n177\nS372\n6\n334.482\n\n\n178\nS372\n7\n343.22\n\n\n179\nS372\n8\n369.142\n\n\n180\nS372\n9\n364.124\n\n\n\n\n\n\n\ncontrasts = Dict(:subj => Grouping())\nm1 = let f = @formula reaction ~ 1 + days + (1 + days | subj)\n  fit(MixedModel, f, sleepstudy; contrasts)\nend\nprintln(m1)\n\nLinear mixed model fit by maximum likelihood\n reaction ~ 1 + days + (1 + days | subj)\n   logLik   -2 logLik     AIC       AICc        BIC    \n  -875.9697  1751.9393  1763.9393  1764.4249  1783.0971\n\nVariance components:\n            Column    Variance Std.Dev.   Corr.\nsubj     (Intercept)  565.51066 23.78047\n         days          32.68212  5.71683 +0.08\nResidual              654.94145 25.59182\n Number of obs: 180; levels of grouping factors: 18\n\n  Fixed-effects parameters:\n──────────────────────────────────────────────────\n                Coef.  Std. Error      z  Pr(>|z|)\n──────────────────────────────────────────────────\n(Intercept)  251.405      6.63226  37.91    <1e-99\ndays          10.4673     1.50224   6.97    <1e-11\n──────────────────────────────────────────────────\n\n\nThe response vector, y, has 180 elements. The fixed-effects coefficient vector, β, has 2 elements and the fixed-effects model matrix, X, is of size 180 × 2.\n\nm1.y\n\n180-element view(::Matrix{Float64}, :, 3) with eltype Float64:\n 249.56\n 258.7047\n 250.8006\n 321.4398\n 356.8519\n 414.6901\n 382.2038\n 290.1486\n 430.5853\n 466.3535\n 222.7339\n 205.2658\n 202.9778\n   ⋮\n 350.7807\n 369.4692\n 269.4117\n 273.474\n 297.5968\n 310.6316\n 287.1726\n 329.6076\n 334.4818\n 343.2199\n 369.1417\n 364.1236\n\n\n\nm1.β\n\n2-element Vector{Float64}:\n 251.40510484848417\n  10.467285959595896\n\n\n\nm1.X\n\n180×2 Matrix{Float64}:\n 1.0  0.0\n 1.0  1.0\n 1.0  2.0\n 1.0  3.0\n 1.0  4.0\n 1.0  5.0\n 1.0  6.0\n 1.0  7.0\n 1.0  8.0\n 1.0  9.0\n 1.0  0.0\n 1.0  1.0\n 1.0  2.0\n ⋮    \n 1.0  8.0\n 1.0  9.0\n 1.0  0.0\n 1.0  1.0\n 1.0  2.0\n 1.0  3.0\n 1.0  4.0\n 1.0  5.0\n 1.0  6.0\n 1.0  7.0\n 1.0  8.0\n 1.0  9.0\n\n\nThe second column of X is just the days vector and the first column is all 1’s.\nThere are 36 random effects, 2 for each of the 18 levels of subj. The “estimates” (technically, the conditional means or conditional modes) are returned as a vector of matrices, one matrix for each grouping factor. In this case there is only one grouping factor for the random effects so there is one one matrix which contains 18 intercept random effects and 18 slope random effects.\n\nm1.b\n\n1-element Vector{Matrix{Float64}}:\n [2.815818033394916 -40.04844099287436 … 0.7232621645096935 12.118907745826883; 9.075511916305423 -8.644079548078082 … -0.9710526581529085 1.3106980682714398]\n\n\n\nonly(m1.b)   # only one grouping factor\n\n2×18 Matrix{Float64}:\n 2.81582  -40.0484   -38.4331  22.8321   …  -24.7101   0.723262  12.1189\n 9.07551   -8.64408   -5.5134  -4.65872       4.6597  -0.971053   1.3107\n\n\nThere is a model matrix, Z, for the random effects. In general it has one chunk of columns for the first grouping factor, a chunk of columns for the second grouping factor, etc.\nIn this case there is only one grouping factor.\n\nInt.(first(m1.reterms))\n\n180×36 Matrix{Int64}:\n 1  0  0  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  0  0\n 1  1  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  2  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  3  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  4  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  5  0  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  0  0\n 1  6  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  7  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  8  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  9  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 0  0  1  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  0  0\n 0  0  1  1  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 0  0  1  2  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n ⋮              ⋮              ⋮        ⋱     ⋮              ⋮              ⋮\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  1  8  0  0\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  1  9  0  0\n 0  0  0  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  1  0\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  1\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  2\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  3\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  4\n 0  0  0  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  1  5\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  6\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  7\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  8\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  9\n\n\nThe defining property of a linear model or linear mixed model is that the fitted values are linear combinations of the fixed-effects parameters and the random effects. We can write the fitted values as\n\nm1.X * m1.β + only(m1.reterms) * vec(only(m1.b))\n\n180-element Vector{Float64}:\n 254.2209228818791\n 273.7637207577804\n 293.3065186336817\n 312.84931650958305\n 332.3921143854843\n 351.9349122613857\n 371.477710137287\n 391.0205080131883\n 410.56330588908963\n 430.10610376499096\n 211.3566638556098\n 213.17987026712763\n 215.0030766786454\n   ⋮\n 328.09823342453774\n 337.5944667259808\n 263.52401259431105\n 275.3019966221784\n 287.0799806500457\n 298.85796467791306\n 310.6359487057804\n 322.41393273364775\n 334.1919167615151\n 345.96990078938245\n 357.7478848172497\n 369.5258688451171\n\n\n\nfitted(m1)   # just to check that these are indeed the same as calculated above\n\n180-element Vector{Float64}:\n 254.2209228818791\n 273.7637207577804\n 293.3065186336817\n 312.84931650958305\n 332.3921143854843\n 351.9349122613857\n 371.477710137287\n 391.02050801318836\n 410.56330588908963\n 430.10610376499096\n 211.3566638556098\n 213.17987026712763\n 215.0030766786454\n   ⋮\n 328.0982334245378\n 337.5944667259808\n 263.52401259431105\n 275.3019966221784\n 287.07998065004574\n 298.85796467791306\n 310.6359487057804\n 322.41393273364775\n 334.1919167615151\n 345.96990078938245\n 357.74788481724977\n 369.5258688451171\n\n\nIn symbols we would write the linear predictor expression as \\[\n\\boldsymbol{\\eta} = \\mathbf{X}\\boldsymbol{\\beta} +\\mathbf{Z b}\n\\] where \\(\\boldsymbol{\\eta}\\) has 180 elements, \\(\\boldsymbol{\\beta}\\) has 2 elements, \\(\\bf b\\) has 36 elements, \\(\\bf X\\) is of size 180 × 2 and \\(\\bf Z\\) is of size 180 × 36.\nFor a linear model or linear mixed model the linear predictor is the mean response, \\(\\boldsymbol\\mu\\). That is, we can write the probability model in terms of a 180-dimensional random variable, \\(\\mathcal Y\\), for the response and a 36-dimensional random variable, \\(\\mathcal B\\), for the random effects as \\[\n\\begin{aligned}\n(\\mathcal{Y} | \\mathcal{B}=\\bf{b}) &\\sim\\mathcal{N}(\\bf{ X\\boldsymbol\\beta + Z b},\\sigma^2\\bf{I})\\\\\\\\\n\\mathcal{B}&\\sim\\mathcal{N}(\\bf{0},\\boldsymbol{\\Sigma}_{\\boldsymbol\\theta}) .\n\\end{aligned}\n\\] where \\(\\boldsymbol{\\Sigma}_\\boldsymbol{\\theta}\\) is a 36 × 36 symmetric covariance matrix that has a special form - it consists of 18 diagonal blocks, each of size 2 × 2 and all the same.\nRecall that this symmetric matrix can be constructed from the parameters \\(\\boldsymbol\\theta\\), which generate the lower triangular matrix \\(\\boldsymbol\\lambda\\), and the estimate \\(\\widehat{\\sigma^2}\\).\n\nm1.θ\n\n3-element Vector{Float64}:\n 0.9292213081613828\n 0.01816836498823806\n 0.22264488151102485\n\n\n\nλ = only(m1.λ)  # with multiple grouping factors there will be multiple λ's\n\n2×2 LinearAlgebra.LowerTriangular{Float64, Matrix{Float64}}:\n 0.929221    ⋅ \n 0.0181684  0.222645\n\n\n\nΣ = varest(m1) * (λ * λ')\n\n2×2 Matrix{Float64}:\n 565.511  11.057\n  11.057  32.6821\n\n\nCompare the diagonal elements to the Variance column of\n\nVarCorr(m1)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nsubj\n(Intercept)\n565.51066\n23.78047\n\n\n\n\ndays\n32.68212\n5.71683\n+0.08\n\n\nResidual\n\n654.94145\n25.59182"
    +    "text": "1 Matrix notation for the sleepstudy model\n\nsleepstudy = DataFrame(dataset(:sleepstudy))\n\n180×3 DataFrame155 rows omitted\n\n\n\nRow\nsubj\ndays\nreaction\n\n\n\nString\nInt8\nFloat64\n\n\n\n\n1\nS308\n0\n249.56\n\n\n2\nS308\n1\n258.705\n\n\n3\nS308\n2\n250.801\n\n\n4\nS308\n3\n321.44\n\n\n5\nS308\n4\n356.852\n\n\n6\nS308\n5\n414.69\n\n\n7\nS308\n6\n382.204\n\n\n8\nS308\n7\n290.149\n\n\n9\nS308\n8\n430.585\n\n\n10\nS308\n9\n466.353\n\n\n11\nS309\n0\n222.734\n\n\n12\nS309\n1\n205.266\n\n\n13\nS309\n2\n202.978\n\n\n⋮\n⋮\n⋮\n⋮\n\n\n169\nS371\n8\n350.781\n\n\n170\nS371\n9\n369.469\n\n\n171\nS372\n0\n269.412\n\n\n172\nS372\n1\n273.474\n\n\n173\nS372\n2\n297.597\n\n\n174\nS372\n3\n310.632\n\n\n175\nS372\n4\n287.173\n\n\n176\nS372\n5\n329.608\n\n\n177\nS372\n6\n334.482\n\n\n178\nS372\n7\n343.22\n\n\n179\nS372\n8\n369.142\n\n\n180\nS372\n9\n364.124\n\n\n\n\n\n\n\ncontrasts = Dict(:subj => Grouping())\nm1 = let f = @formula reaction ~ 1 + days + (1 + days | subj)\n  fit(MixedModel, f, sleepstudy; contrasts)\nend\nprintln(m1)\n\nLinear mixed model fit by maximum likelihood\n reaction ~ 1 + days + (1 + days | subj)\n   logLik   -2 logLik     AIC       AICc        BIC    \n  -875.9697  1751.9393  1763.9393  1764.4249  1783.0971\n\nVariance components:\n            Column    Variance Std.Dev.   Corr.\nsubj     (Intercept)  565.51068 23.78047\n         days          32.68212  5.71683 +0.08\nResidual              654.94145 25.59182\n Number of obs: 180; levels of grouping factors: 18\n\n  Fixed-effects parameters:\n──────────────────────────────────────────────────\n                Coef.  Std. Error      z  Pr(>|z|)\n──────────────────────────────────────────────────\n(Intercept)  251.405      6.63226  37.91    <1e-99\ndays          10.4673     1.50224   6.97    <1e-11\n──────────────────────────────────────────────────\n\n\nThe response vector, y, has 180 elements. The fixed-effects coefficient vector, β, has 2 elements and the fixed-effects model matrix, X, is of size 180 × 2.\n\nm1.y\n\n180-element view(::Matrix{Float64}, :, 3) with eltype Float64:\n 249.56\n 258.7047\n 250.8006\n 321.4398\n 356.8519\n 414.6901\n 382.2038\n 290.1486\n 430.5853\n 466.3535\n 222.7339\n 205.2658\n 202.9778\n   ⋮\n 350.7807\n 369.4692\n 269.4117\n 273.474\n 297.5968\n 310.6316\n 287.1726\n 329.6076\n 334.4818\n 343.2199\n 369.1417\n 364.1236\n\n\n\nm1.β\n\n2-element Vector{Float64}:\n 251.4051048484848\n  10.467285959595449\n\n\n\nm1.X\n\n180×2 Matrix{Float64}:\n 1.0  0.0\n 1.0  1.0\n 1.0  2.0\n 1.0  3.0\n 1.0  4.0\n 1.0  5.0\n 1.0  6.0\n 1.0  7.0\n 1.0  8.0\n 1.0  9.0\n 1.0  0.0\n 1.0  1.0\n 1.0  2.0\n ⋮    \n 1.0  8.0\n 1.0  9.0\n 1.0  0.0\n 1.0  1.0\n 1.0  2.0\n 1.0  3.0\n 1.0  4.0\n 1.0  5.0\n 1.0  6.0\n 1.0  7.0\n 1.0  8.0\n 1.0  9.0\n\n\nThe second column of X is just the days vector and the first column is all 1’s.\nThere are 36 random effects, 2 for each of the 18 levels of subj. The “estimates” (technically, the conditional means or conditional modes) are returned as a vector of matrices, one matrix for each grouping factor. In this case there is only one grouping factor for the random effects so there is one one matrix which contains 18 intercept random effects and 18 slope random effects.\n\nm1.b\n\n1-element Vector{Matrix{Float64}}:\n [2.8158188723726987 -40.04844155099845 … 0.7232620681342852 12.118907791462991; 9.07551177315976 -8.64407948654385 … -0.9710526407852382 1.3106980710461535]\n\n\n\nonly(m1.b)   # only one grouping factor\n\n2×18 Matrix{Float64}:\n 2.81582  -40.0484   -38.4331  22.8321   …  -24.7101   0.723262  12.1189\n 9.07551   -8.64408   -5.5134  -4.65872       4.6597  -0.971053   1.3107\n\n\nThere is a model matrix, Z, for the random effects. In general it has one chunk of columns for the first grouping factor, a chunk of columns for the second grouping factor, etc.\nIn this case there is only one grouping factor.\n\nInt.(first(m1.reterms))\n\n180×36 Matrix{Int64}:\n 1  0  0  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  0  0\n 1  1  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  2  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  3  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  4  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  5  0  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  0  0\n 1  6  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  7  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  8  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 1  9  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 0  0  1  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  0  0\n 0  0  1  1  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n 0  0  1  2  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  0  0\n ⋮              ⋮              ⋮        ⋱     ⋮              ⋮              ⋮\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  1  8  0  0\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  1  9  0  0\n 0  0  0  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  1  0\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  1\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  2\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  3\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  4\n 0  0  0  0  0  0  0  0  0  0  0  0  0  …  0  0  0  0  0  0  0  0  0  0  1  5\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  6\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  7\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  8\n 0  0  0  0  0  0  0  0  0  0  0  0  0     0  0  0  0  0  0  0  0  0  0  1  9\n\n\nThe defining property of a linear model or linear mixed model is that the fitted values are linear combinations of the fixed-effects parameters and the random effects. We can write the fitted values as\n\nm1.X * m1.β + only(m1.reterms) * vec(only(m1.b))\n\n180-element Vector{Float64}:\n 254.22092372085748\n 273.7637214536127\n 293.30651918636795\n 312.8493169191231\n 332.39211465187833\n 351.93491238463355\n 371.47771011738877\n 391.020507850144\n 410.56330558289915\n 430.1061033156544\n 211.35666329748636\n 213.17986977053795\n 215.00307624358956\n   ⋮\n 328.0982334671007\n 337.594466785911\n 263.5240126399478\n 275.3019966705894\n 287.079980701231\n 298.8579647318726\n 310.6359487625142\n 322.41393279315577\n 334.1919168237974\n 345.969900854439\n 357.74788488508057\n 369.52586891572224\n\n\n\nfitted(m1)   # just to check that these are indeed the same as calculated above\n\n180-element Vector{Float64}:\n 254.22092372085748\n 273.7637214536127\n 293.30651918636795\n 312.8493169191231\n 332.39211465187833\n 351.9349123846335\n 371.4777101173887\n 391.020507850144\n 410.56330558289915\n 430.10610331565437\n 211.35666329748636\n 213.17986977053792\n 215.00307624358956\n   ⋮\n 328.0982334671007\n 337.594466785911\n 263.5240126399478\n 275.3019966705894\n 287.079980701231\n 298.8579647318726\n 310.6359487625142\n 322.4139327931558\n 334.19191682379744\n 345.96990085443906\n 357.7478848850806\n 369.52586891572224\n\n\nIn symbols we would write the linear predictor expression as \\[\n\\boldsymbol{\\eta} = \\mathbf{X}\\boldsymbol{\\beta} +\\mathbf{Z b}\n\\] where \\(\\boldsymbol{\\eta}\\) has 180 elements, \\(\\boldsymbol{\\beta}\\) has 2 elements, \\(\\bf b\\) has 36 elements, \\(\\bf X\\) is of size 180 × 2 and \\(\\bf Z\\) is of size 180 × 36.\nFor a linear model or linear mixed model the linear predictor is the mean response, \\(\\boldsymbol\\mu\\). That is, we can write the probability model in terms of a 180-dimensional random variable, \\(\\mathcal Y\\), for the response and a 36-dimensional random variable, \\(\\mathcal B\\), for the random effects as \\[\n\\begin{aligned}\n(\\mathcal{Y} | \\mathcal{B}=\\bf{b}) &\\sim\\mathcal{N}(\\bf{ X\\boldsymbol\\beta + Z b},\\sigma^2\\bf{I})\\\\\\\\\n\\mathcal{B}&\\sim\\mathcal{N}(\\bf{0},\\boldsymbol{\\Sigma}_{\\boldsymbol\\theta}) .\n\\end{aligned}\n\\] where \\(\\boldsymbol{\\Sigma}_\\boldsymbol{\\theta}\\) is a 36 × 36 symmetric covariance matrix that has a special form - it consists of 18 diagonal blocks, each of size 2 × 2 and all the same.\nRecall that this symmetric matrix can be constructed from the parameters \\(\\boldsymbol\\theta\\), which generate the lower triangular matrix \\(\\boldsymbol\\lambda\\), and the estimate \\(\\widehat{\\sigma^2}\\).\n\nm1.θ\n\n3-element Vector{Float64}:\n 0.9292213200493655\n 0.01816837940083566\n 0.22264487715036416\n\n\n\nλ = only(m1.λ)  # with multiple grouping factors there will be multiple λ's\n\n2×2 LinearAlgebra.LowerTriangular{Float64, Matrix{Float64}}:\n 0.929221    ⋅ \n 0.0181684  0.222645\n\n\n\nΣ = varest(m1) * (λ * λ')\n\n2×2 Matrix{Float64}:\n 565.511  11.057\n  11.057  32.6821\n\n\nCompare the diagonal elements to the Variance column of\n\nVarCorr(m1)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nsubj\n(Intercept)\n565.51068\n23.78047\n\n\n\n\ndays\n32.68212\n5.71683\n+0.08\n\n\nResidual\n\n654.94145\n25.59182"
       },
       {
         "objectID": "glmm.html#linear-predictors-in-lmms-and-glmms",
    @@ -242,7 +242,7 @@
         "href": "glmm.html#generalized-linear-mixed-models",
         "title": "Generalized linear mixed models",
         "section": "3 Generalized Linear Mixed Models",
    -    "text": "3 Generalized Linear Mixed Models\nConsider first a GLMM for a vector, \\(\\bf y\\), of binary (i.e. yes/no) responses. The probability model for the conditional distribution \\(\\mathcal Y|\\mathcal B=\\bf b\\) consists of independent Bernoulli distributions where the mean, \\(\\mu_i\\), for the i’th response is again determined by the i’th element of a linear predictor, \\(\\boldsymbol\\eta = \\mathbf{X}\\boldsymbol\\beta+\\mathbf{Z b}\\).\nHowever, in this case we will run into trouble if we try to make \\(\\boldsymbol\\mu=\\boldsymbol\\eta\\) because \\(\\mu_i\\) is the probability of “success” for the i’th response and must be between 0 and 1. We can’t guarantee that the i’th component of \\(\\boldsymbol\\eta\\) will be between 0 and 1. To get around this problem we apply a transformation to take \\(\\eta_i\\) to \\(\\mu_i\\). For historical reasons this transformation is called the inverse link, written \\(g^{-1}\\), and the opposite transformation - from the probability scale to an unbounded scale - is called the link, g.\nEach probability distribution in the exponential family (which is most of the important ones), has a canonical link which comes from the form of the distribution itself. The details aren’t as important as recognizing that the distribution itself determines a preferred link function.\nFor the Bernoulli distribution, the canonical link is the logit or log-odds function, \\[\n\\eta = g(\\mu) = \\log\\left(\\frac{\\mu}{1-\\mu}\\right),\n\\] (it’s called log-odds because it is the logarithm of the odds ratio, \\(p/(1-p)\\)) and the canonical inverse link is the logistic \\[\n\\mu=g^{-1}(\\eta)=\\frac{1}{1+\\exp(-\\eta)}.\n\\] This is why fitting a binary response is sometimes called logistic regression.\nFor later use we define a Julia logistic function. See this presentation for more information than you could possibly want to know on how Julia converts code like this to run on the processor.\n\nincrement(x) = x + one(x)\nlogistic(η) = inv(increment(exp(-η)))\n\nlogistic (generic function with 1 method)\n\n\nTo reiterate, the probability model for a Generalized Linear Mixed Model (GLMM) is \\[\n\\begin{aligned}\n(\\mathcal{Y} | \\mathcal{B}=\\bf{b}) &\\sim\\mathcal{D}(\\bf{g^{-1}(X\\boldsymbol\\beta + Z b)},\\phi)\\\\\\\\\n\\mathcal{B}&\\sim\\mathcal{N}(\\bf{0},\\Sigma_{\\boldsymbol\\theta}) .\n\\end{aligned}\n\\] where \\(\\mathcal{D}\\) is the distribution family (such as Bernoulli or Poisson), \\(g^{-1}\\) is the inverse link and \\(\\phi\\) is a scale parameter for \\(\\mathcal{D}\\) if it has one. The important cases of the Bernoulli and Poisson distributions don’t have a scale parameter - once you know the mean you know everything you need to know about the distribution. (For those following the presentation, this poem by John Keats is the one with the couplet “Beauty is truth, truth beauty - that is all ye know on earth and all ye need to know.”)\n\n3.1 An example of a Bernoulli GLMM\nThe contra dataset in the MixedModels package is from a survey on the use of artificial contraception by women in Bangladesh.\n\ncontra = DataFrame(dataset(:contra))\n\n1934×5 DataFrame1909 rows omitted\n\n\n\nRow\ndist\nurban\nlivch\nage\nuse\n\n\n\nString\nString\nString\nFloat64\nString\n\n\n\n\n1\nD01\nY\n3+\n18.44\nN\n\n\n2\nD01\nY\n0\n-5.56\nN\n\n\n3\nD01\nY\n2\n1.44\nN\n\n\n4\nD01\nY\n3+\n8.44\nN\n\n\n5\nD01\nY\n0\n-13.56\nN\n\n\n6\nD01\nY\n0\n-11.56\nN\n\n\n7\nD01\nY\n3+\n18.44\nN\n\n\n8\nD01\nY\n3+\n-3.56\nN\n\n\n9\nD01\nY\n1\n-5.56\nN\n\n\n10\nD01\nY\n3+\n1.44\nN\n\n\n11\nD01\nY\n0\n-11.56\nY\n\n\n12\nD01\nY\n0\n-2.56\nN\n\n\n13\nD01\nY\n1\n-4.56\nN\n\n\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n\n\n1923\nD61\nN\n0\n-11.56\nY\n\n\n1924\nD61\nN\n3+\n1.44\nN\n\n\n1925\nD61\nN\n1\n-5.56\nN\n\n\n1926\nD61\nN\n3+\n14.44\nN\n\n\n1927\nD61\nN\n3+\n19.44\nN\n\n\n1928\nD61\nN\n2\n-9.56\nY\n\n\n1929\nD61\nN\n2\n-2.56\nN\n\n\n1930\nD61\nN\n3+\n14.44\nN\n\n\n1931\nD61\nN\n2\n-4.56\nN\n\n\n1932\nD61\nN\n3+\n14.44\nN\n\n\n1933\nD61\nN\n0\n-13.56\nN\n\n\n1934\nD61\nN\n3+\n10.44\nN\n\n\n\n\n\n\n\ncombine(groupby(contra, :dist), nrow)\n\n60×2 DataFrame35 rows omitted\n\n\n\nRow\ndist\nnrow\n\n\n\nString\nInt64\n\n\n\n\n1\nD01\n117\n\n\n2\nD02\n20\n\n\n3\nD03\n2\n\n\n4\nD04\n30\n\n\n5\nD05\n39\n\n\n6\nD06\n65\n\n\n7\nD07\n18\n\n\n8\nD08\n37\n\n\n9\nD09\n23\n\n\n10\nD10\n13\n\n\n11\nD11\n21\n\n\n12\nD12\n29\n\n\n13\nD13\n24\n\n\n⋮\n⋮\n⋮\n\n\n49\nD49\n4\n\n\n50\nD50\n19\n\n\n51\nD51\n37\n\n\n52\nD52\n61\n\n\n53\nD53\n19\n\n\n54\nD55\n6\n\n\n55\nD56\n45\n\n\n56\nD57\n27\n\n\n57\nD58\n33\n\n\n58\nD59\n10\n\n\n59\nD60\n32\n\n\n60\nD61\n42\n\n\n\n\n\n\nThe information recorded included woman’s age, the number of live children she has, whether she lives in an urban or rural setting, and the political district in which she lives.\nThe age was centered. Unfortunately, the version of the data to which I had access did not record what the centering value was.\nA data plot, Figure 1, shows that the probability of contraception use is not linear in age - it is low for younger women, higher for women in the middle of the range (assumed to be women in late 20’s to early 30’s) and low again for older women (late 30’s to early 40’s in this survey).\nIf we fit a model with only the age term in the fixed effects, that term will not be significant. This doesn’t mean that there is no “age effect”, it only means that there is no significant linear effect for age.\n\n\nCode\ndraw(\n  data(\n    @transform(\n      contra,\n      :numuse = Int(:use == \"Y\"),\n      :urb = ifelse(:urban == \"Y\", \"Urban\", \"Rural\")\n    )\n  ) *\n  mapping(\n    :age => \"Centered age (yr)\",\n    :numuse => \"Frequency of contraception use\";\n    col=:urb,\n    color=:livch,\n  ) *\n  smooth();\n  figure=(; resolution=(800, 450)),\n)\n\n\n\n\n\nFigure 1: Smoothed relative frequency of contraception use versus centered age for women in the 1989 Bangladesh Fertility Survey\n\n\n\n\n\ncontrasts = Dict(\n  :dist => Grouping(),\n  :urban => HelmertCoding(),\n  :livch => DummyCoding(), # default, but no harm in being explicit\n)\nnAGQ = 9\ndist = Bernoulli()\ngm1 = let\n  form = @formula(\n    use ~ 1 + age + abs2(age) + urban + livch + (1 | dist)\n  )\n  fit(MixedModel, form, contra, dist; nAGQ, contrasts)\nend\n\nMinimizing 199   Time: 0:00:00 ( 2.51 ms/it)\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_dist\n\n\n\n\n(Intercept)\n-0.6871\n0.1686\n-4.08\n<1e-04\n0.4787\n\n\nage\n0.0035\n0.0092\n0.38\n0.7023\n\n\n\nabs2(age)\n-0.0046\n0.0007\n-6.29\n<1e-09\n\n\n\nurban: Y\n0.3483\n0.0600\n5.81\n<1e-08\n\n\n\nlivch: 1\n0.8152\n0.1622\n5.02\n<1e-06\n\n\n\nlivch: 2\n0.9165\n0.1851\n4.95\n<1e-06\n\n\n\nlivch: 3+\n0.9154\n0.1858\n4.93\n<1e-06\n\n\n\n\n\n\nNotice that the linear term for age is not significant but the quadratic term for age is highly significant. We usually retain the lower order term, even if it is not significant, if the higher order term is significant.\nNotice also that the parameter estimates for the treatment contrasts for livch are similar. Thus the distinction of 1, 2, or 3+ childen is not as important as the contrast between having any children and not having any. Those women who already have children are more likely to use artificial contraception.\nFurthermore, the women without children have a different probability vs age profile than the women with children. To allow for this we define a binary children factor and incorporate an age&children interaction.\n\nVarCorr(gm1)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\n\n\n\n\ndist\n(Intercept)\n0.229113\n0.478657\n\n\n\n\n\nNotice that there is no “residual” variance being estimated. This is because the Bernoulli distribution doesn’t have a scale parameter.\n\n\n3.2 Convert livch to a binary factor\n\n@transform!(contra, :children = :livch ≠ \"0\")\n# add the associated contrast specifier\ncontrasts[:children] = EffectsCoding()\n\nEffectsCoding(nothing, nothing)\n\n\n\ngm2 = let\n  form = @formula(\n    use ~\n      1 +\n      age * children +\n      abs2(age) +\n      children +\n      urban +\n      (1 | dist)\n  )\n  fit(MixedModel, form, contra, dist; nAGQ, contrasts)\nend\n\nMinimizing 144   Time: 0:00:00 ( 1.01 ms/it)\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_dist\n\n\n\n\n(Intercept)\n-0.3614\n0.1275\n-2.84\n0.0046\n0.4757\n\n\nage\n-0.0131\n0.0110\n-1.19\n0.2352\n\n\n\nchildren: true\n0.6054\n0.1035\n5.85\n<1e-08\n\n\n\nabs2(age)\n-0.0058\n0.0008\n-6.89\n<1e-11\n\n\n\nurban: Y\n0.3567\n0.0602\n5.93\n<1e-08\n\n\n\nage & children: true\n0.0342\n0.0127\n2.69\n0.0072\n\n\n\n\n\n\n\n\nCode\nlet\n  mods = [gm2, gm1]\n  DataFrame(;\n    model=[:gm2, :gm1],\n    npar=dof.(mods),\n    deviance=deviance.(mods),\n    AIC=aic.(mods),\n    BIC=bic.(mods),\n    AICc=aicc.(mods),\n  )\nend\n\n\n2×6 DataFrame\n\n\n\nRow\nmodel\nnpar\ndeviance\nAIC\nBIC\nAICc\n\n\n\nSymbol\nInt64\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\ngm2\n7\n2364.92\n2379.18\n2418.15\n2379.24\n\n\n2\ngm1\n8\n2372.46\n2388.73\n2433.27\n2388.81\n\n\n\n\n\n\nBecause these models are not nested, we cannot do a likelihood ratio test. Nevertheless we see that the deviance is much lower in the model with age & children even though the 3 levels of livch have been collapsed into a single level of children. There is a substantial decrease in the deviance even though there are fewer parameters in model gm2 than in gm1. This decrease is because the flexibility of the model - its ability to model the behavior of the response - is being put to better use in gm2 than in gm1.\nAt present the calculation of the geomdof as sum(influence(m)) is not correctly defined in our code for a GLMM so we need to do some more work before we can examine those values.\n\n\n3.3 Using urban&dist as a grouping factor\nIt turns out that there can be more difference between urban and rural settings within the same political district than there is between districts. To model this difference we build a model with urban&dist as a grouping factor.\n\ngm3 = let\n  form = @formula(\n    use ~\n      1 +\n      age * children +\n      abs2(age) +\n      children +\n      urban +\n      (1 | urban & dist)\n  )\n  fit(MixedModel, form, contra, dist; nAGQ, contrasts)\nend\n\nMinimizing 140   Time: 0:00:00 ( 1.02 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_urban & dist\n\n\n\n\n(Intercept)\n-0.3415\n0.1269\n-2.69\n0.0071\n0.5761\n\n\nage\n-0.0129\n0.0112\n-1.16\n0.2471\n\n\n\nchildren: true\n0.6065\n0.1045\n5.80\n<1e-08\n\n\n\nabs2(age)\n-0.0056\n0.0008\n-6.66\n<1e-10\n\n\n\nurban: Y\n0.3936\n0.0859\n4.58\n<1e-05\n\n\n\nage & children: true\n0.0332\n0.0128\n2.59\n0.0096\n\n\n\n\n\n\n\n\nCode\nlet\n  mods = [gm3, gm2, gm1]\n  DataFrame(;\n    model=[:gm3, :gm2, :gm1],\n    npar=dof.(mods),\n    deviance=deviance.(mods),\n    AIC=aic.(mods),\n    BIC=bic.(mods),\n    AICc=aicc.(mods),\n  )\nend\n\n\n3×6 DataFrame\n\n\n\nRow\nmodel\nnpar\ndeviance\nAIC\nBIC\nAICc\n\n\n\nSymbol\nInt64\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\ngm3\n7\n2353.82\n2368.48\n2407.45\n2368.54\n\n\n2\ngm2\n7\n2364.92\n2379.18\n2418.15\n2379.24\n\n\n3\ngm1\n8\n2372.46\n2388.73\n2433.27\n2388.81\n\n\n\n\n\n\nNotice that the parameter count in gm3 is the same as that of gm2 - the thing that has changed is the number of levels of the grouping factor- resulting in a much lower deviance for gm3. This reinforces the idea that a simple count of the number of parameters to be estimated does not always reflect the complexity of the model.\n\ngm2\n\n\n\n\n\nEst.\nSE\nz\np\nσ_dist\n\n\n\n\n(Intercept)\n-0.3614\n0.1275\n-2.84\n0.0046\n0.4757\n\n\nage\n-0.0131\n0.0110\n-1.19\n0.2352\n\n\n\nchildren: true\n0.6054\n0.1035\n5.85\n<1e-08\n\n\n\nabs2(age)\n-0.0058\n0.0008\n-6.89\n<1e-11\n\n\n\nurban: Y\n0.3567\n0.0602\n5.93\n<1e-08\n\n\n\nage & children: true\n0.0342\n0.0127\n2.69\n0.0072\n\n\n\n\n\n\n\ngm3\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_urban & dist\n\n\n\n\n(Intercept)\n-0.3415\n0.1269\n-2.69\n0.0071\n0.5761\n\n\nage\n-0.0129\n0.0112\n-1.16\n0.2471\n\n\n\nchildren: true\n0.6065\n0.1045\n5.80\n<1e-08\n\n\n\nabs2(age)\n-0.0056\n0.0008\n-6.66\n<1e-10\n\n\n\nurban: Y\n0.3936\n0.0859\n4.58\n<1e-05\n\n\n\nage & children: true\n0.0332\n0.0128\n2.59\n0.0096\n\n\n\n\n\n\nThe coefficient for age may be regarded as insignificant but we retain it for two reasons: we have a term of age² (written abs2(age)) in the model and we have a significant interaction age & children in the model.\n\n\n3.4 Predictions for some subgroups\nFor a “typical” district (random effect near zero) the predictions on the linear predictor scale for a woman whose age is near the centering value (i.e. centered age of zero) are:\n\nusing Effects\ndesign = Dict(\n  :children => [true, false], :urban => [\"Y\", \"N\"], :age => [0.0]\n)\npreds = effects(design, gm3)\n\n4×7 DataFrame\n\n\n\nRow\nchildren\nage\nurban\nuse: Y\nerr\nlower\nupper\n\n\n\nBool\nFloat64\nString\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\ntrue\n0.0\nY\n0.658576\n0.150529\n0.508047\n0.809105\n\n\n2\nfalse\n0.0\nY\n-0.554337\n0.230477\n-0.784814\n-0.323861\n\n\n3\ntrue\n0.0\nN\n-0.128612\n0.113016\n-0.241628\n-0.0155953\n\n\n4\nfalse\n0.0\nN\n-1.34152\n0.221575\n-1.5631\n-1.11995\n\n\n\n\n\n\nConverting these η values to probabilities yields\n\nlogistic.(preds[!, \"use: Y\"])\n\n4-element Vector{Float64}:\n 0.6589404203024364\n 0.364858723221093\n 0.46789132742910544\n 0.2072594086310126"
    +    "text": "3 Generalized Linear Mixed Models\nConsider first a GLMM for a vector, \\(\\bf y\\), of binary (i.e. yes/no) responses. The probability model for the conditional distribution \\(\\mathcal Y|\\mathcal B=\\bf b\\) consists of independent Bernoulli distributions where the mean, \\(\\mu_i\\), for the i’th response is again determined by the i’th element of a linear predictor, \\(\\boldsymbol\\eta = \\mathbf{X}\\boldsymbol\\beta+\\mathbf{Z b}\\).\nHowever, in this case we will run into trouble if we try to make \\(\\boldsymbol\\mu=\\boldsymbol\\eta\\) because \\(\\mu_i\\) is the probability of “success” for the i’th response and must be between 0 and 1. We can’t guarantee that the i’th component of \\(\\boldsymbol\\eta\\) will be between 0 and 1. To get around this problem we apply a transformation to take \\(\\eta_i\\) to \\(\\mu_i\\). For historical reasons this transformation is called the inverse link, written \\(g^{-1}\\), and the opposite transformation - from the probability scale to an unbounded scale - is called the link, g.\nEach probability distribution in the exponential family (which is most of the important ones), has a canonical link which comes from the form of the distribution itself. The details aren’t as important as recognizing that the distribution itself determines a preferred link function.\nFor the Bernoulli distribution, the canonical link is the logit or log-odds function, \\[\n\\eta = g(\\mu) = \\log\\left(\\frac{\\mu}{1-\\mu}\\right),\n\\] (it’s called log-odds because it is the logarithm of the odds ratio, \\(p/(1-p)\\)) and the canonical inverse link is the logistic \\[\n\\mu=g^{-1}(\\eta)=\\frac{1}{1+\\exp(-\\eta)}.\n\\] This is why fitting a binary response is sometimes called logistic regression.\nFor later use we define a Julia logistic function. See this presentation for more information than you could possibly want to know on how Julia converts code like this to run on the processor.\n\nincrement(x) = x + one(x)\nlogistic(η) = inv(increment(exp(-η)))\n\nlogistic (generic function with 1 method)\n\n\nTo reiterate, the probability model for a Generalized Linear Mixed Model (GLMM) is \\[\n\\begin{aligned}\n(\\mathcal{Y} | \\mathcal{B}=\\bf{b}) &\\sim\\mathcal{D}(\\bf{g^{-1}(X\\boldsymbol\\beta + Z b)},\\phi)\\\\\\\\\n\\mathcal{B}&\\sim\\mathcal{N}(\\bf{0},\\Sigma_{\\boldsymbol\\theta}) .\n\\end{aligned}\n\\] where \\(\\mathcal{D}\\) is the distribution family (such as Bernoulli or Poisson), \\(g^{-1}\\) is the inverse link and \\(\\phi\\) is a scale parameter for \\(\\mathcal{D}\\) if it has one. The important cases of the Bernoulli and Poisson distributions don’t have a scale parameter - once you know the mean you know everything you need to know about the distribution. (For those following the presentation, this poem by John Keats is the one with the couplet “Beauty is truth, truth beauty - that is all ye know on earth and all ye need to know.”)\n\n3.1 An example of a Bernoulli GLMM\nThe contra dataset in the MixedModels package is from a survey on the use of artificial contraception by women in Bangladesh.\n\ncontra = DataFrame(dataset(:contra))\n\n1934×5 DataFrame1909 rows omitted\n\n\n\nRow\ndist\nurban\nlivch\nage\nuse\n\n\n\nString\nString\nString\nFloat64\nString\n\n\n\n\n1\nD01\nY\n3+\n18.44\nN\n\n\n2\nD01\nY\n0\n-5.56\nN\n\n\n3\nD01\nY\n2\n1.44\nN\n\n\n4\nD01\nY\n3+\n8.44\nN\n\n\n5\nD01\nY\n0\n-13.56\nN\n\n\n6\nD01\nY\n0\n-11.56\nN\n\n\n7\nD01\nY\n3+\n18.44\nN\n\n\n8\nD01\nY\n3+\n-3.56\nN\n\n\n9\nD01\nY\n1\n-5.56\nN\n\n\n10\nD01\nY\n3+\n1.44\nN\n\n\n11\nD01\nY\n0\n-11.56\nY\n\n\n12\nD01\nY\n0\n-2.56\nN\n\n\n13\nD01\nY\n1\n-4.56\nN\n\n\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n\n\n1923\nD61\nN\n0\n-11.56\nY\n\n\n1924\nD61\nN\n3+\n1.44\nN\n\n\n1925\nD61\nN\n1\n-5.56\nN\n\n\n1926\nD61\nN\n3+\n14.44\nN\n\n\n1927\nD61\nN\n3+\n19.44\nN\n\n\n1928\nD61\nN\n2\n-9.56\nY\n\n\n1929\nD61\nN\n2\n-2.56\nN\n\n\n1930\nD61\nN\n3+\n14.44\nN\n\n\n1931\nD61\nN\n2\n-4.56\nN\n\n\n1932\nD61\nN\n3+\n14.44\nN\n\n\n1933\nD61\nN\n0\n-13.56\nN\n\n\n1934\nD61\nN\n3+\n10.44\nN\n\n\n\n\n\n\n\ncombine(groupby(contra, :dist), nrow)\n\n60×2 DataFrame35 rows omitted\n\n\n\nRow\ndist\nnrow\n\n\n\nString\nInt64\n\n\n\n\n1\nD01\n117\n\n\n2\nD02\n20\n\n\n3\nD03\n2\n\n\n4\nD04\n30\n\n\n5\nD05\n39\n\n\n6\nD06\n65\n\n\n7\nD07\n18\n\n\n8\nD08\n37\n\n\n9\nD09\n23\n\n\n10\nD10\n13\n\n\n11\nD11\n21\n\n\n12\nD12\n29\n\n\n13\nD13\n24\n\n\n⋮\n⋮\n⋮\n\n\n49\nD49\n4\n\n\n50\nD50\n19\n\n\n51\nD51\n37\n\n\n52\nD52\n61\n\n\n53\nD53\n19\n\n\n54\nD55\n6\n\n\n55\nD56\n45\n\n\n56\nD57\n27\n\n\n57\nD58\n33\n\n\n58\nD59\n10\n\n\n59\nD60\n32\n\n\n60\nD61\n42\n\n\n\n\n\n\nThe information recorded included woman’s age, the number of live children she has, whether she lives in an urban or rural setting, and the political district in which she lives.\nThe age was centered. Unfortunately, the version of the data to which I had access did not record what the centering value was.\nA data plot, Figure 1, shows that the probability of contraception use is not linear in age - it is low for younger women, higher for women in the middle of the range (assumed to be women in late 20’s to early 30’s) and low again for older women (late 30’s to early 40’s in this survey).\nIf we fit a model with only the age term in the fixed effects, that term will not be significant. This doesn’t mean that there is no “age effect”, it only means that there is no significant linear effect for age.\n\n\nCode\ndraw(\n  data(\n    @transform(\n      contra,\n      :numuse = Int(:use == \"Y\"),\n      :urb = ifelse(:urban == \"Y\", \"Urban\", \"Rural\")\n    )\n  ) *\n  mapping(\n    :age => \"Centered age (yr)\",\n    :numuse => \"Frequency of contraception use\";\n    col=:urb,\n    color=:livch,\n  ) *\n  smooth();\n  figure=(; resolution=(800, 450)),\n)\n\n\n\n\n\nFigure 1: Smoothed relative frequency of contraception use versus centered age for women in the 1989 Bangladesh Fertility Survey\n\n\n\n\n\ncontrasts = Dict(\n  :dist => Grouping(),\n  :urban => HelmertCoding(),\n  :livch => DummyCoding(), # default, but no harm in being explicit\n)\nnAGQ = 9\ndist = Bernoulli()\ngm1 = let\n  form = @formula(\n    use ~ 1 + age + abs2(age) + urban + livch + (1 | dist)\n  )\n  fit(MixedModel, form, contra, dist; nAGQ, contrasts)\nend\n\nMinimizing 206   Time: 0:00:00 ( 1.72 ms/it)\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_dist\n\n\n\n\n(Intercept)\n-0.6870\n0.1686\n-4.08\n<1e-04\n0.4786\n\n\nage\n0.0035\n0.0092\n0.38\n0.7020\n\n\n\nabs2(age)\n-0.0046\n0.0007\n-6.29\n<1e-09\n\n\n\nurban: Y\n0.3484\n0.0600\n5.81\n<1e-08\n\n\n\nlivch: 1\n0.8152\n0.1622\n5.02\n<1e-06\n\n\n\nlivch: 2\n0.9165\n0.1851\n4.95\n<1e-06\n\n\n\nlivch: 3+\n0.9153\n0.1858\n4.93\n<1e-06\n\n\n\n\n\n\nNotice that the linear term for age is not significant but the quadratic term for age is highly significant. We usually retain the lower order term, even if it is not significant, if the higher order term is significant.\nNotice also that the parameter estimates for the treatment contrasts for livch are similar. Thus the distinction of 1, 2, or 3+ childen is not as important as the contrast between having any children and not having any. Those women who already have children are more likely to use artificial contraception.\nFurthermore, the women without children have a different probability vs age profile than the women with children. To allow for this we define a binary children factor and incorporate an age&children interaction.\n\nVarCorr(gm1)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\n\n\n\n\ndist\n(Intercept)\n0.22909\n0.47863\n\n\n\n\n\nNotice that there is no “residual” variance being estimated. This is because the Bernoulli distribution doesn’t have a scale parameter.\n\n\n3.2 Convert livch to a binary factor\n\n@transform!(contra, :children = :livch ≠ \"0\")\n# add the associated contrast specifier\ncontrasts[:children] = EffectsCoding()\n\nEffectsCoding(nothing, nothing)\n\n\n\ngm2 = let\n  form = @formula(\n    use ~\n      1 +\n      age * children +\n      abs2(age) +\n      children +\n      urban +\n      (1 | dist)\n  )\n  fit(MixedModel, form, contra, dist; nAGQ, contrasts)\nend\n\nMinimizing 149   Time: 0:00:00 ( 0.94 ms/it)\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_dist\n\n\n\n\n(Intercept)\n-0.3614\n0.1275\n-2.84\n0.0046\n0.4757\n\n\nage\n-0.0131\n0.0110\n-1.19\n0.2352\n\n\n\nchildren: true\n0.6054\n0.1035\n5.85\n<1e-08\n\n\n\nabs2(age)\n-0.0058\n0.0008\n-6.89\n<1e-11\n\n\n\nurban: Y\n0.3567\n0.0602\n5.93\n<1e-08\n\n\n\nage & children: true\n0.0342\n0.0127\n2.69\n0.0072\n\n\n\n\n\n\n\n\nCode\nlet\n  mods = [gm2, gm1]\n  DataFrame(;\n    model=[:gm2, :gm1],\n    npar=dof.(mods),\n    deviance=deviance.(mods),\n    AIC=aic.(mods),\n    BIC=bic.(mods),\n    AICc=aicc.(mods),\n  )\nend\n\n\n2×6 DataFrame\n\n\n\nRow\nmodel\nnpar\ndeviance\nAIC\nBIC\nAICc\n\n\n\nSymbol\nInt64\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\ngm2\n7\n2364.92\n2379.18\n2418.15\n2379.24\n\n\n2\ngm1\n8\n2372.46\n2388.73\n2433.27\n2388.81\n\n\n\n\n\n\nBecause these models are not nested, we cannot do a likelihood ratio test. Nevertheless we see that the deviance is much lower in the model with age & children even though the 3 levels of livch have been collapsed into a single level of children. There is a substantial decrease in the deviance even though there are fewer parameters in model gm2 than in gm1. This decrease is because the flexibility of the model - its ability to model the behavior of the response - is being put to better use in gm2 than in gm1.\nAt present the calculation of the geomdof as sum(influence(m)) is not correctly defined in our code for a GLMM so we need to do some more work before we can examine those values.\n\n\n3.3 Using urban&dist as a grouping factor\nIt turns out that there can be more difference between urban and rural settings within the same political district than there is between districts. To model this difference we build a model with urban&dist as a grouping factor.\n\ngm3 = let\n  form = @formula(\n    use ~\n      1 +\n      age * children +\n      abs2(age) +\n      children +\n      urban +\n      (1 | urban & dist)\n  )\n  fit(MixedModel, form, contra, dist; nAGQ, contrasts)\nend\n\nMinimizing 141   Time: 0:00:00 ( 1.08 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_urban & dist\n\n\n\n\n(Intercept)\n-0.3415\n0.1269\n-2.69\n0.0071\n0.5761\n\n\nage\n-0.0129\n0.0112\n-1.16\n0.2471\n\n\n\nchildren: true\n0.6064\n0.1045\n5.80\n<1e-08\n\n\n\nabs2(age)\n-0.0056\n0.0008\n-6.66\n<1e-10\n\n\n\nurban: Y\n0.3936\n0.0859\n4.58\n<1e-05\n\n\n\nage & children: true\n0.0332\n0.0128\n2.59\n0.0096\n\n\n\n\n\n\n\n\nCode\nlet\n  mods = [gm3, gm2, gm1]\n  DataFrame(;\n    model=[:gm3, :gm2, :gm1],\n    npar=dof.(mods),\n    deviance=deviance.(mods),\n    AIC=aic.(mods),\n    BIC=bic.(mods),\n    AICc=aicc.(mods),\n  )\nend\n\n\n3×6 DataFrame\n\n\n\nRow\nmodel\nnpar\ndeviance\nAIC\nBIC\nAICc\n\n\n\nSymbol\nInt64\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\ngm3\n7\n2353.82\n2368.48\n2407.46\n2368.54\n\n\n2\ngm2\n7\n2364.92\n2379.18\n2418.15\n2379.24\n\n\n3\ngm1\n8\n2372.46\n2388.73\n2433.27\n2388.81\n\n\n\n\n\n\nNotice that the parameter count in gm3 is the same as that of gm2 - the thing that has changed is the number of levels of the grouping factor- resulting in a much lower deviance for gm3. This reinforces the idea that a simple count of the number of parameters to be estimated does not always reflect the complexity of the model.\n\ngm2\n\n\n\n\n\nEst.\nSE\nz\np\nσ_dist\n\n\n\n\n(Intercept)\n-0.3614\n0.1275\n-2.84\n0.0046\n0.4757\n\n\nage\n-0.0131\n0.0110\n-1.19\n0.2352\n\n\n\nchildren: true\n0.6054\n0.1035\n5.85\n<1e-08\n\n\n\nabs2(age)\n-0.0058\n0.0008\n-6.89\n<1e-11\n\n\n\nurban: Y\n0.3567\n0.0602\n5.93\n<1e-08\n\n\n\nage & children: true\n0.0342\n0.0127\n2.69\n0.0072\n\n\n\n\n\n\n\ngm3\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_urban & dist\n\n\n\n\n(Intercept)\n-0.3415\n0.1269\n-2.69\n0.0071\n0.5761\n\n\nage\n-0.0129\n0.0112\n-1.16\n0.2471\n\n\n\nchildren: true\n0.6064\n0.1045\n5.80\n<1e-08\n\n\n\nabs2(age)\n-0.0056\n0.0008\n-6.66\n<1e-10\n\n\n\nurban: Y\n0.3936\n0.0859\n4.58\n<1e-05\n\n\n\nage & children: true\n0.0332\n0.0128\n2.59\n0.0096\n\n\n\n\n\n\nThe coefficient for age may be regarded as insignificant but we retain it for two reasons: we have a term of age² (written abs2(age)) in the model and we have a significant interaction age & children in the model.\n\n\n3.4 Predictions for some subgroups\nFor a “typical” district (random effect near zero) the predictions on the linear predictor scale for a woman whose age is near the centering value (i.e. centered age of zero) are:\n\nusing Effects\ndesign = Dict(\n  :children => [true, false], :urban => [\"Y\", \"N\"], :age => [0.0]\n)\npreds = effects(design, gm3)\n\n4×7 DataFrame\n\n\n\nRow\nchildren\nage\nurban\nuse: Y\nerr\nlower\nupper\n\n\n\nBool\nFloat64\nString\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\ntrue\n0.0\nY\n0.658574\n0.15053\n0.508044\n0.809104\n\n\n2\nfalse\n0.0\nY\n-0.554306\n0.230476\n-0.784781\n-0.32383\n\n\n3\ntrue\n0.0\nN\n-0.128627\n0.113017\n-0.241644\n-0.0156101\n\n\n4\nfalse\n0.0\nN\n-1.34151\n0.221574\n-1.56308\n-1.11993\n\n\n\n\n\n\nConverting these η values to probabilities yields\n\nlogistic.(preds[!, \"use: Y\"])\n\n4-element Vector{Float64}:\n 0.6589399963739235\n 0.3648660519811384\n 0.46788748821040266\n 0.20726238106287984"
       },
       {
         "objectID": "glmm.html#summarizing-the-results",
    @@ -263,63 +263,63 @@
         "href": "contrasts_kwdyz11.html#seqdiffcoding",
         "title": "Contrast Coding of Visual Attention Effects",
         "section": "4.1 SeqDiffCoding",
    -    "text": "4.1 SeqDiffCoding\nThe SeqDiffCoding contrast corresponds to MASS::contr.sdif() in R. The assignment of random factors such as Subj to Grouping() is necessary when the sample size is very large. We recommend to include it always, but in this tutorial we do so only in the first example.\n\nm1 = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => SeqDiffCoding(; levels),\n    :Subj => Grouping()\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\nMinimizing 200   Time: 0:00:00 ( 1.51 ms/it)\n  objective:  325809.54929832555\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0913\n54.96\n<1e-99\n55.1998\n\n\nCTR: sod\n33.7817\n3.2874\n10.28\n<1e-24\n23.2486\n\n\nCTR: dos\n13.9852\n2.3057\n6.07\n<1e-08\n10.7538\n\n\nCTR: dod\n-2.7470\n2.2143\n-1.24\n0.2148\n9.5110\n\n\nResidual\n69.8348"
    +    "text": "4.1 SeqDiffCoding\nThe SeqDiffCoding contrast corresponds to MASS::contr.sdif() in R. The assignment of random factors such as Subj to Grouping() is necessary when the sample size is very large. We recommend to include it always, but in this tutorial we do so only in the first example.\n\nm1 = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => SeqDiffCoding(; levels),\n    :Subj => Grouping()\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0916\n54.96\n<1e-99\n55.2018\n\n\nCTR: sod\n33.7817\n3.2872\n10.28\n<1e-24\n23.2464\n\n\nCTR: dos\n13.9852\n2.3059\n6.06\n<1e-08\n10.7563\n\n\nCTR: dod\n-2.7470\n2.2141\n-1.24\n0.2147\n9.5079\n\n\nResidual\n69.8348"
       },
       {
         "objectID": "contrasts_kwdyz11.html#hypothesiscoding",
         "href": "contrasts_kwdyz11.html#hypothesiscoding",
         "title": "Contrast Coding of Visual Attention Effects",
         "section": "4.2 HypothesisCoding",
    -    "text": "4.2 HypothesisCoding\nHypothesisCoding is the most general option available. We can implement all “canned” contrasts ourselves. The next example reproduces the test statistcs from SeqDiffCoding - with a minor modification illustrating the flexibility of going beyond the default version.\n\nm1b = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => HypothesisCoding(\n      [\n        -1  1 0  0\n         0 -1 1  0\n         0  0 1 -1\n      ];\n      levels,\n      labels=[\"spt\", \"obj\", \"grv\"],\n    ),\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0915\n54.96\n<1e-99\n55.2010\n\n\nCTR: spt\n33.7817\n3.2871\n10.28\n<1e-24\n23.2461\n\n\nCTR: obj\n13.9852\n2.3059\n6.06\n<1e-08\n10.7567\n\n\nCTR: grv\n2.7469\n2.2143\n1.24\n0.2148\n9.5106\n\n\nResidual\n69.8348\n\n\n\n\n\n\n\n\n\nThe difference to the preprogrammed SeqDiffCoding is that for the third contrast we changed the direction of the contrast such that the sign of the effect is positive when the result is in agreement with theoretical expectation, that is we subtract the fourth level from the third, not the third level from the fourth."
    +    "text": "4.2 HypothesisCoding\nHypothesisCoding is the most general option available. We can implement all “canned” contrasts ourselves. The next example reproduces the test statistcs from SeqDiffCoding - with a minor modification illustrating the flexibility of going beyond the default version.\n\nm1b = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => HypothesisCoding(\n      [\n        -1  1 0  0\n         0 -1 1  0\n         0  0 1 -1\n      ];\n      levels,\n      labels=[\"spt\", \"obj\", \"grv\"],\n    ),\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0913\n54.96\n<1e-99\n55.1994\n\n\nCTR: spt\n33.7817\n3.2874\n10.28\n<1e-24\n23.2486\n\n\nCTR: obj\n13.9852\n2.3058\n6.07\n<1e-08\n10.7552\n\n\nCTR: grv\n2.7469\n2.2143\n1.24\n0.2148\n9.5110\n\n\nResidual\n69.8348\n\n\n\n\n\n\n\n\n\nThe difference to the preprogrammed SeqDiffCoding is that for the third contrast we changed the direction of the contrast such that the sign of the effect is positive when the result is in agreement with theoretical expectation, that is we subtract the fourth level from the third, not the third level from the fourth."
       },
       {
         "objectID": "contrasts_kwdyz11.html#dummycoding",
         "href": "contrasts_kwdyz11.html#dummycoding",
         "title": "Contrast Coding of Visual Attention Effects",
         "section": "4.3 DummyCoding",
    -    "text": "4.3 DummyCoding\nThi contrast corresponds to contr.treatment() in R\n\nm2 = let\n  contrasts = Dict(:CTR => DummyCoding(; base=\"val\"))\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n358.0914\n6.1534\n58.19\n<1e-99\n47.9055\n\n\nCTR: dod\n45.0200\n4.3625\n10.32\n<1e-24\n32.2821\n\n\nCTR: dos\n47.7669\n3.5560\n13.43\n<1e-40\n25.5314\n\n\nCTR: sod\n33.7817\n3.2868\n10.28\n<1e-24\n23.2436\n\n\nResidual\n69.8349\n\n\n\n\n\n\n\n\n\nThe DummyCoding contrast has the disadvantage that the intercept returns the mean of the level specified as base, default is the first level, not the GM."
    +    "text": "4.3 DummyCoding\nThi contrast corresponds to contr.treatment() in R\n\nm2 = let\n  contrasts = Dict(:CTR => DummyCoding(; base=\"val\"))\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n358.0914\n6.1541\n58.19\n<1e-99\n47.9108\n\n\nCTR: dod\n45.0200\n4.3635\n10.32\n<1e-24\n32.2904\n\n\nCTR: dos\n47.7669\n3.5565\n13.43\n<1e-40\n25.5357\n\n\nCTR: sod\n33.7817\n3.2873\n10.28\n<1e-24\n23.2474\n\n\nResidual\n69.8348\n\n\n\n\n\n\n\n\n\nThe DummyCoding contrast has the disadvantage that the intercept returns the mean of the level specified as base, default is the first level, not the GM."
       },
       {
         "objectID": "contrasts_kwdyz11.html#ychycaeitcoding",
         "href": "contrasts_kwdyz11.html#ychycaeitcoding",
         "title": "Contrast Coding of Visual Attention Effects",
         "section": "4.4 YchycaeitCoding",
    -    "text": "4.4 YchycaeitCoding\nThe contrasts returned by DummyCoding may be exactly what we want. Can’t we have them, but also have the intercept estimate the GM, rather than the mean of the base level? Yes, we can! We call this “You can have your cake and it eat, too”-Coding (YchycaeitCoding). And we use HypothesisCoding to achieve this outcome.\n\nm2b = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => HypothesisCoding(\n      [\n        -1 1 0 0\n        -1 0 1 0\n        -1 0 0 1\n      ];\n      levels,\n      labels=levels[2:end],\n    )\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0910\n54.96\n<1e-99\n55.1974\n\n\nCTR: sod\n33.7817\n3.2872\n10.28\n<1e-24\n23.2470\n\n\nCTR: dos\n47.7669\n3.5567\n13.43\n<1e-40\n25.5380\n\n\nCTR: dod\n45.0200\n4.3634\n10.32\n<1e-24\n32.2892\n\n\nResidual\n69.8349\n\n\n\n\n\n\n\n\n\nWe can simply relevel the factor or move the column with -1s for a different base."
    +    "text": "4.4 YchycaeitCoding\nThe contrasts returned by DummyCoding may be exactly what we want. Can’t we have them, but also have the intercept estimate the GM, rather than the mean of the base level? Yes, we can! We call this “You can have your cake and it eat, too”-Coding (YchycaeitCoding). And we use HypothesisCoding to achieve this outcome.\n\nm2b = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => HypothesisCoding(\n      [\n        -1 1 0 0\n        -1 0 1 0\n        -1 0 0 1\n      ];\n      levels,\n      labels=levels[2:end],\n    )\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0908\n54.96\n<1e-99\n55.1954\n\n\nCTR: sod\n33.7817\n3.2872\n10.28\n<1e-24\n23.2465\n\n\nCTR: dos\n47.7669\n3.5562\n13.43\n<1e-40\n25.5334\n\n\nCTR: dod\n45.0200\n4.3632\n10.32\n<1e-24\n32.2881\n\n\nResidual\n69.8349\n\n\n\n\n\n\n\n\n\nWe can simply relevel the factor or move the column with -1s for a different base."
       },
       {
         "objectID": "contrasts_kwdyz11.html#effectscoding",
         "href": "contrasts_kwdyz11.html#effectscoding",
         "title": "Contrast Coding of Visual Attention Effects",
         "section": "4.5 EffectsCoding",
    -    "text": "4.5 EffectsCoding\nThis contrast corresponds almost to contr.sum() in R.\n\nm3 = let\n  contrasts = Dict(:CTR => EffectsCoding(; base=\"dod\"))\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0921\n54.95\n<1e-99\n55.2059\n\n\nCTR: dos\n16.1248\n1.4402\n11.20\n<1e-28\n7.3293\n\n\nCTR: sod\n2.1396\n1.3338\n1.60\n0.1087\n6.0076\n\n\nCTR: val\n-31.6422\n2.6425\n-11.97\n<1e-32\n19.9519\n\n\nResidual\n69.8348\n\n\n\n\n\n\n\n\n\nThe “almost” qualification refers to the fact that contr.sum() uses the last factor levels as default base level; EffectsCoding uses the first level."
    +    "text": "4.5 EffectsCoding\nThis contrast corresponds almost to contr.sum() in R.\n\nm3 = let\n  contrasts = Dict(:CTR => EffectsCoding(; base=\"dod\"))\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0929\n54.95\n<1e-99\n55.2125\n\n\nCTR: dos\n16.1247\n1.4405\n11.19\n<1e-28\n7.3332\n\n\nCTR: sod\n2.1396\n1.3341\n1.60\n0.1088\n6.0110\n\n\nCTR: val\n-31.6422\n2.6419\n-11.98\n<1e-32\n19.9472\n\n\nResidual\n69.8348\n\n\n\n\n\n\n\n\n\nThe “almost” qualification refers to the fact that contr.sum() uses the last factor levels as default base level; EffectsCoding uses the first level."
       },
       {
         "objectID": "contrasts_kwdyz11.html#helmertcoding",
         "href": "contrasts_kwdyz11.html#helmertcoding",
         "title": "Contrast Coding of Visual Attention Effects",
         "section": "4.6 HelmertCoding",
    -    "text": "4.6 HelmertCoding\nHelmertCoding codes each level as the difference from the average of the lower levels. With the default order of CTR levels we get the following test statistics. These contrasts are othogonal.\n\nm4 = let\n  contrasts = Dict(:CTR => HelmertCoding())\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0930\n54.95\n<1e-99\n55.2132\n\n\nCTR: dos\n1.3734\n1.1072\n1.24\n0.2148\n4.7557\n\n\nCTR: sod\n-4.2039\n0.6845\n-6.14\n<1e-09\n3.3523\n\n\nCTR: val\n-10.5474\n0.8808\n-11.97\n<1e-32\n6.6508\n\n\nResidual\n69.8347\n\n\n\n\n\n\n\n\n\n+ HeC1: (2 - 1)/2           # (391 - 358)/2\n+ HeC2: (3 - (2+1)/2)/3     # (405 - (391 + 358)/2)/3\n+ HeC3: (4 - (3+2+1)/3)/4   # (402 - (405 + 391 + 358)/3)/4"
    +    "text": "4.6 HelmertCoding\nHelmertCoding codes each level as the difference from the average of the lower levels. With the default order of CTR levels we get the following test statistics. These contrasts are othogonal.\n\nm4 = let\n  contrasts = Dict(:CTR => HelmertCoding())\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0930\n54.95\n<1e-99\n55.2131\n\n\nCTR: dos\n1.3735\n1.1071\n1.24\n0.2147\n4.7545\n\n\nCTR: sod\n-4.2039\n0.6841\n-6.15\n<1e-09\n3.3465\n\n\nCTR: val\n-10.5474\n0.8808\n-11.97\n<1e-32\n6.6506\n\n\nResidual\n69.8349\n\n\n\n\n\n\n\n\n\n+ HeC1: (2 - 1)/2           # (391 - 358)/2\n+ HeC2: (3 - (2+1)/2)/3     # (405 - (391 + 358)/2)/3\n+ HeC3: (4 - (3+2+1)/3)/4   # (402 - (405 + 391 + 358)/3)/4"
       },
       {
         "objectID": "contrasts_kwdyz11.html#reverse-helmertcoding",
         "href": "contrasts_kwdyz11.html#reverse-helmertcoding",
         "title": "Contrast Coding of Visual Attention Effects",
         "section": "4.7 Reverse HelmertCoding",
    -    "text": "4.7 Reverse HelmertCoding\nReverse HelmertCoding codes each level as the difference from the average of the higher levels. To estimate these effects we simply reverse the order of factor levels. Of course, the contrasts are also orthogonal.\n\nm4b = let levels = reverse(StatsModels.levels(dat1.CTR))\n  contrasts = Dict(:CTR => HelmertCoding(; levels))\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0930\n54.95\n<1e-99\n55.2132\n\n\nCTR: dos\n1.3734\n1.1072\n1.24\n0.2148\n4.7557\n\n\nCTR: sod\n-4.2039\n0.6845\n-6.14\n<1e-09\n3.3523\n\n\nCTR: val\n-10.5474\n0.8808\n-11.97\n<1e-32\n6.6508\n\n\nResidual\n69.8347\n\n\n\n\n\n\n\n\n\n+ HeC1:(3 - 4)/2            # (405 - 402)/2\n+ HeC2:(2 - (3+4)/2)/3      # (391 - (405 + 402)/2)/3\n+ HeC3:(1 - (2+3+4)/3/4     # (356  -(391 + 405 + 402)/3)/4"
    +    "text": "4.7 Reverse HelmertCoding\nReverse HelmertCoding codes each level as the difference from the average of the higher levels. To estimate these effects we simply reverse the order of factor levels. Of course, the contrasts are also orthogonal.\n\nm4b = let levels = reverse(StatsModels.levels(dat1.CTR))\n  contrasts = Dict(:CTR => HelmertCoding(; levels))\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0930\n54.95\n<1e-99\n55.2131\n\n\nCTR: dos\n1.3735\n1.1071\n1.24\n0.2147\n4.7545\n\n\nCTR: sod\n-4.2039\n0.6841\n-6.15\n<1e-09\n3.3465\n\n\nCTR: val\n-10.5474\n0.8808\n-11.97\n<1e-32\n6.6506\n\n\nResidual\n69.8349\n\n\n\n\n\n\n\n\n\n+ HeC1:(3 - 4)/2            # (405 - 402)/2\n+ HeC2:(2 - (3+4)/2)/3      # (391 - (405 + 402)/2)/3\n+ HeC3:(1 - (2+3+4)/3/4     # (356  -(391 + 405 + 402)/3)/4"
       },
       {
         "objectID": "contrasts_kwdyz11.html#anova-coding",
         "href": "contrasts_kwdyz11.html#anova-coding",
         "title": "Contrast Coding of Visual Attention Effects",
         "section": "4.8 Anova Coding",
    -    "text": "4.8 Anova Coding\nFactorial designs (i.e., lab experiments) are traditionally analyzed with analysis of variance. The test statistics of main effects and interactions are based on an orthogonal set of contrasts. We specify them with HypothesisCoding.\n\n4.8.1 A(2) x B(2)\nAn A(2) x B(2) design can be recast as an F(4) design with the levels (A1-B1, A1-B2, A2-B1, A2-B2). The following contrast specifiction returns estimates for the main effect of A, the main effect of B, and the interaction of A and B. In a figure With A on the x-axis and the levels of B shown as two lines, the interaction tests the null hypothesis that the two lines are parallel. A positive coefficient implies overadditivity (diverging lines toward the right) and a negative coefficient underadditivity (converging lines).\n\nm5 = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => HypothesisCoding(\n      [\n        -1 -1 +1 +1          # A\n        -1 +1 -1 +1          # B\n        +1 -1 -1 +1          # A x B\n      ];\n      levels,\n      labels=[\"A\", \"B\", \"AxB\"],\n    ),\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0918\n54.96\n<1e-99\n55.2032\n\n\nCTR: A\n59.0052\n5.1830\n11.38\n<1e-29\n36.2109\n\n\nCTR: B\n31.0348\n4.6749\n6.64\n<1e-10\n31.7124\n\n\nCTR: AxB\n-36.5287\n3.0927\n-11.81\n<1e-31\n16.0056\n\n\nResidual\n69.8348\n\n\n\n\n\n\n\n\n\nIt is also helpful to see the corresponding layout of the four means for the interaction of A and B (i.e., the third contrast)\n        B1     B2\n   A1   +1     -1\n   A2   -1     +1\nThus, interaction tests whether the difference between main diagonal and minor diagonal is different from zero.\n\n\n4.8.2 A(2) x B(2) x C(2)\nGoing beyond the four level factor; it is also helpful to see the corresponding layout of the eight means for the interaction of A and B and C.\n          C1              C2\n      B1     B2        B1     B2\n A1   +1     -1   A1   -1     +1\n A2   -1     +1   A2   +1     -1\n\n\n4.8.3 A(2) x B(2) x C(3)\nTO BE DONE"
    +    "text": "4.8 Anova Coding\nFactorial designs (i.e., lab experiments) are traditionally analyzed with analysis of variance. The test statistics of main effects and interactions are based on an orthogonal set of contrasts. We specify them with HypothesisCoding.\n\n4.8.1 A(2) x B(2)\nAn A(2) x B(2) design can be recast as an F(4) design with the levels (A1-B1, A1-B2, A2-B1, A2-B2). The following contrast specifiction returns estimates for the main effect of A, the main effect of B, and the interaction of A and B. In a figure With A on the x-axis and the levels of B shown as two lines, the interaction tests the null hypothesis that the two lines are parallel. A positive coefficient implies overadditivity (diverging lines toward the right) and a negative coefficient underadditivity (converging lines).\n\nm5 = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => HypothesisCoding(\n      [\n        -1 -1 +1 +1          # A\n        -1 +1 -1 +1          # B\n        +1 -1 -1 +1          # A x B\n      ];\n      levels,\n      labels=[\"A\", \"B\", \"AxB\"],\n    ),\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0917\n54.96\n<1e-99\n55.2028\n\n\nCTR: A\n59.0052\n5.1826\n11.39\n<1e-29\n36.2079\n\n\nCTR: B\n31.0348\n4.6750\n6.64\n<1e-10\n31.7139\n\n\nCTR: AxB\n-36.5287\n3.0927\n-11.81\n<1e-31\n16.0053\n\n\nResidual\n69.8348\n\n\n\n\n\n\n\n\n\nIt is also helpful to see the corresponding layout of the four means for the interaction of A and B (i.e., the third contrast)\n        B1     B2\n   A1   +1     -1\n   A2   -1     +1\nThus, interaction tests whether the difference between main diagonal and minor diagonal is different from zero.\n\n\n4.8.2 A(2) x B(2) x C(2)\nGoing beyond the four level factor; it is also helpful to see the corresponding layout of the eight means for the interaction of A and B and C.\n          C1              C2\n      B1     B2        B1     B2\n A1   +1     -1   A1   -1     +1\n A2   -1     +1   A2   +1     -1\n\n\n4.8.3 A(2) x B(2) x C(3)\nTO BE DONE"
       },
       {
         "objectID": "contrasts_kwdyz11.html#nested-coding",
         "href": "contrasts_kwdyz11.html#nested-coding",
         "title": "Contrast Coding of Visual Attention Effects",
         "section": "4.9 Nested coding",
    -    "text": "4.9 Nested coding\nNested contrasts are often specified as follow up as post-hoc tests for ANOVA interactions. They are orthogonal. We specify them with HypothesisCoding.\nAn A(2) x B(2) design can be recast as an F(4) design with the levels (A1-B1, A1-B2, A2-B1, A2-B2). The following contrast specifiction returns an estimate for the main effect of A and the effects of B nested in the two levels of A. In a figure With A on the x-axis and the levels of B shown as two lines, the second contrast tests whether A1-B1 is different from A1-B2 and the third contrast tests whether A2-B1 is different from A2-B2.\n\nm8 = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => HypothesisCoding(\n      [\n        -1 -1 +1 +1\n        -1 +1  0  0\n         0  0 +1 -1\n      ];\n      levels,\n      labels=[\"do_so\", \"spt\", \"grv\"],\n    ),\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0937\n54.94\n<1e-99\n55.2184\n\n\nCTR: do_so\n59.0052\n5.1816\n11.39\n<1e-29\n36.1992\n\n\nCTR: spt\n33.7817\n3.2883\n10.27\n<1e-24\n23.2561\n\n\nCTR: grv\n2.7469\n2.2146\n1.24\n0.2148\n9.5149\n\n\nResidual\n69.8348\n\n\n\n\n\n\n\n\n\nThe three contrasts for one main effect and two nested contrasts are orthogonal. There is no test of the interaction (parallelism)."
    +    "text": "4.9 Nested coding\nNested contrasts are often specified as follow up as post-hoc tests for ANOVA interactions. They are orthogonal. We specify them with HypothesisCoding.\nAn A(2) x B(2) design can be recast as an F(4) design with the levels (A1-B1, A1-B2, A2-B1, A2-B2). The following contrast specifiction returns an estimate for the main effect of A and the effects of B nested in the two levels of A. In a figure With A on the x-axis and the levels of B shown as two lines, the second contrast tests whether A1-B1 is different from A1-B2 and the third contrast tests whether A2-B1 is different from A2-B2.\n\nm8 = let levels = [\"val\", \"sod\", \"dos\", \"dod\"]\n  contrasts = Dict(\n    :CTR => HypothesisCoding(\n      [\n        -1 -1 +1 +1\n        -1 +1  0  0\n         0  0 +1 -1\n      ];\n      levels,\n      labels=[\"do_so\", \"spt\", \"grv\"],\n    ),\n  )\n  fit(MixedModel, form, dat1; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n389.7336\n7.0922\n54.95\n<1e-99\n55.2069\n\n\nCTR: do_so\n59.0052\n5.1829\n11.38\n<1e-29\n36.2104\n\n\nCTR: spt\n33.7817\n3.2878\n10.27\n<1e-24\n23.2521\n\n\nCTR: grv\n2.7469\n2.2145\n1.24\n0.2148\n9.5132\n\n\nResidual\n69.8348\n\n\n\n\n\n\n\n\n\nThe three contrasts for one main effect and two nested contrasts are orthogonal. There is no test of the interaction (parallelism)."
       },
       {
         "objectID": "contrasts_kwdyz11.html#standard-contrasts",
    @@ -354,7 +354,7 @@
         "href": "check_emotikon_transform.html#getting-the-packages-and-data",
         "title": "Transformed and original metrics in Emotikon",
         "section": "1 Getting the packages and data",
    -    "text": "1 Getting the packages and data\n\n\nCode\nusing AlgebraOfGraphics\nusing Arrow\nusing CairoMakie\nusing DataFrames\nusing DataFrameMacros\nusing MixedModels\nusing MixedModelsMakie\nusing RCall\nusing Serialization\nusing StatsBase\n\nCairoMakie.activate!(; type=\"svg\")\ndatadir = joinpath(@__DIR__, \"data\");\n\n\n\n1.1 Data and figure in publication\n\ndat = DataFrame(Arrow.Table(joinpath(datadir, \"fggk21.arrow\")))\n@transform!(dat, :a1 = :age - 8.5);\nselect!(groupby(dat, :Test), :, :score => zscore => :zScore);\ndescribe(dat)\n\n9×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nDataType\n\n\n\n\n1\nTest\n\nBPT\n\nStar_r\n0\nString\n\n\n2\nCohort\n\n2011\n\n2019\n0\nString\n\n\n3\nSchool\n\nS100043\n\nS800200\n0\nString\n\n\n4\nChild\n\nC002352\n\nC117966\n0\nString\n\n\n5\nSex\n\nfemale\n\nmale\n0\nString\n\n\n6\nage\n8.56073\n7.99452\n8.55852\n9.10609\n0\nFloat64\n\n\n7\nscore\n226.141\n1.14152\n4.65116\n1530.0\n0\nFloat64\n\n\n8\na1\n0.0607297\n-0.505476\n0.0585216\n0.606092\n0\nFloat64\n\n\n9\nzScore\n-3.91914e-13\n-3.1542\n0.00031088\n3.55078\n0\nFloat64\n\n\n\n\n\n\n\n\n1.2 Data and figure with z-scores based on original metric\n\n# dat_om = rcopy(R\"readRDS('./data/fggk21_om.rds')\");  #Don't know what the _om is\n# @transform!(dat_om, :a1 = :age - 8.5);\n# select!(groupby(dat_om, :Test), :, :score => zscore => :zScore);\n# describe(dat_om)"
    +    "text": "1 Getting the packages and data\n\n\nCode\nusing AlgebraOfGraphics\nusing Arrow\nusing CairoMakie\nusing DataFrames\nusing DataFrameMacros\nusing MixedModels\nusing MixedModelsMakie\nusing RCall\nusing Serialization\nusing StatsBase\n\nCairoMakie.activate!(; type=\"svg\")\ndatadir = joinpath(@__DIR__, \"data\");\n\n\n\n1.1 Data and figure in publication\n\ndat = DataFrame(Arrow.Table(joinpath(datadir, \"fggk21.arrow\")))\n@transform!(dat, :a1 = :age - 8.5);\nselect!(groupby(dat, :Test), :, :score => zscore => :zScore);\ndescribe(dat)\n\n9×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nDataType\n\n\n\n\n1\nTest\n\nBPT\n\nStar_r\n0\nString\n\n\n2\nCohort\n\n2011\n\n2019\n0\nString\n\n\n3\nSchool\n\nS100043\n\nS800200\n0\nString\n\n\n4\nChild\n\nC002352\n\nC117966\n0\nString\n\n\n5\nSex\n\nfemale\n\nmale\n0\nString\n\n\n6\nage\n8.56073\n7.99452\n8.55852\n9.10609\n0\nFloat64\n\n\n7\nscore\n226.141\n1.14152\n4.65116\n1530.0\n0\nFloat64\n\n\n8\na1\n0.0607297\n-0.505476\n0.0585216\n0.606092\n0\nFloat64\n\n\n9\nzScore\n-3.91921e-13\n-3.1542\n0.00031088\n3.55078\n0\nFloat64\n\n\n\n\n\n\n\n\n1.2 Data and figure with z-scores based on original metric\n\n# dat_om = rcopy(R\"readRDS('./data/fggk21_om.rds')\");  #Don't know what the _om is\n# @transform!(dat_om, :a1 = :age - 8.5);\n# select!(groupby(dat_om, :Test), :, :score => zscore => :zScore);\n# describe(dat_om)"
       },
       {
         "objectID": "check_emotikon_transform.html#lmms",
    @@ -389,7 +389,7 @@
         "href": "bootstrap.html",
         "title": "Parametric bootstrap for mixed-effects models",
         "section": "",
    -    "text": "The speed of MixedModels.jl relative to its predecessors makes the parametric bootstrap much more computationally tractable. This is valuable because the parametric bootstrap can be used to produce more accurate confidence intervals than methods based on standard errors or profiling of the likelihood surface.\nThis page is adapted from the MixedModels.jl docs\n\n1 The parametric bootstrap\nBootstrapping is a family of procedures for generating sample values of a statistic, allowing for visualization of the distribution of the statistic or for inference from this sample of values. Bootstrapping also belongs to a larger family of procedures called resampling, which are based on creating new samples of data from an existing one, then computing statistics on the new samples, in order to examine the distribution of the relevant statistics.\nA parametric bootstrap is used with a parametric model, m, that has been fit to data. The procedure is to simulate n response vectors from m using the estimated parameter values and refit m to these responses in turn, accumulating the statistics of interest at each iteration.\nThe parameters of a LinearMixedModel object are the fixed-effects parameters, β, the standard deviation, σ, of the per-observation noise, and the covariance parameter, θ, that defines the variance-covariance matrices of the random effects. A technical description of the covariance parameter can be found in the MixedModels.jl docs. Lisa Schwetlick and Daniel Backhaus have provided a more beginner-friendly description of the covariance parameter in the documentation for MixedModelsSim.jl. For today’s purposes – looking at the uncertainty in the estimates from a fitted model – we can simply use values from the fitted model, but we will revisit the parametric bootstrap as a convenient way to simulate new data, potentially with different parameter values, for power analysis.\nAttach the packages to be used\n\n\nCode\nusing AlgebraOfGraphics\nusing CairoMakie\nusing DataFrames\nusing MixedModels\nusing MixedModelsMakie\nusing Random\nusing SMLP2023: dataset\n\nusing AlgebraOfGraphics: AlgebraOfGraphics as AoG\nCairoMakie.activate!(; type=\"svg\") # use SVG (other options include PNG)\n\nimport ProgressMeter\nProgressMeter.ijulia_behavior(:clear);\n\n\nNote that the precise stream of random numbers generated for a given seed can change between Julia versions. For exact reproducibility, you either need to have the exact same Julia version or use the StableRNGs package.\n\n\n2 A model of moderate complexity\nThe kb07 data (Kronmüller & Barr, 2007) are one of the datasets provided by the MixedModels package.\n\nkb07 = dataset(:kb07)\n\nArrow.Table with 1789 rows, 7 columns, and schema:\n :subj      String\n :item      String\n :spkr      String\n :prec      String\n :load      String\n :rt_trunc  Int16\n :rt_raw    Int16\n\n\nConvert the table to a DataFrame for summary.\n\nkb07 = DataFrame(kb07)\ndescribe(kb07)\n\n7×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nDataType\n\n\n\n\n1\nsubj\n\nS030\n\nS103\n0\nString\n\n\n2\nitem\n\nI01\n\nI32\n0\nString\n\n\n3\nspkr\n\nnew\n\nold\n0\nString\n\n\n4\nprec\n\nbreak\n\nmaintain\n0\nString\n\n\n5\nload\n\nno\n\nyes\n0\nString\n\n\n6\nrt_trunc\n2182.2\n579\n1940.0\n5171\n0\nInt16\n\n\n7\nrt_raw\n2226.24\n579\n1940.0\n15923\n0\nInt16\n\n\n\n\n\n\nThe experimental factors; spkr, prec, and load, are two-level factors.\n\ncontrasts = Dict(:spkr => EffectsCoding(),\n                 :prec => EffectsCoding(),\n                 :load => EffectsCoding(),\n                 :subj => Grouping(),\n                 :item => Grouping())\n\nThe EffectsCoding contrast is used with these to create a ±1 encoding. Furthermore, Grouping constrasts are assigned to the subj and item factors. This is not a contrast per-se but an indication that these factors will be used as grouping factors for random effects and, therefore, there is no need to create a contrast matrix. For large numbers of levels in a grouping factor, an attempt to create a contrast matrix may cause memory overflow.\nIt is not important in these cases but a good practice in any case.\nWe can look at an initial fit of moderate complexity:\n\nform = @formula(rt_trunc ~ 1 + spkr * prec * load +\n                          (1 + spkr + prec + load | subj) +\n                          (1 + spkr + prec + load | item))\nm0 = fit(MixedModel, form, kb07; contrasts)\n\nMinimizing 799   Time: 0:00:01 ( 1.68 ms/it)\n  objective:  28637.123623229592\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\nσ_item\n\n\n\n\n(Intercept)\n2181.6729\n77.3136\n28.22\n<1e-99\n301.8062\n362.2579\n\n\nspkr: old\n67.7491\n18.2664\n3.71\n0.0002\n42.3795\n40.6807\n\n\nprec: maintain\n-333.9205\n47.1558\n-7.08\n<1e-11\n61.9630\n246.9158\n\n\nload: yes\n78.7702\n19.5298\n4.03\n<1e-04\n64.9751\n42.3890\n\n\nspkr: old & prec: maintain\n-21.9655\n15.8074\n-1.39\n0.1647\n\n\n\n\nspkr: old & load: yes\n18.3837\n15.8074\n1.16\n0.2448\n\n\n\n\nprec: maintain & load: yes\n4.5333\n15.8074\n0.29\n0.7743\n\n\n\n\nspkr: old & prec: maintain & load: yes\n23.6073\n15.8074\n1.49\n0.1353\n\n\n\n\nResidual\n668.5542\n\n\n\n\n\n\n\n\n\n\nThe default display in Quarto uses the pretty MIME show method for the model and omits the estimated correlations of the random effects.\nThe VarCorr extractor displays these.\n\nVarCorr(m0)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\nsubj\n(Intercept)\n91087.0055\n301.8062\n\n\n\n\n\n\nspkr: old\n1796.0221\n42.3795\n+0.79\n\n\n\n\n\nprec: maintain\n3839.4126\n61.9630\n-0.59\n+0.02\n\n\n\n\nload: yes\n4221.7638\n64.9751\n+0.36\n+0.85\n+0.54\n\n\nitem\n(Intercept)\n131230.7914\n362.2579\n\n\n\n\n\n\nspkr: old\n1654.9232\n40.6807\n+0.44\n\n\n\n\n\nprec: maintain\n60967.4037\n246.9158\n-0.69\n+0.35\n\n\n\n\nload: yes\n1796.8284\n42.3890\n+0.32\n+0.16\n-0.14\n\n\nResidual\n\n446964.7062\n668.5542\n\n\n\n\n\n\n\n\nNone of the two-factor or three-factor interaction terms in the fixed-effects are significant. In the random-effects terms only the scalar random effects and the prec random effect for item appear to be warranted, leading to the reduced formula\n\n# formula f4 from https://doi.org/10.33016/nextjournal.100002\nform = @formula(rt_trunc ~ 1 + spkr * prec * load + (1 | subj) + (1 + prec | item))\n\nm1 = fit(MixedModel, form, kb07; contrasts)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.7582\n77.4709\n28.16\n<1e-99\n364.7286\n298.1109\n\n\nspkr: old\n67.8114\n16.0526\n4.22\n<1e-04\n\n\n\n\nprec: maintain\n-333.8582\n47.4629\n-7.03\n<1e-11\n252.6687\n\n\n\nload: yes\n78.6849\n16.0525\n4.90\n<1e-06\n\n\n\n\nspkr: old & prec: maintain\n-21.8802\n16.0525\n-1.36\n0.1729\n\n\n\n\nspkr: old & load: yes\n18.3214\n16.0526\n1.14\n0.2537\n\n\n\n\nprec: maintain & load: yes\n4.4710\n16.0526\n0.28\n0.7806\n\n\n\n\nspkr: old & prec: maintain & load: yes\n23.5219\n16.0525\n1.47\n0.1428\n\n\n\n\nResidual\n678.9318\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m1)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133026.918\n364.729\n\n\n\n\nprec: maintain\n63841.496\n252.669\n-0.70\n\n\nsubj\n(Intercept)\n88870.080\n298.111\n\n\n\nResidual\n\n460948.432\n678.932\n\n\n\n\n\n\nThese two models are nested and can be compared with a likelihood-ratio test.\n\nMixedModels.likelihoodratiotest(m0, m1)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nrt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 | subj) + (1 + prec | item)\n13\n28658\n\n\n\n\n\nrt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item)\n29\n28637\n21\n16\n0.1650\n\n\n\n\n\nThe p-value of approximately 20% leads us to prefer the simpler model, m1, to the more complex, m0.\n\n\n3 Bootstrap basics\nTo bootstrap the model parameters, first initialize a random number generator then create a bootstrap sample and extract the table of parameter estimates from it.\n\nconst RNG = MersenneTwister(42)\nsamp = parametricbootstrap(RNG, 5_000, m1)\ntbl = samp.tbl\n\nTable with 18 columns and 5000 rows:\n      obj      β1       β2       β3        β4       β5        β6        ⋯\n    ┌────────────────────────────────────────────────────────────────────\n 1  │ 28691.9  2049.88  71.6398  -268.333  75.1566  -17.8459  -1.90968  ⋯\n 2  │ 28642.6  2197.6   73.0832  -313.409  68.018   -18.062   30.2431   ⋯\n 3  │ 28748.1  2175.11  85.4784  -311.786  48.8342  -27.3483  4.97874   ⋯\n 4  │ 28683.7  2158.48  86.0498  -301.013  71.0117  -45.3329  27.3747   ⋯\n 5  │ 28692.6  2342.6   81.9722  -305.764  78.9518  -37.0137  -5.59876  ⋯\n 6  │ 28691.5  2198.64  90.4229  -387.855  93.4767  -37.2244  3.13351   ⋯\n 7  │ 28687.7  2239.49  74.5619  -364.151  93.9154  -43.441   19.1572   ⋯\n 8  │ 28673.4  2217.89  76.4077  -409.228  52.5047  -11.5777  26.4348   ⋯\n 9  │ 28688.6  2184.89  81.3252  -298.693  89.8482  -5.99902  21.3162   ⋯\n 10 │ 28597.6  2227.36  57.3436  -332.635  102.565  -3.85194  7.23222   ⋯\n 11 │ 28700.8  2131.61  58.1253  -363.018  88.0576  -24.1592  2.26268   ⋯\n 12 │ 28644.8  2145.05  94.7216  -242.292  103.158  -27.2788  27.0664   ⋯\n 13 │ 28678.8  2113.56  55.4491  -382.425  89.8252  -12.9669  -2.74384  ⋯\n 14 │ 28773.5  2123.38  117.383  -258.883  78.8998  -63.4576  26.0778   ⋯\n 15 │ 28566.3  2168.89  52.8287  -289.968  71.5994  -14.7045  23.0165   ⋯\n 16 │ 28764.1  2344.66  54.5199  -356.183  54.3082  -36.4798  32.3478   ⋯\n 17 │ 28547.7  2230.3   56.2337  -329.448  88.8918  -27.7721  23.5031   ⋯\n 18 │ 28729.3  2268.71  77.0147  -328.11   73.1191  -15.0292  17.2227   ⋯\n 19 │ 28686.4  2138.38  88.8036  -273.697  68.418   -40.8522  17.7392   ⋯\n 20 │ 28620.7  1955.46  97.2794  -334.827  92.7866  -1.49191  33.0718   ⋯\n 21 │ 28664.1  2115.45  71.7916  -375.888  76.0984  -27.8142  24.5494   ⋯\n 22 │ 28742.2  2173.11  83.8428  -351.655  76.0148  -15.7201  -8.95264  ⋯\n 23 │ 28720.3  2192.85  62.7893  -327.012  47.9618  -23.188   16.7164   ⋯\n ⋮  │    ⋮        ⋮        ⋮        ⋮         ⋮        ⋮         ⋮      ⋱\n\n\nAn empirical density plot of the estimates of the residual standard deviation is obtained as\n\nplt = data(tbl) * mapping(:σ) * AoG.density()\ndraw(plt; axis=(;title=\"Parametric bootstrap estimates of σ\"))\n\n\n\n\nA density plot of the estimates of the standard deviation of the random effects is obtained as\n\nplt = data(tbl) * mapping(\n  [:σ1, :σ2, :σ3] .=> \"Bootstrap replicates of standard deviations\";\n  color=dims(1) => renamer([\"Item intercept\", \"Item speaker\", \"Subj\"])\n) * AoG.density()\ndraw(plt; figure=(;supertitle=\"Parametric bootstrap estimates of variance components\"))\n\n\n\n\nThe bootstrap sample can be used to generate intervals that cover a certain percentage of the bootstrapped values. We refer to these as “coverage intervals”, similar to a confidence interval. The shortest such intervals, obtained with the shortestcovint extractor, correspond to a highest posterior density interval in Bayesian inference.\nWe generate these for all random and fixed effects:\n\nconfint(samp)\n\nDictTable with 2 columns and 13 rows:\n par   lower      upper\n ────┬─────────────────────\n β1  │ 2032.48    2340.42\n β2  │ 34.3982    97.8079\n β3  │ -428.09    -244.474\n β4  │ 48.642     110.179\n β5  │ -53.4336   8.42791\n β6  │ -11.3574   51.5299\n β7  │ -27.1799   36.3332\n β8  │ -9.28905   53.5917\n ρ1  │ -0.912778  -0.471128\n σ   │ 654.965    700.928\n σ1  │ 265.276    456.967\n σ2  │ 179.402    321.016\n σ3  │ 232.096    359.744\n\n\n\ndraw(\n  data(samp.β) * mapping(:β; color=:coefname) * AoG.density();\n  figure=(; resolution=(800, 450)),\n)\n\n\n\n\nFor the fixed effects, MixedModelsMakie provides a convenience interface to plot the combined coverage intervals and density plots\n\nridgeplot(samp)\n\n\n\n\nOften the intercept will be on a different scale and potentially less interesting, so we can stop it from being included in the plot:\n\nridgeplot(samp; show_intercept=false, xlabel=\"Bootstrap density and 95%CI\")\n\n\n\n\n\n\n4 Singularity\nLet’s consider the classic dysetuff dataset:\n\ndyestuff = dataset(:dyestuff)\nmdye = fit(MixedModel, @formula(yield ~ 1 + (1 | batch)), dyestuff)\n\n\n\n\n\nEst.\nSE\nz\np\nσ_batch\n\n\n\n\n(Intercept)\n1527.5000\n17.6946\n86.33\n<1e-99\n37.2603\n\n\nResidual\n49.5101\n\n\n\n\n\n\n\n\n\n\nsampdye = parametricbootstrap(MersenneTwister(1234321), 10_000, mdye)\ntbldye = sampdye.tbl\n\nTable with 5 columns and 10000 rows:\n      obj      β1       σ        σ1        θ1\n    ┌────────────────────────────────────────────────\n 1  │ 339.022  1509.13  67.4315  14.312    0.212245\n 2  │ 322.689  1538.08  47.9831  25.5673   0.53284\n 3  │ 324.002  1508.02  50.1346  21.7622   0.434076\n 4  │ 331.887  1538.47  53.2238  41.0559   0.771383\n 5  │ 317.771  1520.62  45.2975  19.1802   0.423428\n 6  │ 315.181  1536.94  36.7556  49.1832   1.33812\n 7  │ 333.641  1519.88  53.8161  46.712    0.867993\n 8  │ 325.729  1528.43  47.8989  37.6367   0.785752\n 9  │ 311.601  1497.46  41.4     15.1257   0.365355\n 10 │ 335.244  1532.65  64.616   0.0       0.0\n 11 │ 327.935  1552.54  57.2036  0.485275  0.00848329\n 12 │ 323.861  1519.28  49.355   24.3703   0.493776\n 13 │ 332.736  1509.04  59.6272  18.2905   0.306747\n 14 │ 328.243  1531.7   51.5431  32.4744   0.630043\n 15 │ 336.186  1536.17  64.0205  15.243    0.238096\n 16 │ 329.468  1526.42  58.6856  0.0       0.0\n 17 │ 320.086  1517.67  43.218   35.9663   0.832207\n 18 │ 325.887  1497.86  50.8753  25.9059   0.509205\n 19 │ 311.31   1529.24  33.8976  49.6557   1.46487\n 20 │ 309.404  1549.71  33.987   41.1105   1.20959\n 21 │ 327.973  1512.27  51.9135  29.8809   0.575591\n 22 │ 310.973  1523.54  40.5191  16.8259   0.415258\n 23 │ 323.794  1545.11  47.1842  32.9669   0.698686\n ⋮  │    ⋮        ⋮        ⋮        ⋮          ⋮\n\n\n\nplt = data(tbldye) * mapping(:σ1) * AoG.density()\ndraw(plt; axis=(;title=\"Parametric bootstrap estimates of σ_batch\"))\n\n\n\n\nNotice that this density plot has a spike, or mode, at zero. Although this mode appears to be diffuse, this is an artifact of the way that density plots are created. In fact, it is a pulse, as can be seen from a histogram.\n\nplt = data(tbldye) * mapping(:σ1) * AoG.histogram(;bins=100)\ndraw(plt; axis=(;title=\"Parametric bootstrap estimates of σ_batch\"))\n\n\n\n\nA value of zero for the standard deviation of the random effects is an example of a singular covariance. It is easy to detect the singularity in the case of a scalar random-effects term. However, it is not as straightforward to detect singularity in vector-valued random-effects terms.\nFor example, if we bootstrap a model fit to the sleepstudy data\n\nsleepstudy = dataset(:sleepstudy)\nmsleep = fit(MixedModel, @formula(reaction ~ 1 + days + (1 + days | subj)),\n             sleepstudy)\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\n\n\n\n\n(Intercept)\n251.4051\n6.6323\n37.91\n<1e-99\n23.7805\n\n\ndays\n10.4673\n1.5022\n6.97\n<1e-11\n5.7168\n\n\nResidual\n25.5918\n\n\n\n\n\n\n\n\n\n\nsampsleep = parametricbootstrap(MersenneTwister(666), 10_000, msleep)\ntblsleep = sampsleep.tbl\n\nTable with 10 columns and 10000 rows:\n      obj      β1       β2       σ        σ1       σ2       ρ1          ⋯\n    ┌────────────────────────────────────────────────────────────────────\n 1  │ 1721.95  252.488  11.0328  22.4544  29.6185  6.33343  0.233383    ⋯\n 2  │ 1760.85  260.763  8.55352  27.3835  20.8063  4.32895  0.914676    ⋯\n 3  │ 1750.88  246.709  12.4613  25.9951  15.8702  6.33404  0.200358    ⋯\n 4  │ 1777.33  247.683  12.9824  27.7966  27.5413  4.9878   0.121411    ⋯\n 5  │ 1738.05  245.649  10.5792  25.3596  21.5208  4.26131  0.0526768   ⋯\n 6  │ 1751.25  255.669  10.1984  26.1432  22.5389  4.58209  0.225968    ⋯\n 7  │ 1727.51  248.986  7.62095  24.6451  19.0858  4.34881  0.212916    ⋯\n 8  │ 1754.18  246.075  11.0469  26.9407  19.8341  4.55961  -0.202146   ⋯\n 9  │ 1757.47  245.407  13.7475  25.8265  20.0014  7.7647   -0.266385   ⋯\n 10 │ 1752.8   253.911  11.4977  25.7077  20.6409  6.27298  0.171494    ⋯\n 11 │ 1707.8   248.887  10.1608  23.9684  10.5923  4.32048  1.0         ⋯\n 12 │ 1773.69  252.542  10.7379  26.8795  27.7959  6.2055   0.156476    ⋯\n 13 │ 1761.27  254.712  11.0373  25.7998  23.2005  7.30831  0.368175    ⋯\n 14 │ 1737.0   260.299  10.5659  24.6504  29.0113  4.26877  -0.0785722  ⋯\n 15 │ 1760.12  258.949  10.1464  27.2089  8.02971  7.01898  0.727216    ⋯\n 16 │ 1723.7   249.204  11.7868  24.9861  18.6887  3.08433  0.633218    ⋯\n 17 │ 1734.14  262.586  8.96611  24.0011  26.7969  5.37598  0.29709     ⋯\n 18 │ 1788.8   260.376  11.658   28.6099  26.1245  5.85586  0.0323584   ⋯\n 19 │ 1752.44  239.962  11.0195  26.2388  23.2242  4.45586  0.482518    ⋯\n 20 │ 1752.92  258.171  11.6339  25.7146  27.3026  4.87036  0.225691    ⋯\n 21 │ 1740.81  254.09   7.91985  25.2195  16.2247  6.08679  0.462549    ⋯\n 22 │ 1756.6   245.791  10.3434  26.2627  23.289   5.50225  -0.143375   ⋯\n 23 │ 1759.01  256.131  9.10794  27.136   27.5008  3.51222  1.0         ⋯\n ⋮  │    ⋮        ⋮        ⋮        ⋮        ⋮        ⋮         ⋮       ⋱\n\n\nthe singularity can be exhibited as a standard deviation of zero or as a correlation of ±1.\n\nconfint(sampsleep)\n\nDictTable with 2 columns and 6 rows:\n par   lower      upper\n ────┬───────────────────\n β1  │ 237.905    264.231\n β2  │ 7.44545    13.3516\n ρ1  │ -0.409926  1.0\n σ   │ 22.6345    28.5125\n σ1  │ 10.6756    33.3567\n σ2  │ 3.07053    7.82204\n\n\nA histogram of the estimated correlations from the bootstrap sample has a spike at +1.\n\nplt = data(tblsleep) * mapping(:ρ1) * AoG.histogram(;bins=100)\ndraw(plt; axis=(;title=\"Parametric bootstrap samples of correlation of random effects\"))\n\n\n\n\nor, as a count,\n\ncount(tblsleep.ρ1  .≈ 1)\n\n293\n\n\nClose examination of the histogram shows a few values of -1.\n\ncount(tblsleep.ρ1 .≈ -1)\n\n2\n\n\nFurthermore there are even a few cases where the estimate of the standard deviation of the random effect for the intercept is zero.\n\ncount(tblsleep.σ1 .≈ 0)\n\n7\n\n\nThere is a general condition to check for singularity of an estimated covariance matrix or matrices in a bootstrap sample. The parameter optimized in the estimation is θ, the relative covariance parameter. Some of the elements of this parameter vector must be non-negative and, when one of these components is approximately zero, one of the covariance matrices will be singular.\nThe issingular method for a MixedModel object that tests if a parameter vector θ corresponds to a boundary or singular fit.\nThis operation is encapsulated in a method for the issingular function that works on MixedModelBootstrap objects.\n\ncount(issingular(sampsleep))\n\n302\n\n\n\n\n5 References\n\n\nKronmüller, E., & Barr, D. J. (2007). Perspective-free pragmatics: Broken precedents and the recovery-from-preemption hypothesis. Journal of Memory and Language, 56(3), 436–455. https://doi.org/10.1016/j.jml.2006.05.002\n\n\n\n\n\n\n Back to top"
    +    "text": "The speed of MixedModels.jl relative to its predecessors makes the parametric bootstrap much more computationally tractable. This is valuable because the parametric bootstrap can be used to produce more accurate confidence intervals than methods based on standard errors or profiling of the likelihood surface.\nThis page is adapted from the MixedModels.jl docs\n\n1 The parametric bootstrap\nBootstrapping is a family of procedures for generating sample values of a statistic, allowing for visualization of the distribution of the statistic or for inference from this sample of values. Bootstrapping also belongs to a larger family of procedures called resampling, which are based on creating new samples of data from an existing one, then computing statistics on the new samples, in order to examine the distribution of the relevant statistics.\nA parametric bootstrap is used with a parametric model, m, that has been fit to data. The procedure is to simulate n response vectors from m using the estimated parameter values and refit m to these responses in turn, accumulating the statistics of interest at each iteration.\nThe parameters of a LinearMixedModel object are the fixed-effects parameters, β, the standard deviation, σ, of the per-observation noise, and the covariance parameter, θ, that defines the variance-covariance matrices of the random effects. A technical description of the covariance parameter can be found in the MixedModels.jl docs. Lisa Schwetlick and Daniel Backhaus have provided a more beginner-friendly description of the covariance parameter in the documentation for MixedModelsSim.jl. For today’s purposes – looking at the uncertainty in the estimates from a fitted model – we can simply use values from the fitted model, but we will revisit the parametric bootstrap as a convenient way to simulate new data, potentially with different parameter values, for power analysis.\nAttach the packages to be used\n\n\nCode\nusing AlgebraOfGraphics\nusing CairoMakie\nusing DataFrames\nusing MixedModels\nusing MixedModelsMakie\nusing Random\nusing SMLP2023: dataset\n\nusing AlgebraOfGraphics: AlgebraOfGraphics as AoG\nCairoMakie.activate!(; type=\"svg\") # use SVG (other options include PNG)\n\nimport ProgressMeter\nProgressMeter.ijulia_behavior(:clear);\n\n\nNote that the precise stream of random numbers generated for a given seed can change between Julia versions. For exact reproducibility, you either need to have the exact same Julia version or use the StableRNGs package.\n\n\n2 A model of moderate complexity\nThe kb07 data (Kronmüller & Barr, 2007) are one of the datasets provided by the MixedModels package.\n\nkb07 = dataset(:kb07)\n\nArrow.Table with 1789 rows, 7 columns, and schema:\n :subj      String\n :item      String\n :spkr      String\n :prec      String\n :load      String\n :rt_trunc  Int16\n :rt_raw    Int16\n\n\nConvert the table to a DataFrame for summary.\n\nkb07 = DataFrame(kb07)\ndescribe(kb07)\n\n7×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nDataType\n\n\n\n\n1\nsubj\n\nS030\n\nS103\n0\nString\n\n\n2\nitem\n\nI01\n\nI32\n0\nString\n\n\n3\nspkr\n\nnew\n\nold\n0\nString\n\n\n4\nprec\n\nbreak\n\nmaintain\n0\nString\n\n\n5\nload\n\nno\n\nyes\n0\nString\n\n\n6\nrt_trunc\n2182.2\n579\n1940.0\n5171\n0\nInt16\n\n\n7\nrt_raw\n2226.24\n579\n1940.0\n15923\n0\nInt16\n\n\n\n\n\n\nThe experimental factors; spkr, prec, and load, are two-level factors.\n\ncontrasts = Dict(:spkr => EffectsCoding(),\n                 :prec => EffectsCoding(),\n                 :load => EffectsCoding(),\n                 :subj => Grouping(),\n                 :item => Grouping())\n\nThe EffectsCoding contrast is used with these to create a ±1 encoding. Furthermore, Grouping constrasts are assigned to the subj and item factors. This is not a contrast per-se but an indication that these factors will be used as grouping factors for random effects and, therefore, there is no need to create a contrast matrix. For large numbers of levels in a grouping factor, an attempt to create a contrast matrix may cause memory overflow.\nIt is not important in these cases but a good practice in any case.\nWe can look at an initial fit of moderate complexity:\n\nform = @formula(rt_trunc ~ 1 + spkr * prec * load +\n                          (1 + spkr + prec + load | subj) +\n                          (1 + spkr + prec + load | item))\nm0 = fit(MixedModel, form, kb07; contrasts)\n\nMinimizing 894   Time: 0:00:00 ( 0.15 ms/it)\n  objective:  28637.97101084821\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\nσ_item\n\n\n\n\n(Intercept)\n2181.6424\n77.3505\n28.20\n<1e-99\n301.8688\n362.4643\n\n\nspkr: old\n67.7496\n17.9604\n3.77\n0.0002\n33.0582\n41.1114\n\n\nprec: maintain\n-333.9200\n47.1534\n-7.08\n<1e-11\n58.8506\n247.3123\n\n\nload: yes\n78.8006\n19.7270\n3.99\n<1e-04\n66.9612\n43.3929\n\n\nspkr: old & prec: maintain\n-21.9960\n15.8191\n-1.39\n0.1644\n\n\n\n\nspkr: old & load: yes\n18.3832\n15.8191\n1.16\n0.2452\n\n\n\n\nprec: maintain & load: yes\n4.5327\n15.8191\n0.29\n0.7745\n\n\n\n\nspkr: old & prec: maintain & load: yes\n23.6377\n15.8191\n1.49\n0.1351\n\n\n\n\nResidual\n669.0519\n\n\n\n\n\n\n\n\n\n\nThe default display in Quarto uses the pretty MIME show method for the model and omits the estimated correlations of the random effects.\nThe VarCorr extractor displays these.\n\nVarCorr(m0)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\nsubj\n(Intercept)\n91124.7853\n301.8688\n\n\n\n\n\n\nspkr: old\n1092.8468\n33.0582\n+1.00\n\n\n\n\n\nprec: maintain\n3463.3971\n58.8506\n-0.62\n-0.62\n\n\n\n\nload: yes\n4483.7997\n66.9612\n+0.36\n+0.36\n+0.51\n\n\nitem\n(Intercept)\n131380.3392\n362.4643\n\n\n\n\n\n\nspkr: old\n1690.1464\n41.1114\n+0.42\n\n\n\n\n\nprec: maintain\n61163.3893\n247.3123\n-0.69\n+0.37\n\n\n\n\nload: yes\n1882.9463\n43.3929\n+0.29\n+0.14\n-0.13\n\n\nResidual\n\n447630.5113\n669.0519\n\n\n\n\n\n\n\n\nNone of the two-factor or three-factor interaction terms in the fixed-effects are significant. In the random-effects terms only the scalar random effects and the prec random effect for item appear to be warranted, leading to the reduced formula\n\n# formula f4 from https://doi.org/10.33016/nextjournal.100002\nform = @formula(rt_trunc ~ 1 + spkr * prec * load + (1 | subj) + (1 + prec | item))\n\nm1 = fit(MixedModel, form, kb07; contrasts)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.7582\n77.4709\n28.16\n<1e-99\n364.7286\n298.1109\n\n\nspkr: old\n67.8114\n16.0526\n4.22\n<1e-04\n\n\n\n\nprec: maintain\n-333.8582\n47.4629\n-7.03\n<1e-11\n252.6687\n\n\n\nload: yes\n78.6849\n16.0525\n4.90\n<1e-06\n\n\n\n\nspkr: old & prec: maintain\n-21.8802\n16.0525\n-1.36\n0.1729\n\n\n\n\nspkr: old & load: yes\n18.3214\n16.0526\n1.14\n0.2537\n\n\n\n\nprec: maintain & load: yes\n4.4710\n16.0526\n0.28\n0.7806\n\n\n\n\nspkr: old & prec: maintain & load: yes\n23.5219\n16.0525\n1.47\n0.1428\n\n\n\n\nResidual\n678.9318\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m1)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133026.917\n364.729\n\n\n\n\nprec: maintain\n63841.496\n252.669\n-0.70\n\n\nsubj\n(Intercept)\n88870.080\n298.111\n\n\n\nResidual\n\n460948.432\n678.932\n\n\n\n\n\n\nThese two models are nested and can be compared with a likelihood-ratio test.\n\nMixedModels.likelihoodratiotest(m0, m1)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nrt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 | subj) + (1 + prec | item)\n13\n28658\n\n\n\n\n\nrt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item)\n29\n28638\n21\n16\n0.1979\n\n\n\n\n\nThe p-value of approximately 20% leads us to prefer the simpler model, m1, to the more complex, m0.\n\n\n3 Bootstrap basics\nTo bootstrap the model parameters, first initialize a random number generator then create a bootstrap sample and extract the table of parameter estimates from it.\n\nconst RNG = MersenneTwister(42)\nsamp = parametricbootstrap(RNG, 5_000, m1)\ntbl = samp.tbl\n\nWARNING: redefinition of constant RNG. This may fail, cause incorrect answers, or produce other errors.\n\n\nTable with 18 columns and 5000 rows:\n      obj      β1       β2       β3        β4       β5        β6        ⋯\n    ┌────────────────────────────────────────────────────────────────────\n 1  │ 28691.9  2049.88  71.6398  -268.333  75.1566  -17.8459  -1.90968  ⋯\n 2  │ 28642.6  2197.6   73.0832  -313.409  68.018   -18.062   30.2431   ⋯\n 3  │ 28748.1  2175.11  85.4784  -311.786  48.8342  -27.3483  4.97874   ⋯\n 4  │ 28683.7  2158.48  86.0498  -301.013  71.0117  -45.3329  27.3747   ⋯\n 5  │ 28692.6  2342.6   81.9722  -305.764  78.9518  -37.0137  -5.59876  ⋯\n 6  │ 28691.5  2198.64  90.4229  -387.855  93.4767  -37.2244  3.13351   ⋯\n 7  │ 28687.7  2239.49  74.5619  -364.151  93.9154  -43.441   19.1572   ⋯\n 8  │ 28673.4  2217.89  76.4077  -409.228  52.5047  -11.5777  26.4348   ⋯\n 9  │ 28688.6  2184.89  81.3252  -298.693  89.8482  -5.99902  21.3162   ⋯\n 10 │ 28597.6  2227.36  57.3436  -332.635  102.565  -3.85194  7.23222   ⋯\n 11 │ 28700.8  2131.61  58.1253  -363.018  88.0576  -24.1592  2.26268   ⋯\n 12 │ 28644.8  2145.05  94.7216  -242.292  103.158  -27.2788  27.0664   ⋯\n 13 │ 28678.8  2113.56  55.4491  -382.425  89.8252  -12.9669  -2.74384  ⋯\n 14 │ 28773.5  2123.38  117.383  -258.883  78.8998  -63.4576  26.0778   ⋯\n 15 │ 28566.3  2168.89  52.8287  -289.968  71.5994  -14.7045  23.0165   ⋯\n 16 │ 28764.1  2344.66  54.5199  -356.183  54.3082  -36.4798  32.3478   ⋯\n 17 │ 28547.7  2230.3   56.2337  -329.448  88.8918  -27.7721  23.5031   ⋯\n 18 │ 28729.3  2268.71  77.0147  -328.11   73.1191  -15.0292  17.2227   ⋯\n 19 │ 28686.4  2138.38  88.8036  -273.697  68.418   -40.8522  17.7392   ⋯\n 20 │ 28620.7  1955.46  97.2794  -334.827  92.7866  -1.49191  33.0718   ⋯\n 21 │ 28664.1  2115.45  71.7916  -375.888  76.0984  -27.8142  24.5494   ⋯\n 22 │ 28742.2  2173.11  83.8428  -351.655  76.0148  -15.7201  -8.95264  ⋯\n 23 │ 28720.3  2192.85  62.7893  -327.012  47.9618  -23.188   16.7164   ⋯\n ⋮  │    ⋮        ⋮        ⋮        ⋮         ⋮        ⋮         ⋮      ⋱\n\n\nAn empirical density plot of the estimates of the residual standard deviation is obtained as\n\nplt = data(tbl) * mapping(:σ) * AoG.density()\ndraw(plt; axis=(;title=\"Parametric bootstrap estimates of σ\"))\n\n\n\n\nA density plot of the estimates of the standard deviation of the random effects is obtained as\n\nplt = data(tbl) * mapping(\n  [:σ1, :σ2, :σ3] .=> \"Bootstrap replicates of standard deviations\";\n  color=dims(1) => renamer([\"Item intercept\", \"Item speaker\", \"Subj\"])\n) * AoG.density()\ndraw(plt; figure=(;supertitle=\"Parametric bootstrap estimates of variance components\"))\n\n\n\n\nThe bootstrap sample can be used to generate intervals that cover a certain percentage of the bootstrapped values. We refer to these as “coverage intervals”, similar to a confidence interval. The shortest such intervals, obtained with the shortestcovint extractor, correspond to a highest posterior density interval in Bayesian inference.\nWe generate these for all random and fixed effects:\n\nconfint(samp)\n\nDictTable with 2 columns and 13 rows:\n par   lower      upper\n ────┬─────────────────────\n β1  │ 2032.48    2340.42\n β2  │ 34.3982    97.8079\n β3  │ -428.09    -244.474\n β4  │ 48.642     110.179\n β5  │ -53.4336   8.42791\n β6  │ -11.3574   51.5299\n β7  │ -27.1799   36.3332\n β8  │ -9.28905   53.5917\n ρ1  │ -0.912778  -0.471124\n σ   │ 654.965    700.928\n σ1  │ 265.276    456.967\n σ2  │ 179.402    321.017\n σ3  │ 232.096    359.745\n\n\n\ndraw(\n  data(samp.β) * mapping(:β; color=:coefname) * AoG.density();\n  figure=(; resolution=(800, 450)),\n)\n\n\n\n\nFor the fixed effects, MixedModelsMakie provides a convenience interface to plot the combined coverage intervals and density plots\n\nridgeplot(samp)\n\n\n\n\nOften the intercept will be on a different scale and potentially less interesting, so we can stop it from being included in the plot:\n\nridgeplot(samp; show_intercept=false, xlabel=\"Bootstrap density and 95%CI\")\n\n\n\n\n\n\n4 Singularity\nLet’s consider the classic dysetuff dataset:\n\ndyestuff = dataset(:dyestuff)\nmdye = fit(MixedModel, @formula(yield ~ 1 + (1 | batch)), dyestuff)\n\n\n\n\n\nEst.\nSE\nz\np\nσ_batch\n\n\n\n\n(Intercept)\n1527.5000\n17.6946\n86.33\n<1e-99\n37.2603\n\n\nResidual\n49.5101\n\n\n\n\n\n\n\n\n\n\nsampdye = parametricbootstrap(MersenneTwister(1234321), 10_000, mdye)\ntbldye = sampdye.tbl\n\nTable with 5 columns and 10000 rows:\n      obj      β1       σ        σ1        θ1\n    ┌────────────────────────────────────────────────\n 1  │ 339.022  1509.13  67.4315  14.312    0.212245\n 2  │ 322.689  1538.08  47.9831  25.5673   0.53284\n 3  │ 324.002  1508.02  50.1346  21.7622   0.434076\n 4  │ 331.887  1538.47  53.2238  41.0559   0.771382\n 5  │ 317.771  1520.62  45.2975  19.1802   0.423428\n 6  │ 315.181  1536.94  36.7556  49.1832   1.33812\n 7  │ 333.641  1519.88  53.8161  46.712    0.867993\n 8  │ 325.729  1528.43  47.8989  37.6367   0.785752\n 9  │ 311.601  1497.46  41.4     15.1257   0.365355\n 10 │ 335.244  1532.65  64.616   0.0       0.0\n 11 │ 327.935  1552.54  57.2036  0.485281  0.00848339\n 12 │ 323.861  1519.28  49.355   24.3703   0.493776\n 13 │ 332.736  1509.04  59.6272  18.2905   0.306747\n 14 │ 328.243  1531.7   51.5431  32.4743   0.630042\n 15 │ 336.186  1536.17  64.0205  15.243    0.238096\n 16 │ 329.468  1526.42  58.6856  0.0       0.0\n 17 │ 320.086  1517.67  43.218   35.9663   0.832206\n 18 │ 325.887  1497.86  50.8753  25.9059   0.509205\n 19 │ 311.31   1529.24  33.8976  49.6557   1.46487\n 20 │ 309.404  1549.71  33.987   41.1105   1.20959\n 21 │ 327.973  1512.27  51.9135  29.8809   0.575591\n 22 │ 310.973  1523.54  40.5191  16.8259   0.415258\n 23 │ 323.794  1545.11  47.1842  32.9669   0.698686\n ⋮  │    ⋮        ⋮        ⋮        ⋮          ⋮\n\n\n\nplt = data(tbldye) * mapping(:σ1) * AoG.density()\ndraw(plt; axis=(;title=\"Parametric bootstrap estimates of σ_batch\"))\n\n\n\n\nNotice that this density plot has a spike, or mode, at zero. Although this mode appears to be diffuse, this is an artifact of the way that density plots are created. In fact, it is a pulse, as can be seen from a histogram.\n\nplt = data(tbldye) * mapping(:σ1) * AoG.histogram(;bins=100)\ndraw(plt; axis=(;title=\"Parametric bootstrap estimates of σ_batch\"))\n\n\n\n\nA value of zero for the standard deviation of the random effects is an example of a singular covariance. It is easy to detect the singularity in the case of a scalar random-effects term. However, it is not as straightforward to detect singularity in vector-valued random-effects terms.\nFor example, if we bootstrap a model fit to the sleepstudy data\n\nsleepstudy = dataset(:sleepstudy)\nmsleep = fit(MixedModel, @formula(reaction ~ 1 + days + (1 + days | subj)),\n             sleepstudy)\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\n\n\n\n\n(Intercept)\n251.4051\n6.6323\n37.91\n<1e-99\n23.7805\n\n\ndays\n10.4673\n1.5022\n6.97\n<1e-11\n5.7168\n\n\nResidual\n25.5918\n\n\n\n\n\n\n\n\n\n\nsampsleep = parametricbootstrap(MersenneTwister(666), 10_000, msleep)\ntblsleep = sampsleep.tbl\n\nTable with 10 columns and 10000 rows:\n      obj      β1       β2       σ        σ1       σ2       ρ1          ⋯\n    ┌────────────────────────────────────────────────────────────────────\n 1  │ 1721.95  252.488  11.0328  22.4544  29.6185  6.33343  0.233383    ⋯\n 2  │ 1760.85  260.763  8.55352  27.3835  20.8062  4.32893  0.914691    ⋯\n 3  │ 1750.88  246.709  12.4613  25.9951  15.8702  6.33404  0.200358    ⋯\n 4  │ 1777.33  247.683  12.9824  27.7966  27.5413  4.9878   0.121411    ⋯\n 5  │ 1738.05  245.649  10.5792  25.3596  21.5208  4.26131  0.0526769   ⋯\n 6  │ 1751.25  255.669  10.1984  26.1432  22.5389  4.58209  0.225968    ⋯\n 7  │ 1727.51  248.986  7.62095  24.6451  19.0858  4.34881  0.212916    ⋯\n 8  │ 1754.18  246.075  11.0469  26.9407  19.8341  4.55961  -0.202146   ⋯\n 9  │ 1757.47  245.407  13.7475  25.8265  20.0014  7.7647   -0.266385   ⋯\n 10 │ 1752.8   253.911  11.4977  25.7077  20.6409  6.27298  0.171494    ⋯\n 11 │ 1707.8   248.887  10.1608  23.9684  10.5923  4.32039  1.0         ⋯\n 12 │ 1773.69  252.542  10.7379  26.8795  27.7956  6.20553  0.156471    ⋯\n 13 │ 1761.27  254.712  11.0373  25.7998  23.2005  7.30831  0.368175    ⋯\n 14 │ 1737.0   260.299  10.5659  24.6504  29.0113  4.26877  -0.0785721  ⋯\n 15 │ 1760.12  258.949  10.1464  27.2089  8.02793  7.01923  0.727289    ⋯\n 16 │ 1723.7   249.204  11.7868  24.9861  18.6887  3.08433  0.633218    ⋯\n 17 │ 1734.14  262.586  8.96611  24.0011  26.7969  5.37598  0.29709     ⋯\n 18 │ 1788.8   260.376  11.658   28.6099  26.1245  5.85586  0.0323581   ⋯\n 19 │ 1752.44  239.962  11.0195  26.2388  23.2242  4.45586  0.482511    ⋯\n 20 │ 1752.92  258.171  11.6339  25.7146  27.3026  4.87036  0.22569     ⋯\n 21 │ 1740.81  254.09   7.91985  25.2195  16.2247  6.08679  0.462549    ⋯\n 22 │ 1756.6   245.791  10.3434  26.2627  23.289   5.50225  -0.143375   ⋯\n 23 │ 1759.01  256.131  9.10794  27.136   27.501   3.51224  1.0         ⋯\n ⋮  │    ⋮        ⋮        ⋮        ⋮        ⋮        ⋮         ⋮       ⋱\n\n\nthe singularity can be exhibited as a standard deviation of zero or as a correlation of ±1.\n\nconfint(sampsleep)\n\nDictTable with 2 columns and 6 rows:\n par   lower      upper\n ────┬───────────────────\n β1  │ 237.905    264.231\n β2  │ 7.44545    13.3516\n ρ1  │ -0.409926  1.0\n σ   │ 22.6345    28.5125\n σ1  │ 10.6756    33.3567\n σ2  │ 3.07053    7.82204\n\n\nA histogram of the estimated correlations from the bootstrap sample has a spike at +1.\n\nplt = data(tblsleep) * mapping(:ρ1) * AoG.histogram(;bins=100)\ndraw(plt; axis=(;title=\"Parametric bootstrap samples of correlation of random effects\"))\n\n\n\n\nor, as a count,\n\ncount(tblsleep.ρ1  .≈ 1)\n\n291\n\n\nClose examination of the histogram shows a few values of -1.\n\ncount(tblsleep.ρ1 .≈ -1)\n\n2\n\n\nFurthermore there are even a few cases where the estimate of the standard deviation of the random effect for the intercept is zero.\n\ncount(tblsleep.σ1 .≈ 0)\n\n6\n\n\nThere is a general condition to check for singularity of an estimated covariance matrix or matrices in a bootstrap sample. The parameter optimized in the estimation is θ, the relative covariance parameter. Some of the elements of this parameter vector must be non-negative and, when one of these components is approximately zero, one of the covariance matrices will be singular.\nThe issingular method for a MixedModel object that tests if a parameter vector θ corresponds to a boundary or singular fit.\nThis operation is encapsulated in a method for the issingular function that works on MixedModelBootstrap objects.\n\ncount(issingular(sampsleep))\n\n299\n\n\n\n\n5 References\n\n\nKronmüller, E., & Barr, D. J. (2007). Perspective-free pragmatics: Broken precedents and the recovery-from-preemption hypothesis. Journal of Memory and Language, 56(3), 436–455. https://doi.org/10.1016/j.jml.2006.05.002\n\n\n\n\n\n\n Back to top"
       },
       {
         "objectID": "contrasts_fggk21.html",
    @@ -417,56 +417,56 @@
         "href": "contrasts_fggk21.html#preprocessing",
         "title": "Mixed Models Tutorial: Contrast Coding",
         "section": "1.3 Preprocessing",
    -    "text": "1.3 Preprocessing\n\n1.3.1 Read data\n\ntbl = dataset(:fggk21)\n\nArrow.Table with 525126 rows, 7 columns, and schema:\n :Cohort  String\n :School  String\n :Child   String\n :Sex     String\n :age     Float64\n :Test    String\n :score   Float64\n\n\n\ndf = DataFrame(tbl)\ndescribe(df)\n\n7×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nDataType\n\n\n\n\n1\nCohort\n\n2011\n\n2019\n0\nString\n\n\n2\nSchool\n\nS100043\n\nS800200\n0\nString\n\n\n3\nChild\n\nC002352\n\nC117966\n0\nString\n\n\n4\nSex\n\nfemale\n\nmale\n0\nString\n\n\n5\nage\n8.56073\n7.99452\n8.55852\n9.10609\n0\nFloat64\n\n\n6\nTest\n\nBPT\n\nStar_r\n0\nString\n\n\n7\nscore\n226.141\n1.14152\n4.65116\n1530.0\n0\nFloat64\n\n\n\n\n\n\n\n\n1.3.2 Extract a stratified subsample\nWe extract a random sample of 500 children from the Sex (2) x Test (5) cells of the design. Cohort and School are random.\n\ndat = @chain df begin\n  @transform(:Sex = :Sex == \"female\" ? \"Girls\" : \"Boys\")\n  @groupby(:Test, :Sex)\n  combine(x -> x[sample(1:nrow(x), 500), :])\nend\n\n5000×7 DataFrame4975 rows omitted\n\n\n\nRow\nTest\nSex\nCohort\nSchool\nChild\nage\nscore\n\n\n\nString\nString\nString\nString\nString\nFloat64\nFloat64\n\n\n\n\n1\nS20_r\nBoys\n2012\nS102763\nC040847\n8.41615\n4.34783\n\n\n2\nS20_r\nBoys\n2015\nS104905\nC066955\n8.63518\n4.34783\n\n\n3\nS20_r\nBoys\n2015\nS102817\nC055854\n8.54757\n4.65116\n\n\n4\nS20_r\nBoys\n2019\nS100729\nC075664\n8.71732\n4.7619\n\n\n5\nS20_r\nBoys\n2011\nS103627\nC023343\n8.25188\n4.34783\n\n\n6\nS20_r\nBoys\n2017\nS101321\nC115651\n9.08419\n4.7619\n\n\n7\nS20_r\nBoys\n2016\nS106392\nC107856\n8.99658\n4.34783\n\n\n8\nS20_r\nBoys\n2016\nS101187\nC107005\n8.98289\n4.54545\n\n\n9\nS20_r\nBoys\n2019\nS112525\nC096501\n8.88433\n5.0\n\n\n10\nS20_r\nBoys\n2011\nS104796\nC032859\n8.33676\n4.87805\n\n\n11\nS20_r\nBoys\n2014\nS101205\nC044727\n8.45722\n3.77358\n\n\n12\nS20_r\nBoys\n2012\nS102416\nC040811\n8.41615\n4.54545\n\n\n13\nS20_r\nBoys\n2014\nS102891\nC035657\n8.37509\n5.0\n\n\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n\n\n4989\nRun\nGirls\n2017\nS103536\nC058528\n8.564\n1107.0\n\n\n4990\nRun\nGirls\n2011\nS101850\nC032512\n8.33676\n766.0\n\n\n4991\nRun\nGirls\n2014\nS102416\nC017135\n8.20808\n830.0\n\n\n4992\nRun\nGirls\n2017\nS101953\nC044492\n8.45175\n864.0\n\n\n4993\nRun\nGirls\n2011\nS110929\nC100016\n8.91718\n990.0\n\n\n4994\nRun\nGirls\n2018\nS101771\nC062348\n8.6078\n1080.0\n\n\n4995\nRun\nGirls\n2014\nS101023\nC035407\n8.37509\n972.0\n\n\n4996\nRun\nGirls\n2016\nS100833\nC016700\n8.19986\n864.0\n\n\n4997\nRun\nGirls\n2013\nS105454\nC031026\n8.33128\n964.0\n\n\n4998\nRun\nGirls\n2012\nS104425\nC041058\n8.41615\n846.0\n\n\n4999\nRun\nGirls\n2018\nS103068\nC024585\n8.27379\n801.0\n\n\n5000\nRun\nGirls\n2013\nS102817\nC006499\n8.0794\n1195.0\n\n\n\n\n\n\n\n\n1.3.3 Transformations\n\ntransform!(dat, :age, :age => (x -> x .- 8.5) => :a1) # centered age (linear)\nselect!(groupby(dat, :Test), :, :score => zscore => :zScore) # z-score\n\n5000×9 DataFrame4975 rows omitted\n\n\n\nRow\nTest\nSex\nCohort\nSchool\nChild\nage\nscore\na1\nzScore\n\n\n\nString\nString\nString\nString\nString\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\nS20_r\nBoys\n2012\nS102763\nC040847\n8.41615\n4.34783\n-0.0838467\n-0.385904\n\n\n2\nS20_r\nBoys\n2015\nS104905\nC066955\n8.63518\n4.34783\n0.135181\n-0.385904\n\n\n3\nS20_r\nBoys\n2015\nS102817\nC055854\n8.54757\n4.65116\n0.0475702\n0.33109\n\n\n4\nS20_r\nBoys\n2019\nS100729\nC075664\n8.71732\n4.7619\n0.217317\n0.59285\n\n\n5\nS20_r\nBoys\n2011\nS103627\nC023343\n8.25188\n4.34783\n-0.248118\n-0.385904\n\n\n6\nS20_r\nBoys\n2017\nS101321\nC115651\n9.08419\n4.7619\n0.584189\n0.59285\n\n\n7\nS20_r\nBoys\n2016\nS106392\nC107856\n8.99658\n4.34783\n0.496578\n-0.385904\n\n\n8\nS20_r\nBoys\n2016\nS101187\nC107005\n8.98289\n4.54545\n0.482888\n0.0812285\n\n\n9\nS20_r\nBoys\n2019\nS112525\nC096501\n8.88433\n5.0\n0.384326\n1.15563\n\n\n10\nS20_r\nBoys\n2011\nS104796\nC032859\n8.33676\n4.87805\n-0.163244\n0.867378\n\n\n11\nS20_r\nBoys\n2014\nS101205\nC044727\n8.45722\n3.77358\n-0.0427789\n-1.74323\n\n\n12\nS20_r\nBoys\n2012\nS102416\nC040811\n8.41615\n4.54545\n-0.0838467\n0.0812285\n\n\n13\nS20_r\nBoys\n2014\nS102891\nC035657\n8.37509\n5.0\n-0.124914\n1.15563\n\n\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n\n\n4989\nRun\nGirls\n2017\nS103536\nC058528\n8.564\n1107.0\n0.0639973\n0.709804\n\n\n4990\nRun\nGirls\n2011\nS101850\nC032512\n8.33676\n766.0\n-0.163244\n-1.53402\n\n\n4991\nRun\nGirls\n2014\nS102416\nC017135\n8.20808\n830.0\n-0.291923\n-1.11289\n\n\n4992\nRun\nGirls\n2017\nS101953\nC044492\n8.45175\n864.0\n-0.0482546\n-0.889165\n\n\n4993\nRun\nGirls\n2011\nS110929\nC100016\n8.91718\n990.0\n0.41718\n-0.0600699\n\n\n4994\nRun\nGirls\n2018\nS101771\nC062348\n8.6078\n1080.0\n0.107803\n0.532141\n\n\n4995\nRun\nGirls\n2014\nS101023\nC035407\n8.37509\n972.0\n-0.124914\n-0.178512\n\n\n4996\nRun\nGirls\n2016\nS100833\nC016700\n8.19986\n864.0\n-0.300137\n-0.889165\n\n\n4997\nRun\nGirls\n2013\nS105454\nC031026\n8.33128\n964.0\n-0.16872\n-0.231153\n\n\n4998\nRun\nGirls\n2012\nS104425\nC041058\n8.41615\n846.0\n-0.0838467\n-1.00761\n\n\n4999\nRun\nGirls\n2018\nS103068\nC024585\n8.27379\n801.0\n-0.226215\n-1.30371\n\n\n5000\nRun\nGirls\n2013\nS102817\nC006499\n8.0794\n1195.0\n-0.420602\n1.28886\n\n\n\n\n\n\n\ndat2 = combine(\n  groupby(dat, [:Test, :Sex]),\n  :score => mean,\n  :score => std,\n  :zScore => mean,\n  :zScore => std,\n)\n\n10×6 DataFrame\n\n\n\nRow\nTest\nSex\nscore_mean\nscore_std\nzScore_mean\nzScore_std\n\n\n\nString\nString\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\nS20_r\nBoys\n4.59208\n0.420939\n0.191439\n0.99497\n\n\n2\nBPT\nBoys\n4.0142\n0.711809\n0.365836\n0.966971\n\n\n3\nSLJ\nBoys\n129.73\n18.2168\n0.228496\n0.967567\n\n\n4\nStar_r\nBoys\n2.08087\n0.30591\n0.137967\n1.0496\n\n\n5\nRun\nBoys\n1032.66\n159.495\n0.220651\n1.0495\n\n\n6\nS20_r\nGirls\n4.4301\n0.409872\n-0.191439\n0.968811\n\n\n7\nBPT\nGirls\n3.4756\n0.657898\n-0.365836\n0.893735\n\n\n8\nSLJ\nGirls\n121.126\n18.4585\n-0.228496\n0.980402\n\n\n9\nStar_r\nGirls\n2.00045\n0.270627\n-0.137967\n0.928543\n\n\n10\nRun\nGirls\n965.596\n136.182\n-0.220651\n0.896095\n\n\n\n\n\n\n\n\n1.3.4 Figure of age x Sex x Test interactions\nThe main results of relevance here are shown in Figure 2 of Scientific Reports 11:17566."
    +    "text": "1.3 Preprocessing\n\n1.3.1 Read data\n\ntbl = dataset(:fggk21)\n\nArrow.Table with 525126 rows, 7 columns, and schema:\n :Cohort  String\n :School  String\n :Child   String\n :Sex     String\n :age     Float64\n :Test    String\n :score   Float64\n\n\n\ndf = DataFrame(tbl)\ndescribe(df)\n\n7×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nDataType\n\n\n\n\n1\nCohort\n\n2011\n\n2019\n0\nString\n\n\n2\nSchool\n\nS100043\n\nS800200\n0\nString\n\n\n3\nChild\n\nC002352\n\nC117966\n0\nString\n\n\n4\nSex\n\nfemale\n\nmale\n0\nString\n\n\n5\nage\n8.56073\n7.99452\n8.55852\n9.10609\n0\nFloat64\n\n\n6\nTest\n\nBPT\n\nStar_r\n0\nString\n\n\n7\nscore\n226.141\n1.14152\n4.65116\n1530.0\n0\nFloat64\n\n\n\n\n\n\n\n\n1.3.2 Extract a stratified subsample\nWe extract a random sample of 500 children from the Sex (2) x Test (5) cells of the design. Cohort and School are random.\n\ndat = @chain df begin\n  @transform(:Sex = :Sex == \"female\" ? \"Girls\" : \"Boys\")\n  @groupby(:Test, :Sex)\n  combine(x -> x[sample(1:nrow(x), 500), :])\nend\n\n5000×7 DataFrame4975 rows omitted\n\n\n\nRow\nTest\nSex\nCohort\nSchool\nChild\nage\nscore\n\n\n\nString\nString\nString\nString\nString\nFloat64\nFloat64\n\n\n\n\n1\nS20_r\nBoys\n2019\nS110668\nC096335\n8.88433\n4.7619\n\n\n2\nS20_r\nBoys\n2013\nS102337\nC039677\n8.41342\n4.44444\n\n\n3\nS20_r\nBoys\n2018\nS101424\nC090337\n8.85421\n4.87805\n\n\n4\nS20_r\nBoys\n2012\nS102647\nC040834\n8.41615\n3.92157\n\n\n5\nS20_r\nBoys\n2019\nS106422\nC066268\n8.63244\n4.44444\n\n\n6\nS20_r\nBoys\n2019\nS103123\nC095572\n8.88433\n4.65116\n\n\n7\nS20_r\nBoys\n2018\nS105004\nC062881\n8.6078\n4.08163\n\n\n8\nS20_r\nBoys\n2014\nS111521\nC064409\n8.61875\n4.44444\n\n\n9\nS20_r\nBoys\n2013\nS101734\nC087023\n8.82683\n5.0\n\n\n10\nS20_r\nBoys\n2011\nS100997\nC003825\n8.0\n4.87805\n\n\n11\nS20_r\nBoys\n2017\nS103615\nC048459\n8.47912\n4.54545\n\n\n12\nS20_r\nBoys\n2019\nS110498\nC106099\n8.9692\n4.44444\n\n\n13\nS20_r\nBoys\n2013\nS101618\nC002488\n7.99452\n4.44444\n\n\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n\n\n4989\nRun\nGirls\n2016\nS401470\nC033512\n8.35044\n1224.0\n\n\n4990\nRun\nGirls\n2015\nS105028\nC023979\n8.2601\n927.0\n\n\n4991\nRun\nGirls\n2019\nS104760\nC028705\n8.3039\n900.0\n\n\n4992\nRun\nGirls\n2014\nS100341\nC004529\n8.03833\n1116.0\n\n\n4993\nRun\nGirls\n2018\nS105788\nC063015\n8.6078\n990.0\n\n\n4994\nRun\nGirls\n2013\nS110504\nC013368\n8.16427\n758.0\n\n\n4995\nRun\nGirls\n2011\nS103690\nC015026\n8.16975\n910.0\n\n\n4996\nRun\nGirls\n2019\nS105170\nC076589\n8.71732\n1080.0\n\n\n4997\nRun\nGirls\n2012\nS101527\nC007231\n8.08214\n918.0\n\n\n4998\nRun\nGirls\n2014\nS111650\nC036209\n8.37509\n999.0\n\n\n4999\nRun\nGirls\n2019\nS100754\nC046973\n8.47091\n801.0\n\n\n5000\nRun\nGirls\n2016\nS101758\nC039050\n8.39973\n1025.0\n\n\n\n\n\n\n\n\n1.3.3 Transformations\n\ntransform!(dat, :age, :age => (x -> x .- 8.5) => :a1) # centered age (linear)\nselect!(groupby(dat, :Test), :, :score => zscore => :zScore) # z-score\n\n5000×9 DataFrame4975 rows omitted\n\n\n\nRow\nTest\nSex\nCohort\nSchool\nChild\nage\nscore\na1\nzScore\n\n\n\nString\nString\nString\nString\nString\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\nS20_r\nBoys\n2019\nS110668\nC096335\n8.88433\n4.7619\n0.384326\n0.593648\n\n\n2\nS20_r\nBoys\n2013\nS102337\nC039677\n8.41342\n4.44444\n-0.0865845\n-0.170993\n\n\n3\nS20_r\nBoys\n2018\nS101424\nC090337\n8.85421\n4.87805\n0.354209\n0.873395\n\n\n4\nS20_r\nBoys\n2012\nS102647\nC040834\n8.41615\n3.92157\n-0.0838467\n-1.4304\n\n\n5\nS20_r\nBoys\n2019\nS106422\nC066268\n8.63244\n4.44444\n0.132444\n-0.170993\n\n\n6\nS20_r\nBoys\n2019\nS103123\nC095572\n8.88433\n4.65116\n0.384326\n0.326913\n\n\n7\nS20_r\nBoys\n2018\nS105004\nC062881\n8.6078\n4.08163\n0.107803\n-1.04487\n\n\n8\nS20_r\nBoys\n2014\nS111521\nC064409\n8.61875\n4.44444\n0.118754\n-0.170993\n\n\n9\nS20_r\nBoys\n2013\nS101734\nC087023\n8.82683\n5.0\n0.326831\n1.16713\n\n\n10\nS20_r\nBoys\n2011\nS100997\nC003825\n8.0\n4.87805\n-0.5\n0.873395\n\n\n11\nS20_r\nBoys\n2017\nS103615\nC048459\n8.47912\n4.54545\n-0.0208761\n0.0723016\n\n\n12\nS20_r\nBoys\n2019\nS110498\nC106099\n8.9692\n4.44444\n0.469199\n-0.170993\n\n\n13\nS20_r\nBoys\n2013\nS101618\nC002488\n7.99452\n4.44444\n-0.505476\n-0.170993\n\n\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n⋮\n\n\n4989\nRun\nGirls\n2016\nS401470\nC033512\n8.35044\n1224.0\n-0.149555\n1.45155\n\n\n4990\nRun\nGirls\n2015\nS105028\nC023979\n8.2601\n927.0\n-0.239904\n-0.485259\n\n\n4991\nRun\nGirls\n2019\nS104760\nC028705\n8.3039\n900.0\n-0.196099\n-0.661333\n\n\n4992\nRun\nGirls\n2014\nS100341\nC004529\n8.03833\n1116.0\n-0.46167\n0.747257\n\n\n4993\nRun\nGirls\n2018\nS105788\nC063015\n8.6078\n990.0\n0.107803\n-0.0744205\n\n\n4994\nRun\nGirls\n2013\nS110504\nC013368\n8.16427\n758.0\n-0.335729\n-1.58735\n\n\n4995\nRun\nGirls\n2011\nS103690\nC015026\n8.16975\n910.0\n-0.330253\n-0.596121\n\n\n4996\nRun\nGirls\n2019\nS105170\nC076589\n8.71732\n1080.0\n0.217317\n0.512492\n\n\n4997\nRun\nGirls\n2012\nS101527\nC007231\n8.08214\n918.0\n-0.417864\n-0.543951\n\n\n4998\nRun\nGirls\n2014\nS111650\nC036209\n8.37509\n999.0\n-0.124914\n-0.0157293\n\n\n4999\nRun\nGirls\n2019\nS100754\nC046973\n8.47091\n801.0\n-0.0290897\n-1.30694\n\n\n5000\nRun\nGirls\n2016\nS101758\nC039050\n8.39973\n1025.0\n-0.100274\n0.153823\n\n\n\n\n\n\n\ndat2 = combine(\n  groupby(dat, [:Test, :Sex]),\n  :score => mean,\n  :score => std,\n  :zScore => mean,\n  :zScore => std,\n)\n\n10×6 DataFrame\n\n\n\nRow\nTest\nSex\nscore_mean\nscore_std\nzScore_mean\nzScore_std\n\n\n\nString\nString\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\nS20_r\nBoys\n4.57867\n0.424137\n0.152294\n1.02158\n\n\n2\nBPT\nBoys\n3.9792\n0.696835\n0.328751\n0.995591\n\n\n3\nSLJ\nBoys\n129.246\n20.266\n0.186383\n1.04575\n\n\n4\nStar_r\nBoys\n2.07038\n0.293227\n0.096337\n1.01924\n\n\n5\nRun\nBoys\n1036.2\n160.92\n0.226874\n1.0494\n\n\n6\nS20_r\nGirls\n4.45221\n0.396463\n-0.152294\n0.954929\n\n\n7\nBPT\nGirls\n3.519\n0.62376\n-0.328751\n0.891187\n\n\n8\nSLJ\nGirls\n122.022\n17.7489\n-0.186383\n0.915861\n\n\n9\nStar_r\nGirls\n2.01495\n0.279605\n-0.096337\n0.971885\n\n\n10\nRun\nGirls\n966.622\n136.951\n-0.226874\n0.89309\n\n\n\n\n\n\n\n\n1.3.4 Figure of age x Sex x Test interactions\nThe main results of relevance here are shown in Figure 2 of Scientific Reports 11:17566."
       },
       {
         "objectID": "contrasts_fggk21.html#seqdiffcoding-contr1",
         "href": "contrasts_fggk21.html#seqdiffcoding-contr1",
         "title": "Mixed Models Tutorial: Contrast Coding",
         "section": "2.1 SeqDiffCoding: contr1",
    -    "text": "2.1 SeqDiffCoding: contr1\nSeqDiffCoding was used in the publication. This specification tests pairwise differences between the five neighboring levels of Test, that is:\n\nSDC1: 2-1\nSDC2: 3-2\nSDC3: 4-3\nSDC4: 5-4\n\nThe levels were sorted such that these contrasts map onto four a priori hypotheses; in other words, they are theoretically motivated pairwise comparisons. The motivation also encompasses theoretically motivated interactions with Sex. The order of levels can also be explicitly specified during contrast construction. This is very useful if levels are in a different order in the dataframe. We recommend the explicit specification to increase transparency of the code.\nThe statistical disadvantage of SeqDiffCoding is that the contrasts are not orthogonal, that is the contrasts are correlated. This is obvious from the fact that levels 2, 3, and 4 are all used in two contrasts. One consequence of this is that correlation parameters estimated between neighboring contrasts (e.g., 2-1 and 3-2) are difficult to interpret. Usually, they will be negative because assuming some practical limitation on the overall range (e.g., between levels 1 and 3), a small “2-1” effect “correlates” negatively with a larger “3-2” effect for mathematical reasons.\nObviously, the tradeoff between theoretical motivation and statistical purity is something that must be considered carefully when planning the analysis.\n\ncontr1 = merge(\n  Dict(nm => Grouping() for nm in (:School, :Child, :Cohort)),\n  Dict(\n    :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n    :Test => SeqDiffCoding(;\n      levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"]\n    ),\n  ),\n)\n\nDict{Symbol, StatsModels.AbstractContrasts} with 5 entries:\n  :Child  => Grouping()\n  :School => Grouping()\n  :Test   => SeqDiffCoding([\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"])\n  :Cohort => Grouping()\n  :Sex    => EffectsCoding(nothing, [\"Girls\", \"Boys\"])\n\n\n\nf_ovi_1 = @formula zScore ~ 1 + Test + (1 | Child);\n\n\nm_ovi_SeqDiff_1 = fit(MixedModel, f_ovi_1, dat; contrasts=contr1)\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0004\n0.0143\n-0.03\n0.9783\n0.7826\n\n\nTest: Star_r\n-0.0014\n0.0442\n-0.03\n0.9756\n\n\n\nTest: S20_r\n0.0093\n0.0440\n0.21\n0.8332\n\n\n\nTest: SLJ\n-0.0005\n0.0441\n-0.01\n0.9911\n\n\n\nTest: BPT\n-0.0055\n0.0442\n-0.12\n0.9006\n\n\n\nResidual\n0.6228\n\n\n\n\n\n\n\n\n\nIn this case, any differences between tests identified by the contrasts would be spurious because each test was standardized (i.e., M=0, \\(SD\\)=1). The differences could also be due to an imbalance in the number of boys and girls or in the number of missing observations for each test.\nThe primary interest in this study related to interactions of the test contrasts with and age and Sex. We start with age (linear) and its interaction with the four test contrasts.\n\nm_ovi_SeqDiff_2 = let\n  form = @formula zScore ~ 1 + Test * a1 + (1 | Child)\n  fit(MixedModel, form, dat; contrasts=contr1)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0159\n0.0145\n-1.09\n0.2755\n0.7819\n\n\nTest: Star_r\n-0.0116\n0.0450\n-0.26\n0.7974\n\n\n\nTest: S20_r\n0.0082\n0.0447\n0.18\n0.8546\n\n\n\nTest: SLJ\n0.0047\n0.0448\n0.11\n0.9160\n\n\n\nTest: BPT\n-0.0234\n0.0450\n-0.52\n0.6037\n\n\n\na1\n0.2520\n0.0495\n5.09\n<1e-06\n\n\n\nTest: Star_r & a1\n0.1796\n0.1541\n1.17\n0.2438\n\n\n\nTest: S20_r & a1\n0.0309\n0.1543\n0.20\n0.8414\n\n\n\nTest: SLJ & a1\n-0.1054\n0.1524\n-0.69\n0.4892\n\n\n\nTest: BPT & a1\n0.2569\n0.1501\n1.71\n0.0871\n\n\n\nResidual\n0.6186\n\n\n\n\n\n\n\n\n\nThe difference between older and younger childrend is larger for Star_r than for Run (0.2473). S20_r did not differ significantly from Star_r (-0.0377) and SLJ (-0.0113) The largest difference in developmental gain was between BPT and SLJ (0.3355).\nPlease note that standard errors of this LMM are anti-conservative because the LMM is missing a lot of information in the RES (e..g., contrast-related VCs snd CPs for Child, School, and Cohort.\nNext we add the main effect of Sex and its interaction with the four test contrasts.\n\nm_ovi_SeqDiff_3 = let\n  form = @formula zScore ~ 1 + Test * (a1 + Sex) + (1 | Child)\n  fit(MixedModel, form, dat; contrasts=contr1)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0151\n0.0141\n-1.07\n0.2854\n0.7457\n\n\nTest: Star_r\n-0.0116\n0.0438\n-0.26\n0.7918\n\n\n\nTest: S20_r\n0.0080\n0.0435\n0.18\n0.8545\n\n\n\nTest: SLJ\n0.0064\n0.0435\n0.15\n0.8823\n\n\n\nTest: BPT\n-0.0224\n0.0438\n-0.51\n0.6097\n\n\n\na1\n0.2367\n0.0480\n4.93\n<1e-06\n\n\n\nSex: Boys\n0.2266\n0.0138\n16.40\n<1e-59\n\n\n\nTest: Star_r & a1\n0.1538\n0.1499\n1.03\n0.3049\n\n\n\nTest: S20_r & a1\n0.0272\n0.1501\n0.18\n0.8562\n\n\n\nTest: SLJ & a1\n-0.1310\n0.1483\n-0.88\n0.3772\n\n\n\nTest: BPT & a1\n0.2529\n0.1461\n1.73\n0.0835\n\n\n\nTest: Star_r & Sex: Boys\n-0.0861\n0.0428\n-2.01\n0.0445\n\n\n\nTest: S20_r & Sex: Boys\n0.0555\n0.0427\n1.30\n0.1932\n\n\n\nTest: SLJ & Sex: Boys\n0.0346\n0.0427\n0.81\n0.4183\n\n\n\nTest: BPT & Sex: Boys\n0.1347\n0.0429\n3.14\n0.0017\n\n\n\nResidual\n0.6173\n\n\n\n\n\n\n\n\n\nThe significant interactions with Sex reflect mostly differences related to muscle power, where the physiological constitution gives boys an advantage. The sex difference is smaller when coordination and cognition play a role – as in the Star_r test. (Caveat: SEs are estimated with an underspecified RES.)\nThe final step in this first series is to add the interactions between the three covariates. A significant interaction between any of the four Test contrasts and age (linear) x Sex was hypothesized to reflect a prepubertal signal (i.e., hormones start to rise in girls’ ninth year of life). However, this hypothesis is linked to a specific shape of the interaction: Girls would need to gain more than boys in tests of muscular power.\n\nf_ovi = @formula zScore ~ 1 + Test * a1 * Sex + (1 | Child)\nm_ovi_SeqDiff = fit(MixedModel, f_ovi, dat; contrasts=contr1)\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0146\n0.0141\n-1.03\n0.3011\n0.7441\n\n\nTest: Star_r\n-0.0108\n0.0438\n-0.25\n0.8054\n\n\n\nTest: S20_r\n0.0090\n0.0435\n0.21\n0.8362\n\n\n\nTest: SLJ\n0.0077\n0.0435\n0.18\n0.8599\n\n\n\nTest: BPT\n-0.0252\n0.0438\n-0.58\n0.5644\n\n\n\na1\n0.2362\n0.0480\n4.92\n<1e-06\n\n\n\nSex: Boys\n0.2298\n0.0141\n16.28\n<1e-58\n\n\n\nTest: Star_r & a1\n0.1528\n0.1498\n1.02\n0.3076\n\n\n\nTest: S20_r & a1\n0.0279\n0.1500\n0.19\n0.8523\n\n\n\nTest: SLJ & a1\n-0.1310\n0.1483\n-0.88\n0.3769\n\n\n\nTest: BPT & a1\n0.2500\n0.1461\n1.71\n0.0869\n\n\n\nTest: Star_r & Sex: Boys\n-0.0961\n0.0438\n-2.20\n0.0280\n\n\n\nTest: S20_r & Sex: Boys\n0.0705\n0.0435\n1.62\n0.1048\n\n\n\nTest: SLJ & Sex: Boys\n0.0353\n0.0435\n0.81\n0.4178\n\n\n\nTest: BPT & Sex: Boys\n0.1218\n0.0438\n2.78\n0.0054\n\n\n\na1 & Sex: Boys\n-0.0557\n0.0480\n-1.16\n0.2460\n\n\n\nTest: Star_r & a1 & Sex: Boys\n0.1638\n0.1498\n1.09\n0.2742\n\n\n\nTest: S20_r & a1 & Sex: Boys\n-0.2711\n0.1500\n-1.81\n0.0707\n\n\n\nTest: SLJ & a1 & Sex: Boys\n0.0081\n0.1483\n0.05\n0.9563\n\n\n\nTest: BPT & a1 & Sex: Boys\n0.2199\n0.1461\n1.51\n0.1322\n\n\n\nResidual\n0.6180\n\n\n\n\n\n\n\n\n\nThe results are very clear: Despite an abundance of statistical power there is no evidence for the differences between boys and girls in how much they gain in the ninth year of life in these five tests. The authors argue that, in this case, absence of evidence looks very much like evidence of absence of a hypothesized interaction.\nIn the next two sections we use different contrasts. Does this have a bearing on this result? We still ignore for now that we are looking at anti-conservative test statistics."
    +    "text": "2.1 SeqDiffCoding: contr1\nSeqDiffCoding was used in the publication. This specification tests pairwise differences between the five neighboring levels of Test, that is:\n\nSDC1: 2-1\nSDC2: 3-2\nSDC3: 4-3\nSDC4: 5-4\n\nThe levels were sorted such that these contrasts map onto four a priori hypotheses; in other words, they are theoretically motivated pairwise comparisons. The motivation also encompasses theoretically motivated interactions with Sex. The order of levels can also be explicitly specified during contrast construction. This is very useful if levels are in a different order in the dataframe. We recommend the explicit specification to increase transparency of the code.\nThe statistical disadvantage of SeqDiffCoding is that the contrasts are not orthogonal, that is the contrasts are correlated. This is obvious from the fact that levels 2, 3, and 4 are all used in two contrasts. One consequence of this is that correlation parameters estimated between neighboring contrasts (e.g., 2-1 and 3-2) are difficult to interpret. Usually, they will be negative because assuming some practical limitation on the overall range (e.g., between levels 1 and 3), a small “2-1” effect “correlates” negatively with a larger “3-2” effect for mathematical reasons.\nObviously, the tradeoff between theoretical motivation and statistical purity is something that must be considered carefully when planning the analysis.\n\ncontr1 = merge(\n  Dict(nm => Grouping() for nm in (:School, :Child, :Cohort)),\n  Dict(\n    :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n    :Test => SeqDiffCoding(;\n      levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"]\n    ),\n  ),\n)\n\nDict{Symbol, StatsModels.AbstractContrasts} with 5 entries:\n  :Child  => Grouping()\n  :School => Grouping()\n  :Test   => SeqDiffCoding([\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"])\n  :Cohort => Grouping()\n  :Sex    => EffectsCoding(nothing, [\"Girls\", \"Boys\"])\n\n\n\nf_ovi_1 = @formula zScore ~ 1 + Test + (1 | Child);\n\n\nm_ovi_SeqDiff_1 = fit(MixedModel, f_ovi_1, dat; contrasts=contr1)\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0013\n0.0143\n-0.09\n0.9282\n0.7615\n\n\nTest: Star_r\n-0.0137\n0.0441\n-0.31\n0.7552\n\n\n\nTest: S20_r\n0.0164\n0.0441\n0.37\n0.7096\n\n\n\nTest: SLJ\n-0.0048\n0.0441\n-0.11\n0.9142\n\n\n\nTest: BPT\n-0.0010\n0.0443\n-0.02\n0.9829\n\n\n\nResidual\n0.6479\n\n\n\n\n\n\n\n\n\nIn this case, any differences between tests identified by the contrasts would be spurious because each test was standardized (i.e., M=0, \\(SD\\)=1). The differences could also be due to an imbalance in the number of boys and girls or in the number of missing observations for each test.\nThe primary interest in this study related to interactions of the test contrasts with and age and Sex. We start with age (linear) and its interaction with the four test contrasts.\n\nm_ovi_SeqDiff_2 = let\n  form = @formula zScore ~ 1 + Test * a1 + (1 | Child)\n  fit(MixedModel, form, dat; contrasts=contr1)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0224\n0.0145\n-1.55\n0.1217\n0.7481\n\n\nTest: Star_r\n-0.0162\n0.0446\n-0.36\n0.7169\n\n\n\nTest: S20_r\n0.0101\n0.0447\n0.23\n0.8209\n\n\n\nTest: SLJ\n-0.0049\n0.0448\n-0.11\n0.9125\n\n\n\nTest: BPT\n-0.0265\n0.0450\n-0.59\n0.5564\n\n\n\na1\n0.3480\n0.0493\n7.06\n<1e-11\n\n\n\nTest: Star_r & a1\n0.0077\n0.1538\n0.05\n0.9601\n\n\n\nTest: S20_r & a1\n0.0803\n0.1510\n0.53\n0.5948\n\n\n\nTest: SLJ & a1\n-0.0043\n0.1508\n-0.03\n0.9774\n\n\n\nTest: BPT & a1\n0.4062\n0.1543\n2.63\n0.0085\n\n\n\nResidual\n0.6535\n\n\n\n\n\n\n\n\n\nThe difference between older and younger childrend is larger for Star_r than for Run (0.2473). S20_r did not differ significantly from Star_r (-0.0377) and SLJ (-0.0113) The largest difference in developmental gain was between BPT and SLJ (0.3355).\nPlease note that standard errors of this LMM are anti-conservative because the LMM is missing a lot of information in the RES (e..g., contrast-related VCs snd CPs for Child, School, and Cohort.\nNext we add the main effect of Sex and its interaction with the four test contrasts.\n\nm_ovi_SeqDiff_3 = let\n  form = @formula zScore ~ 1 + Test * (a1 + Sex) + (1 | Child)\n  fit(MixedModel, form, dat; contrasts=contr1)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0207\n0.0141\n-1.47\n0.1426\n0.7208\n\n\nTest: Star_r\n-0.0158\n0.0436\n-0.36\n0.7164\n\n\n\nTest: S20_r\n0.0095\n0.0438\n0.22\n0.8283\n\n\n\nTest: SLJ\n-0.0056\n0.0439\n-0.13\n0.8981\n\n\n\nTest: BPT\n-0.0243\n0.0440\n-0.55\n0.5818\n\n\n\na1\n0.3205\n0.0482\n6.65\n<1e-10\n\n\n\nSex: Boys\n0.1928\n0.0139\n13.90\n<1e-43\n\n\n\nTest: Star_r & a1\n0.0394\n0.1508\n0.26\n0.7940\n\n\n\nTest: S20_r & a1\n0.0783\n0.1480\n0.53\n0.5969\n\n\n\nTest: SLJ & a1\n-0.0127\n0.1477\n-0.09\n0.9313\n\n\n\nTest: BPT & a1\n0.3963\n0.1511\n2.62\n0.0087\n\n\n\nTest: Star_r & Sex: Boys\n-0.1331\n0.0430\n-3.10\n0.0020\n\n\n\nTest: S20_r & Sex: Boys\n0.0572\n0.0430\n1.33\n0.1828\n\n\n\nTest: SLJ & Sex: Boys\n0.0319\n0.0430\n0.74\n0.4586\n\n\n\nTest: BPT & Sex: Boys\n0.1405\n0.0431\n3.26\n0.0011\n\n\n\nResidual\n0.6511\n\n\n\n\n\n\n\n\n\nThe significant interactions with Sex reflect mostly differences related to muscle power, where the physiological constitution gives boys an advantage. The sex difference is smaller when coordination and cognition play a role – as in the Star_r test. (Caveat: SEs are estimated with an underspecified RES.)\nThe final step in this first series is to add the interactions between the three covariates. A significant interaction between any of the four Test contrasts and age (linear) x Sex was hypothesized to reflect a prepubertal signal (i.e., hormones start to rise in girls’ ninth year of life). However, this hypothesis is linked to a specific shape of the interaction: Girls would need to gain more than boys in tests of muscular power.\n\nf_ovi = @formula zScore ~ 1 + Test * a1 * Sex + (1 | Child)\nm_ovi_SeqDiff = fit(MixedModel, f_ovi, dat; contrasts=contr1)\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0208\n0.0142\n-1.47\n0.1418\n0.7220\n\n\nTest: Star_r\n-0.0173\n0.0437\n-0.40\n0.6928\n\n\n\nTest: S20_r\n0.0116\n0.0438\n0.26\n0.7920\n\n\n\nTest: SLJ\n-0.0057\n0.0439\n-0.13\n0.8958\n\n\n\nTest: BPT\n-0.0260\n0.0440\n-0.59\n0.5551\n\n\n\na1\n0.3212\n0.0482\n6.66\n<1e-10\n\n\n\nSex: Boys\n0.1926\n0.0142\n13.60\n<1e-41\n\n\n\nTest: Star_r & a1\n0.0398\n0.1509\n0.26\n0.7920\n\n\n\nTest: S20_r & a1\n0.0784\n0.1479\n0.53\n0.5963\n\n\n\nTest: SLJ & a1\n-0.0090\n0.1478\n-0.06\n0.9514\n\n\n\nTest: BPT & a1\n0.3933\n0.1511\n2.60\n0.0093\n\n\n\nTest: Star_r & Sex: Boys\n-0.1377\n0.0437\n-3.15\n0.0016\n\n\n\nTest: S20_r & Sex: Boys\n0.0659\n0.0438\n1.50\n0.1330\n\n\n\nTest: SLJ & Sex: Boys\n0.0322\n0.0439\n0.73\n0.4634\n\n\n\nTest: BPT & Sex: Boys\n0.1290\n0.0440\n2.93\n0.0034\n\n\n\na1 & Sex: Boys\n0.0014\n0.0482\n0.03\n0.9761\n\n\n\nTest: Star_r & a1 & Sex: Boys\n0.0824\n0.1509\n0.55\n0.5849\n\n\n\nTest: S20_r & a1 & Sex: Boys\n-0.1453\n0.1479\n-0.98\n0.3259\n\n\n\nTest: SLJ & a1 & Sex: Boys\n-0.0068\n0.1478\n-0.05\n0.9633\n\n\n\nTest: BPT & a1 & Sex: Boys\n0.1892\n0.1511\n1.25\n0.2105\n\n\n\nResidual\n0.6495\n\n\n\n\n\n\n\n\n\nThe results are very clear: Despite an abundance of statistical power there is no evidence for the differences between boys and girls in how much they gain in the ninth year of life in these five tests. The authors argue that, in this case, absence of evidence looks very much like evidence of absence of a hypothesized interaction.\nIn the next two sections we use different contrasts. Does this have a bearing on this result? We still ignore for now that we are looking at anti-conservative test statistics."
       },
       {
         "objectID": "contrasts_fggk21.html#helmertcoding-contr2",
         "href": "contrasts_fggk21.html#helmertcoding-contr2",
         "title": "Mixed Models Tutorial: Contrast Coding",
         "section": "2.2 HelmertCoding: contr2",
    -    "text": "2.2 HelmertCoding: contr2\nThe second set of contrasts uses HelmertCoding. Helmert coding codes each level as the difference from the average of the lower levels. With the default order of Test levels we get the following test statistics which we describe in reverse order of appearance in model output\n\nHeC4: 5 - mean(1,2,3,4)\nHeC3: 4 - mean(1,2,3)\nHeC2: 3 - mean(1,2)\nHeC1: 2 - 1\n\nIn the model output, HeC1 will be reported first and HeC4 last.\nThere is some justification for the HeC4 specification in a post-hoc manner because the fifth test (BPT) turned out to be different from the other four tests in that high performance is most likely not only related to physical fitness, but also to overweight/obesity, that is for a subset of children high scores on this test might be indicative of physical unfitness. A priori the SDC4 contrast 5-4 between BPT (5) and SLJ (4) was motivated because conceptually both are tests of the physical fitness component Muscular Power, BPT for upper limbs and SLJ for lower limbs, respectively.\nOne could argue that there is justification for HeC3 because Run (1), Star_r (2), and S20 (3) involve running but SLJ (4) does not. Sports scientists, however, recoil. For them it does not make much sense to average the different running tests, because they draw on completely different physiological resources; it is a variant of the old apples-and-oranges problem.\nThe justification for HeC3 is thatRun (1) and Star_r (2) draw more strongly on cardiosrespiratory Endurance than S20 (3) due to the longer duration of the runs compared to sprinting for 20 m which is a pure measure of the physical-fitness component Speed. Again, sports scientists are not very happy with this proposal.\nFinally, HeC1 contrasts the fitness components Endurance, indicated best by Run (1), and Coordination, indicated by Star_r (2). Endurance (i.e., running for 6 minutes) is considered to be the best indicator of health-related status among the five tests because it is a rather pure measure of cardiorespiratory fitness. The Star_r test requires execution of a pre-instructed sequence of forward, sideways, and backward runs. This coordination of body movements implies a demand on working memory (i.e., remembering the order of these subruns) and executive control processes, but performats also depends on endurance. HeC1 yields a measure of Coordination “corrected” for the contribution of Endurance.\nThe statistical advantage of HelmertCoding is that the resulting contrasts are orthogonal (uncorrelated). This allows for optimal partitioning of variance and statistical power. It is also more efficient to estimate “orthogonal” than “non-orthogonal” random-effect structures.\n\ncontr2 = Dict(\n  :School => Grouping(),\n  :Child => Grouping(),\n  :Cohort => Grouping(),\n  :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n  :Test => HelmertCoding(;\n    levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n  ),\n);\n\n\nm_ovi_Helmert = fit(MixedModel, f_ovi, dat; contrasts=contr2)\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0146\n0.0141\n-1.03\n0.3011\n0.7441\n\n\nTest: Star_r\n-0.0054\n0.0219\n-0.25\n0.8054\n\n\n\nTest: S20_r\n0.0012\n0.0125\n0.10\n0.9238\n\n\n\nTest: SLJ\n0.0025\n0.0089\n0.28\n0.7774\n\n\n\nTest: BPT\n-0.0035\n0.0069\n-0.51\n0.6086\n\n\n\na1\n0.2362\n0.0480\n4.92\n<1e-06\n\n\n\nSex: Boys\n0.2298\n0.0141\n16.28\n<1e-58\n\n\n\nTest: Star_r & a1\n0.0764\n0.0749\n1.02\n0.3076\n\n\n\nTest: S20_r & a1\n0.0348\n0.0434\n0.80\n0.4227\n\n\n\nTest: SLJ & a1\n-0.0154\n0.0299\n-0.51\n0.6079\n\n\n\nTest: BPT & a1\n0.0408\n0.0232\n1.76\n0.0786\n\n\n\nTest: Star_r & Sex: Boys\n-0.0481\n0.0219\n-2.20\n0.0280\n\n\n\nTest: S20_r & Sex: Boys\n0.0075\n0.0125\n0.60\n0.5508\n\n\n\nTest: SLJ & Sex: Boys\n0.0126\n0.0089\n1.41\n0.1591\n\n\n\nTest: BPT & Sex: Boys\n0.0319\n0.0069\n4.62\n<1e-05\n\n\n\na1 & Sex: Boys\n-0.0557\n0.0480\n-1.16\n0.2460\n\n\n\nTest: Star_r & a1 & Sex: Boys\n0.0819\n0.0749\n1.09\n0.2742\n\n\n\nTest: S20_r & a1 & Sex: Boys\n-0.0631\n0.0434\n-1.45\n0.1461\n\n\n\nTest: SLJ & a1 & Sex: Boys\n-0.0295\n0.0299\n-0.99\n0.3244\n\n\n\nTest: BPT & a1 & Sex: Boys\n0.0263\n0.0232\n1.13\n0.2571\n\n\n\nResidual\n0.6180\n\n\n\n\n\n\n\n\n\nWe forego a detailed discussion of the effects, but note that again none of the interactions between age x Sex with the four test contrasts was significant.\nThe default labeling of Helmert contrasts may lead to confusions with other contrasts. Therefore, we could provide our own labels:\nlabels=[\"c2.1\", \"c3.12\", \"c4.123\", \"c5.1234\"]\nOnce the order of levels is memorized the proposed labelling is very transparent."
    +    "text": "2.2 HelmertCoding: contr2\nThe second set of contrasts uses HelmertCoding. Helmert coding codes each level as the difference from the average of the lower levels. With the default order of Test levels we get the following test statistics which we describe in reverse order of appearance in model output\n\nHeC4: 5 - mean(1,2,3,4)\nHeC3: 4 - mean(1,2,3)\nHeC2: 3 - mean(1,2)\nHeC1: 2 - 1\n\nIn the model output, HeC1 will be reported first and HeC4 last.\nThere is some justification for the HeC4 specification in a post-hoc manner because the fifth test (BPT) turned out to be different from the other four tests in that high performance is most likely not only related to physical fitness, but also to overweight/obesity, that is for a subset of children high scores on this test might be indicative of physical unfitness. A priori the SDC4 contrast 5-4 between BPT (5) and SLJ (4) was motivated because conceptually both are tests of the physical fitness component Muscular Power, BPT for upper limbs and SLJ for lower limbs, respectively.\nOne could argue that there is justification for HeC3 because Run (1), Star_r (2), and S20 (3) involve running but SLJ (4) does not. Sports scientists, however, recoil. For them it does not make much sense to average the different running tests, because they draw on completely different physiological resources; it is a variant of the old apples-and-oranges problem.\nThe justification for HeC3 is thatRun (1) and Star_r (2) draw more strongly on cardiosrespiratory Endurance than S20 (3) due to the longer duration of the runs compared to sprinting for 20 m which is a pure measure of the physical-fitness component Speed. Again, sports scientists are not very happy with this proposal.\nFinally, HeC1 contrasts the fitness components Endurance, indicated best by Run (1), and Coordination, indicated by Star_r (2). Endurance (i.e., running for 6 minutes) is considered to be the best indicator of health-related status among the five tests because it is a rather pure measure of cardiorespiratory fitness. The Star_r test requires execution of a pre-instructed sequence of forward, sideways, and backward runs. This coordination of body movements implies a demand on working memory (i.e., remembering the order of these subruns) and executive control processes, but performats also depends on endurance. HeC1 yields a measure of Coordination “corrected” for the contribution of Endurance.\nThe statistical advantage of HelmertCoding is that the resulting contrasts are orthogonal (uncorrelated). This allows for optimal partitioning of variance and statistical power. It is also more efficient to estimate “orthogonal” than “non-orthogonal” random-effect structures.\n\ncontr2 = Dict(\n  :School => Grouping(),\n  :Child => Grouping(),\n  :Cohort => Grouping(),\n  :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n  :Test => HelmertCoding(;\n    levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n  ),\n);\n\n\nm_ovi_Helmert = fit(MixedModel, f_ovi, dat; contrasts=contr2)\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0208\n0.0142\n-1.47\n0.1418\n0.7220\n\n\nTest: Star_r\n-0.0086\n0.0218\n-0.40\n0.6928\n\n\n\nTest: S20_r\n0.0010\n0.0126\n0.08\n0.9384\n\n\n\nTest: SLJ\n-0.0009\n0.0090\n-0.11\n0.9157\n\n\n\nTest: BPT\n-0.0058\n0.0070\n-0.83\n0.4075\n\n\n\na1\n0.3212\n0.0482\n6.66\n<1e-10\n\n\n\nSex: Boys\n0.1926\n0.0142\n13.60\n<1e-41\n\n\n\nTest: Star_r & a1\n0.0199\n0.0754\n0.26\n0.7920\n\n\n\nTest: S20_r & a1\n0.0328\n0.0423\n0.77\n0.4392\n\n\n\nTest: SLJ & a1\n0.0141\n0.0306\n0.46\n0.6449\n\n\n\nTest: BPT & a1\n0.0871\n0.0239\n3.65\n0.0003\n\n\n\nTest: Star_r & Sex: Boys\n-0.0688\n0.0218\n-3.15\n0.0016\n\n\n\nTest: S20_r & Sex: Boys\n-0.0010\n0.0126\n-0.08\n0.9375\n\n\n\nTest: SLJ & Sex: Boys\n0.0075\n0.0090\n0.84\n0.3992\n\n\n\nTest: BPT & Sex: Boys\n0.0303\n0.0070\n4.36\n<1e-04\n\n\n\na1 & Sex: Boys\n0.0014\n0.0482\n0.03\n0.9761\n\n\n\nTest: Star_r & a1 & Sex: Boys\n0.0412\n0.0754\n0.55\n0.5849\n\n\n\nTest: S20_r & a1 & Sex: Boys\n-0.0347\n0.0423\n-0.82\n0.4124\n\n\n\nTest: SLJ & a1 & Sex: Boys\n-0.0190\n0.0306\n-0.62\n0.5343\n\n\n\nTest: BPT & a1 & Sex: Boys\n0.0264\n0.0239\n1.11\n0.2686\n\n\n\nResidual\n0.6495\n\n\n\n\n\n\n\n\n\nWe forego a detailed discussion of the effects, but note that again none of the interactions between age x Sex with the four test contrasts was significant.\nThe default labeling of Helmert contrasts may lead to confusions with other contrasts. Therefore, we could provide our own labels:\nlabels=[\"c2.1\", \"c3.12\", \"c4.123\", \"c5.1234\"]\nOnce the order of levels is memorized the proposed labelling is very transparent."
       },
       {
         "objectID": "contrasts_fggk21.html#hypothesiscoding-contr3",
         "href": "contrasts_fggk21.html#hypothesiscoding-contr3",
         "title": "Mixed Models Tutorial: Contrast Coding",
         "section": "2.3 HypothesisCoding: contr3",
    -    "text": "2.3 HypothesisCoding: contr3\nThe third set of contrasts uses HypothesisCoding. Hypothesis coding allows the user to specify their own a priori contrast matrix, subject to the mathematical constraint that the matrix has full rank. For example, sport scientists agree that the first four tests can be contrasted with BPT, because the difference is akin to a correction of overall physical fitness. However, they want to keep the pairwise comparisons for the first four tests.\n\nHyC1: BPT - mean(1,2,3,4)\nHyC2: Star_r - Run_r\nHyC3: Run_r - S20_r\nHyC4: S20_r - SLJ\n\n\ncontr3 = Dict(\n  :School => Grouping(),\n  :Child => Grouping(),\n  :Cohort => Grouping(),\n  :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n  :Test => HypothesisCoding(\n    [\n      -1 -1 -1 -1 +4\n      -1 +1 0 0 0\n       0 -1 +1 0 0\n       0 0 -1 +1 0\n    ];\n    levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n    labels=[\"BPT-other\", \"Star-End\", \"S20-Star\", \"SLJ-S20\"],\n  ),\n);\n\n\nm_ovi_Hypo = fit(MixedModel, f_ovi, dat; contrasts=contr3)\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0146\n0.0141\n-1.03\n0.3011\n0.7441\n\n\nTest: BPT-other\n-0.0707\n0.1381\n-0.51\n0.6086\n\n\n\nTest: Star-End\n-0.0108\n0.0438\n-0.25\n0.8054\n\n\n\nTest: S20-Star\n0.0090\n0.0435\n0.21\n0.8362\n\n\n\nTest: SLJ-S20\n0.0077\n0.0435\n0.18\n0.8599\n\n\n\na1\n0.2362\n0.0480\n4.92\n<1e-06\n\n\n\nSex: Boys\n0.2298\n0.0141\n16.28\n<1e-58\n\n\n\nTest: BPT-other & a1\n0.8159\n0.4638\n1.76\n0.0786\n\n\n\nTest: Star-End & a1\n0.1528\n0.1498\n1.02\n0.3076\n\n\n\nTest: S20-Star & a1\n0.0279\n0.1500\n0.19\n0.8523\n\n\n\nTest: SLJ-S20 & a1\n-0.1310\n0.1483\n-0.88\n0.3769\n\n\n\nTest: BPT-other & Sex: Boys\n0.6378\n0.1381\n4.62\n<1e-05\n\n\n\nTest: Star-End & Sex: Boys\n-0.0961\n0.0438\n-2.20\n0.0280\n\n\n\nTest: S20-Star & Sex: Boys\n0.0705\n0.0435\n1.62\n0.1048\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0353\n0.0435\n0.81\n0.4178\n\n\n\na1 & Sex: Boys\n-0.0557\n0.0480\n-1.16\n0.2460\n\n\n\nTest: BPT-other & a1 & Sex: Boys\n0.5256\n0.4638\n1.13\n0.2571\n\n\n\nTest: Star-End & a1 & Sex: Boys\n0.1638\n0.1498\n1.09\n0.2742\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.2711\n0.1500\n-1.81\n0.0707\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n0.0081\n0.1483\n0.05\n0.9563\n\n\n\nResidual\n0.6180\n\n\n\n\n\n\n\n\n\nWith HypothesisCoding we must generate our own labels for the contrasts. The default labeling of contrasts is usually not interpretable. Therefore, we provide our own.\nAnyway, none of the interactions between age x Sex with the four Test contrasts was significant for these contrasts.\n\ncontr1b = Dict(\n  :School => Grouping(),\n  :Child => Grouping(),\n  :Cohort => Grouping(),\n  :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n  :Test => HypothesisCoding(\n    [\n      -1 +1 0 0 0\n      0 -1 +1 0 0\n      0 0 -1 +1 0\n      0 0 0 -1 +1\n    ];\n    levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n    labels=[\"Star-Run\", \"S20-Star\", \"SLJ-S20\", \"BPT-SLJ\"],\n  ),\n);\n\n\nm_ovi_SeqDiff_v2 = fit(MixedModel, f_ovi, dat; contrasts=contr1b)\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0146\n0.0141\n-1.03\n0.3011\n0.7441\n\n\nTest: Star-Run\n-0.0108\n0.0438\n-0.25\n0.8054\n\n\n\nTest: S20-Star\n0.0090\n0.0435\n0.21\n0.8362\n\n\n\nTest: SLJ-S20\n0.0077\n0.0435\n0.18\n0.8599\n\n\n\nTest: BPT-SLJ\n-0.0252\n0.0438\n-0.58\n0.5644\n\n\n\na1\n0.2362\n0.0480\n4.92\n<1e-06\n\n\n\nSex: Boys\n0.2298\n0.0141\n16.28\n<1e-58\n\n\n\nTest: Star-Run & a1\n0.1528\n0.1498\n1.02\n0.3076\n\n\n\nTest: S20-Star & a1\n0.0279\n0.1500\n0.19\n0.8523\n\n\n\nTest: SLJ-S20 & a1\n-0.1310\n0.1483\n-0.88\n0.3769\n\n\n\nTest: BPT-SLJ & a1\n0.2500\n0.1461\n1.71\n0.0869\n\n\n\nTest: Star-Run & Sex: Boys\n-0.0961\n0.0438\n-2.20\n0.0280\n\n\n\nTest: S20-Star & Sex: Boys\n0.0705\n0.0435\n1.62\n0.1048\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0353\n0.0435\n0.81\n0.4178\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1218\n0.0438\n2.78\n0.0054\n\n\n\na1 & Sex: Boys\n-0.0557\n0.0480\n-1.16\n0.2460\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.1638\n0.1498\n1.09\n0.2742\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.2711\n0.1500\n-1.81\n0.0707\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n0.0081\n0.1483\n0.05\n0.9563\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.2199\n0.1461\n1.51\n0.1322\n\n\n\nResidual\n0.6180\n\n\n\n\n\n\n\n\n\n\nm_zcp_SeqD = let\n  form = @formula(\n    zScore ~ 1 + Test * a1 * Sex + zerocorr(1 + Test | Child)\n  )\n  fit(MixedModel, form, dat; contrasts=contr1b)\nend\n\nMinimizing 477   Time: 0:00:02 ( 4.34 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0148\n0.0143\n-1.03\n0.3012\n0.8563\n\n\nTest: Star-Run\n-0.0282\n0.0448\n-0.63\n0.5289\n0.5149\n\n\nTest: S20-Star\n0.0260\n0.0415\n0.63\n0.5313\n0.6137\n\n\nTest: SLJ-S20\n0.0098\n0.0409\n0.24\n0.8116\n0.5623\n\n\nTest: BPT-SLJ\n-0.0460\n0.0415\n-1.11\n0.2679\n0.2983\n\n\na1\n0.2377\n0.0486\n4.89\n<1e-06\n\n\n\nSex: Boys\n0.2298\n0.0143\n16.08\n<1e-57\n\n\n\nTest: Star-Run & a1\n0.1581\n0.1530\n1.03\n0.3014\n\n\n\nTest: S20-Star & a1\n0.0141\n0.1428\n0.10\n0.9212\n\n\n\nTest: SLJ-S20 & a1\n-0.0937\n0.1387\n-0.68\n0.4995\n\n\n\nTest: BPT-SLJ & a1\n0.1849\n0.1365\n1.35\n0.1755\n\n\n\nTest: Star-Run & Sex: Boys\n-0.1186\n0.0448\n-2.65\n0.0081\n\n\n\nTest: S20-Star & Sex: Boys\n0.0830\n0.0415\n2.00\n0.0455\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0399\n0.0409\n0.97\n0.3301\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1133\n0.0415\n2.73\n0.0063\n\n\n\na1 & Sex: Boys\n-0.0550\n0.0486\n-1.13\n0.2579\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.1211\n0.1530\n0.79\n0.4289\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.2262\n0.1428\n-1.58\n0.1131\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n-0.0154\n0.1387\n-0.11\n0.9114\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.1977\n0.1365\n1.45\n0.1473\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nm_zcp_SeqD_2 = let\n  form = @formula(\n    zScore ~ 1 + Test * a1 * Sex + (0 + Test | Child)\n  )\n  fit(MixedModel, form, dat; contrasts=contr1b)\nend\n\nMinimizing 3312      Time: 0:00:19 ( 5.77 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0140\n0.0141\n-0.99\n0.3212\n\n\n\nTest: Star-Run\n-0.0138\n0.0433\n-0.32\n0.7493\n\n\n\nTest: S20-Star\n0.0033\n0.0442\n0.08\n0.9399\n\n\n\nTest: SLJ-S20\n0.0152\n0.0444\n0.34\n0.7315\n\n\n\nTest: BPT-SLJ\n-0.0264\n0.0438\n-0.60\n0.5475\n\n\n\na1\n0.2366\n0.0479\n4.94\n<1e-06\n\n\n\nSex: Boys\n0.2299\n0.0141\n16.34\n<1e-59\n\n\n\nTest: Star-Run & a1\n0.1516\n0.1483\n1.02\n0.3066\n\n\n\nTest: S20-Star & a1\n0.0431\n0.1525\n0.28\n0.7774\n\n\n\nTest: SLJ-S20 & a1\n-0.1704\n0.1507\n-1.13\n0.2581\n\n\n\nTest: BPT-SLJ & a1\n0.2609\n0.1463\n1.78\n0.0745\n\n\n\nTest: Star-Run & Sex: Boys\n-0.0921\n0.0433\n-2.13\n0.0335\n\n\n\nTest: S20-Star & Sex: Boys\n0.0653\n0.0442\n1.48\n0.1399\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0377\n0.0444\n0.85\n0.3956\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1118\n0.0438\n2.55\n0.0108\n\n\n\na1 & Sex: Boys\n-0.0563\n0.0479\n-1.18\n0.2392\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.1391\n0.1483\n0.94\n0.3483\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.2718\n0.1525\n-1.78\n0.0747\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n0.0199\n0.1507\n0.13\n0.8947\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.2120\n0.1463\n1.45\n0.1473\n\n\n\nTest: BPT\n\n\n\n\n0.9424\n\n\nTest: SLJ\n\n\n\n\n0.9847\n\n\nTest: Star_r\n\n\n\n\n0.9667\n\n\nTest: Run\n\n\n\n\n0.9383\n\n\nTest: S20_r\n\n\n\n\n0.9951\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nm_cpx_0_SeqDiff = let\n  f_cpx_0 = @formula(\n    zScore ~ 1 + Test * a1 * Sex + (0 + Test | Child)\n  )\n  fit(MixedModel, f_cpx_0, dat; contrasts=contr1b)\nend\n\nMinimizing 3312      Time: 0:00:19 ( 5.78 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0140\n0.0141\n-0.99\n0.3212\n\n\n\nTest: Star-Run\n-0.0138\n0.0433\n-0.32\n0.7493\n\n\n\nTest: S20-Star\n0.0033\n0.0442\n0.08\n0.9399\n\n\n\nTest: SLJ-S20\n0.0152\n0.0444\n0.34\n0.7315\n\n\n\nTest: BPT-SLJ\n-0.0264\n0.0438\n-0.60\n0.5475\n\n\n\na1\n0.2366\n0.0479\n4.94\n<1e-06\n\n\n\nSex: Boys\n0.2299\n0.0141\n16.34\n<1e-59\n\n\n\nTest: Star-Run & a1\n0.1516\n0.1483\n1.02\n0.3066\n\n\n\nTest: S20-Star & a1\n0.0431\n0.1525\n0.28\n0.7774\n\n\n\nTest: SLJ-S20 & a1\n-0.1704\n0.1507\n-1.13\n0.2581\n\n\n\nTest: BPT-SLJ & a1\n0.2609\n0.1463\n1.78\n0.0745\n\n\n\nTest: Star-Run & Sex: Boys\n-0.0921\n0.0433\n-2.13\n0.0335\n\n\n\nTest: S20-Star & Sex: Boys\n0.0653\n0.0442\n1.48\n0.1399\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0377\n0.0444\n0.85\n0.3956\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1118\n0.0438\n2.55\n0.0108\n\n\n\na1 & Sex: Boys\n-0.0563\n0.0479\n-1.18\n0.2392\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.1391\n0.1483\n0.94\n0.3483\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.2718\n0.1525\n-1.78\n0.0747\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n0.0199\n0.1507\n0.13\n0.8947\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.2120\n0.1463\n1.45\n0.1473\n\n\n\nTest: BPT\n\n\n\n\n0.9424\n\n\nTest: SLJ\n\n\n\n\n0.9847\n\n\nTest: Star_r\n\n\n\n\n0.9667\n\n\nTest: Run\n\n\n\n\n0.9383\n\n\nTest: S20_r\n\n\n\n\n0.9951\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_cpx_0_SeqDiff)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\nTest: Run\n0.88037146\n0.93828112\n\n\n\n\n\n\n\nTest: Star_r\n0.93447974\n0.96668492\n+0.48\n\n\n\n\n\n\nTest: S20_r\n0.99017505\n0.99507540\n+0.44\n+0.40\n\n\n\n\n\nTest: SLJ\n0.96962748\n0.98469664\n+0.27\n+0.03\n+0.73\n\n\n\n\nTest: BPT\n0.88810522\n0.94239335\n+0.03\n+0.75\n+0.64\n+0.20\n\n\nResidual\n\n0.00000000\n0.00001165\n\n\n\n\n\n\n\n\n\n\nm_cpx_0_SeqDiff.PCA\n\n(Child = \nPrincipal components based on correlation matrix\n Test: Run     1.0    .     .     .    .\n Test: Star_r  0.48  1.0    .     .    .\n Test: S20_r   0.44  0.4   1.0    .    .\n Test: SLJ     0.27  0.03  0.73  1.0   .\n Test: BPT     0.03  0.75  0.64  0.2  1.0\n\nNormalized cumulative variances:\n[0.5303, 0.7729, 0.9615, 0.9998, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5\n Test: Run     -0.35   0.13  -0.83  -0.16   0.38\n Test: Star_r  -0.46  -0.54  -0.2    0.49  -0.46\n Test: S20_r   -0.55   0.28   0.17  -0.59  -0.48\n Test: SLJ     -0.37   0.66   0.2    0.6    0.13\n Test: BPT     -0.48  -0.41   0.45  -0.13   0.62,)\n\n\n\nf_cpx_1 = @formula(\n  zScore ~ 1 + Test * a1 * Sex + (1 + Test | Child)\n)\nm_cpx_1_SeqDiff =\nfit(MixedModel, f_cpx_1, dat; contrasts=contr1b)\n\nMinimizing 2439      Time: 0:00:14 ( 5.80 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0144\n0.0141\n-1.02\n0.3065\n0.7573\n\n\nTest: Star-Run\n-0.0216\n0.0444\n-0.49\n0.6270\n0.6708\n\n\nTest: S20-Star\n0.0143\n0.0440\n0.32\n0.7457\n0.8110\n\n\nTest: SLJ-S20\n0.0071\n0.0433\n0.16\n0.8700\n0.6998\n\n\nTest: BPT-SLJ\n-0.0291\n0.0425\n-0.68\n0.4939\n0.7109\n\n\na1\n0.2367\n0.0480\n4.93\n<1e-06\n\n\n\nSex: Boys\n0.2297\n0.0141\n16.28\n<1e-58\n\n\n\nTest: Star-Run & a1\n0.1607\n0.1517\n1.06\n0.2894\n\n\n\nTest: S20-Star & a1\n0.0323\n0.1516\n0.21\n0.8310\n\n\n\nTest: SLJ-S20 & a1\n-0.1495\n0.1476\n-1.01\n0.3111\n\n\n\nTest: BPT-SLJ & a1\n0.2529\n0.1417\n1.78\n0.0743\n\n\n\nTest: Star-Run & Sex: Boys\n-0.1016\n0.0444\n-2.29\n0.0220\n\n\n\nTest: S20-Star & Sex: Boys\n0.0753\n0.0440\n1.71\n0.0866\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0369\n0.0433\n0.85\n0.3952\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1135\n0.0425\n2.67\n0.0076\n\n\n\na1 & Sex: Boys\n-0.0555\n0.0480\n-1.16\n0.2476\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.1261\n0.1517\n0.83\n0.4059\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.2585\n0.1516\n-1.71\n0.0881\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n0.0033\n0.1476\n0.02\n0.9819\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.2089\n0.1417\n1.47\n0.1404\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nm_cpx_1_SeqDiff.PCA\n\n(Child = \nPrincipal components based on correlation matrix\n (Intercept)      1.0     .      .      .      .\n Test: Star-Run   0.54   1.0     .      .      .\n Test: S20-Star  -0.12   0.68   1.0     .      .\n Test: SLJ-S20   -0.09  -0.55  -0.13   1.0     .\n Test: BPT-SLJ    0.08   0.09  -0.26  -0.57   1.0\n\nNormalized cumulative variances:\n[0.4238, 0.7248, 0.9382, 1.0, 1.0]\n\nComponent loadings\n                   PC1    PC2    PC3    PC4    PC5\n (Intercept)     -0.33   0.05  -0.84  -0.05   0.41\n Test: Star-Run  -0.65  -0.24  -0.1   -0.02  -0.71\n Test: S20-Star  -0.36  -0.6    0.37  -0.37   0.49\n Test: SLJ-S20    0.52  -0.35  -0.33  -0.65  -0.28\n Test: BPT-SLJ   -0.25   0.68   0.18  -0.67  -0.0,)"
    +    "text": "2.3 HypothesisCoding: contr3\nThe third set of contrasts uses HypothesisCoding. Hypothesis coding allows the user to specify their own a priori contrast matrix, subject to the mathematical constraint that the matrix has full rank. For example, sport scientists agree that the first four tests can be contrasted with BPT, because the difference is akin to a correction of overall physical fitness. However, they want to keep the pairwise comparisons for the first four tests.\n\nHyC1: BPT - mean(1,2,3,4)\nHyC2: Star_r - Run_r\nHyC3: Run_r - S20_r\nHyC4: S20_r - SLJ\n\n\ncontr3 = Dict(\n  :School => Grouping(),\n  :Child => Grouping(),\n  :Cohort => Grouping(),\n  :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n  :Test => HypothesisCoding(\n    [\n      -1 -1 -1 -1 +4\n      -1 +1 0 0 0\n       0 -1 +1 0 0\n       0 0 -1 +1 0\n    ];\n    levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n    labels=[\"BPT-other\", \"Star-End\", \"S20-Star\", \"SLJ-S20\"],\n  ),\n);\n\n\nm_ovi_Hypo = fit(MixedModel, f_ovi, dat; contrasts=contr3)\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0208\n0.0142\n-1.47\n0.1418\n0.7220\n\n\nTest: BPT-other\n-0.1154\n0.1393\n-0.83\n0.4075\n\n\n\nTest: Star-End\n-0.0173\n0.0437\n-0.40\n0.6928\n\n\n\nTest: S20-Star\n0.0116\n0.0438\n0.26\n0.7920\n\n\n\nTest: SLJ-S20\n-0.0057\n0.0439\n-0.13\n0.8958\n\n\n\na1\n0.3212\n0.0482\n6.66\n<1e-10\n\n\n\nSex: Boys\n0.1926\n0.0142\n13.60\n<1e-41\n\n\n\nTest: BPT-other & a1\n1.7426\n0.4776\n3.65\n0.0003\n\n\n\nTest: Star-End & a1\n0.0398\n0.1509\n0.26\n0.7920\n\n\n\nTest: S20-Star & a1\n0.0784\n0.1479\n0.53\n0.5963\n\n\n\nTest: SLJ-S20 & a1\n-0.0090\n0.1478\n-0.06\n0.9514\n\n\n\nTest: BPT-other & Sex: Boys\n0.6066\n0.1393\n4.36\n<1e-04\n\n\n\nTest: Star-End & Sex: Boys\n-0.1377\n0.0437\n-3.15\n0.0016\n\n\n\nTest: S20-Star & Sex: Boys\n0.0659\n0.0438\n1.50\n0.1330\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0322\n0.0439\n0.73\n0.4634\n\n\n\na1 & Sex: Boys\n0.0014\n0.0482\n0.03\n0.9761\n\n\n\nTest: BPT-other & a1 & Sex: Boys\n0.5284\n0.4776\n1.11\n0.2686\n\n\n\nTest: Star-End & a1 & Sex: Boys\n0.0824\n0.1509\n0.55\n0.5849\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.1453\n0.1479\n-0.98\n0.3259\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n-0.0068\n0.1478\n-0.05\n0.9633\n\n\n\nResidual\n0.6495\n\n\n\n\n\n\n\n\n\nWith HypothesisCoding we must generate our own labels for the contrasts. The default labeling of contrasts is usually not interpretable. Therefore, we provide our own.\nAnyway, none of the interactions between age x Sex with the four Test contrasts was significant for these contrasts.\n\ncontr1b = Dict(\n  :School => Grouping(),\n  :Child => Grouping(),\n  :Cohort => Grouping(),\n  :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n  :Test => HypothesisCoding(\n    [\n      -1 +1 0 0 0\n      0 -1 +1 0 0\n      0 0 -1 +1 0\n      0 0 0 -1 +1\n    ];\n    levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n    labels=[\"Star-Run\", \"S20-Star\", \"SLJ-S20\", \"BPT-SLJ\"],\n  ),\n);\n\n\nm_ovi_SeqDiff_v2 = fit(MixedModel, f_ovi, dat; contrasts=contr1b)\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0208\n0.0142\n-1.47\n0.1418\n0.7220\n\n\nTest: Star-Run\n-0.0173\n0.0437\n-0.40\n0.6928\n\n\n\nTest: S20-Star\n0.0116\n0.0438\n0.26\n0.7920\n\n\n\nTest: SLJ-S20\n-0.0057\n0.0439\n-0.13\n0.8958\n\n\n\nTest: BPT-SLJ\n-0.0260\n0.0440\n-0.59\n0.5551\n\n\n\na1\n0.3212\n0.0482\n6.66\n<1e-10\n\n\n\nSex: Boys\n0.1926\n0.0142\n13.60\n<1e-41\n\n\n\nTest: Star-Run & a1\n0.0398\n0.1509\n0.26\n0.7920\n\n\n\nTest: S20-Star & a1\n0.0784\n0.1479\n0.53\n0.5963\n\n\n\nTest: SLJ-S20 & a1\n-0.0090\n0.1478\n-0.06\n0.9514\n\n\n\nTest: BPT-SLJ & a1\n0.3933\n0.1511\n2.60\n0.0093\n\n\n\nTest: Star-Run & Sex: Boys\n-0.1377\n0.0437\n-3.15\n0.0016\n\n\n\nTest: S20-Star & Sex: Boys\n0.0659\n0.0438\n1.50\n0.1330\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0322\n0.0439\n0.73\n0.4634\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1290\n0.0440\n2.93\n0.0034\n\n\n\na1 & Sex: Boys\n0.0014\n0.0482\n0.03\n0.9761\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.0824\n0.1509\n0.55\n0.5849\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.1453\n0.1479\n-0.98\n0.3259\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n-0.0068\n0.1478\n-0.05\n0.9633\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.1892\n0.1511\n1.25\n0.2105\n\n\n\nResidual\n0.6495\n\n\n\n\n\n\n\n\n\n\nm_zcp_SeqD = let\n  form = @formula(\n    zScore ~ 1 + Test * a1 * Sex + zerocorr(1 + Test | Child)\n  )\n  fit(MixedModel, form, dat; contrasts=contr1b)\nend\n\nMinimizing 499   Time: 0:00:00 ( 1.58 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0205\n0.0143\n-1.43\n0.1516\n0.7966\n\n\nTest: Star-Run\n-0.0398\n0.0456\n-0.87\n0.3825\n0.5853\n\n\nTest: S20-Star\n0.0216\n0.0423\n0.51\n0.6092\n0.8205\n\n\nTest: SLJ-S20\n-0.0099\n0.0410\n-0.24\n0.8090\n0.6129\n\n\nTest: BPT-SLJ\n-0.0214\n0.0418\n-0.51\n0.6089\n0.3644\n\n\na1\n0.3213\n0.0488\n6.59\n<1e-10\n\n\n\nSex: Boys\n0.1928\n0.0143\n13.47\n<1e-40\n\n\n\nTest: Star-Run & a1\n0.0553\n0.1581\n0.35\n0.7267\n\n\n\nTest: S20-Star & a1\n0.0715\n0.1428\n0.50\n0.6168\n\n\n\nTest: SLJ-S20 & a1\n-0.0018\n0.1382\n-0.01\n0.9898\n\n\n\nTest: BPT-SLJ & a1\n0.4002\n0.1438\n2.78\n0.0054\n\n\n\nTest: Star-Run & Sex: Boys\n-0.1318\n0.0456\n-2.89\n0.0039\n\n\n\nTest: S20-Star & Sex: Boys\n0.0686\n0.0423\n1.62\n0.1044\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0285\n0.0410\n0.70\n0.4862\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1152\n0.0418\n2.75\n0.0059\n\n\n\na1 & Sex: Boys\n0.0036\n0.0488\n0.07\n0.9416\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.0312\n0.1581\n0.20\n0.8436\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.1196\n0.1428\n-0.84\n0.4024\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n-0.0478\n0.1382\n-0.35\n0.7296\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.2669\n0.1438\n1.86\n0.0634\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nm_zcp_SeqD_2 = let\n  form = @formula(\n    zScore ~ 1 + Test * a1 * Sex + (0 + Test | Child)\n  )\n  fit(MixedModel, form, dat; contrasts=contr1b)\nend\n\nMinimizing 2245      Time: 0:00:05 ( 2.34 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0209\n0.0141\n-1.49\n0.1371\n\n\n\nTest: Star-Run\n-0.0116\n0.0440\n-0.26\n0.7924\n\n\n\nTest: S20-Star\n-0.0044\n0.0447\n-0.10\n0.9213\n\n\n\nTest: SLJ-S20\n0.0043\n0.0448\n0.10\n0.9232\n\n\n\nTest: BPT-SLJ\n-0.0284\n0.0424\n-0.67\n0.5038\n\n\n\na1\n0.3184\n0.0480\n6.64\n<1e-10\n\n\n\nSex: Boys\n0.1946\n0.0141\n13.82\n<1e-42\n\n\n\nTest: Star-Run & a1\n0.0531\n0.1516\n0.35\n0.7262\n\n\n\nTest: S20-Star & a1\n0.0838\n0.1504\n0.56\n0.5774\n\n\n\nTest: SLJ-S20 & a1\n-0.0050\n0.1504\n-0.03\n0.9735\n\n\n\nTest: BPT-SLJ & a1\n0.3859\n0.1456\n2.65\n0.0081\n\n\n\nTest: Star-Run & Sex: Boys\n-0.1392\n0.0440\n-3.16\n0.0016\n\n\n\nTest: S20-Star & Sex: Boys\n0.0669\n0.0447\n1.50\n0.1344\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0384\n0.0448\n0.86\n0.3915\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1209\n0.0424\n2.85\n0.0044\n\n\n\na1 & Sex: Boys\n-0.0012\n0.0480\n-0.02\n0.9808\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.1022\n0.1516\n0.67\n0.5005\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.1644\n0.1504\n-1.09\n0.2743\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n-0.0079\n0.1504\n-0.05\n0.9581\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.1734\n0.1456\n1.19\n0.2339\n\n\n\nTest: BPT\n\n\n\n\n0.9278\n\n\nTest: SLJ\n\n\n\n\n0.9719\n\n\nTest: Star_r\n\n\n\n\n0.9718\n\n\nTest: Run\n\n\n\n\n0.9706\n\n\nTest: S20_r\n\n\n\n\n1.0025\n\n\nResidual\n0.0001\n\n\n\n\n\n\n\n\n\n\nm_cpx_0_SeqDiff = let\n  f_cpx_0 = @formula(\n    zScore ~ 1 + Test * a1 * Sex + (0 + Test | Child)\n  )\n  fit(MixedModel, f_cpx_0, dat; contrasts=contr1b)\nend\n\nMinimizing 2245      Time: 0:00:05 ( 2.33 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0209\n0.0141\n-1.49\n0.1371\n\n\n\nTest: Star-Run\n-0.0116\n0.0440\n-0.26\n0.7924\n\n\n\nTest: S20-Star\n-0.0044\n0.0447\n-0.10\n0.9213\n\n\n\nTest: SLJ-S20\n0.0043\n0.0448\n0.10\n0.9232\n\n\n\nTest: BPT-SLJ\n-0.0284\n0.0424\n-0.67\n0.5038\n\n\n\na1\n0.3184\n0.0480\n6.64\n<1e-10\n\n\n\nSex: Boys\n0.1946\n0.0141\n13.82\n<1e-42\n\n\n\nTest: Star-Run & a1\n0.0531\n0.1516\n0.35\n0.7262\n\n\n\nTest: S20-Star & a1\n0.0838\n0.1504\n0.56\n0.5774\n\n\n\nTest: SLJ-S20 & a1\n-0.0050\n0.1504\n-0.03\n0.9735\n\n\n\nTest: BPT-SLJ & a1\n0.3859\n0.1456\n2.65\n0.0081\n\n\n\nTest: Star-Run & Sex: Boys\n-0.1392\n0.0440\n-3.16\n0.0016\n\n\n\nTest: S20-Star & Sex: Boys\n0.0669\n0.0447\n1.50\n0.1344\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0384\n0.0448\n0.86\n0.3915\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1209\n0.0424\n2.85\n0.0044\n\n\n\na1 & Sex: Boys\n-0.0012\n0.0480\n-0.02\n0.9808\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.1022\n0.1516\n0.67\n0.5005\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.1644\n0.1504\n-1.09\n0.2743\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n-0.0079\n0.1504\n-0.05\n0.9581\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.1734\n0.1456\n1.19\n0.2339\n\n\n\nTest: BPT\n\n\n\n\n0.9278\n\n\nTest: SLJ\n\n\n\n\n0.9719\n\n\nTest: Star_r\n\n\n\n\n0.9718\n\n\nTest: Run\n\n\n\n\n0.9706\n\n\nTest: S20_r\n\n\n\n\n1.0025\n\n\nResidual\n0.0001\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_cpx_0_SeqDiff)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\nTest: Run\n0.942026\n0.970580\n\n\n\n\n\n\n\nTest: Star_r\n0.944318\n0.971760\n+0.11\n\n\n\n\n\n\nTest: S20_r\n1.004991\n1.002492\n+0.14\n+0.44\n\n\n\n\n\nTest: SLJ\n0.944651\n0.971932\n+0.46\n+0.72\n-0.01\n\n\n\n\nTest: BPT\n0.860748\n0.927765\n+0.02\n+0.55\n-0.42\n+0.83\n\n\nResidual\n\n0.000000\n0.000078\n\n\n\n\n\n\n\n\n\n\nm_cpx_0_SeqDiff.PCA\n\n(Child = \nPrincipal components based on correlation matrix\n Test: Run      1.0     .      .      .      .\n Test: Star_r   0.11   1.0     .      .      .\n Test: S20_r    0.14   0.44   1.0     .      .\n Test: SLJ      0.46   0.72  -0.01   1.0     .\n Test: BPT      0.02   0.55  -0.42   0.83   1.0\n\nNormalized cumulative variances:\n[0.4984, 0.7863, 0.9823, 0.9989, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5\n Test: Run     -0.24   0.28   0.87   0.21   0.25\n Test: Star_r  -0.52   0.31  -0.4    0.69  -0.05\n Test: S20_r   -0.02   0.8   -0.23  -0.48   0.26\n Test: SLJ     -0.62  -0.03   0.13  -0.43  -0.64\n Test: BPT     -0.54  -0.42  -0.15  -0.25   0.67,)\n\n\n\nf_cpx_1 = @formula(\n  zScore ~ 1 + Test * a1 * Sex + (1 + Test | Child)\n)\nm_cpx_1_SeqDiff =\nfit(MixedModel, f_cpx_1, dat; contrasts=contr1b)\n\nMinimizing 2054      Time: 0:00:05 ( 2.47 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0208\n0.0141\n-1.47\n0.1403\n0.7385\n\n\nTest: Star-Run\n-0.0262\n0.0441\n-0.59\n0.5527\n0.7831\n\n\nTest: S20-Star\n0.0088\n0.0442\n0.20\n0.8422\n0.7505\n\n\nTest: SLJ-S20\n-0.0022\n0.0440\n-0.05\n0.9609\n0.9735\n\n\nTest: BPT-SLJ\n-0.0263\n0.0426\n-0.62\n0.5378\n0.5905\n\n\na1\n0.3204\n0.0481\n6.66\n<1e-10\n\n\n\nSex: Boys\n0.1941\n0.0141\n13.73\n<1e-42\n\n\n\nTest: Star-Run & a1\n0.0583\n0.1524\n0.38\n0.7019\n\n\n\nTest: S20-Star & a1\n0.0679\n0.1491\n0.46\n0.6487\n\n\n\nTest: SLJ-S20 & a1\n0.0086\n0.1482\n0.06\n0.9540\n\n\n\nTest: BPT-SLJ & a1\n0.3959\n0.1464\n2.70\n0.0068\n\n\n\nTest: Star-Run & Sex: Boys\n-0.1386\n0.0441\n-3.15\n0.0017\n\n\n\nTest: S20-Star & Sex: Boys\n0.0710\n0.0442\n1.61\n0.1079\n\n\n\nTest: SLJ-S20 & Sex: Boys\n0.0323\n0.0440\n0.73\n0.4636\n\n\n\nTest: BPT-SLJ & Sex: Boys\n0.1220\n0.0426\n2.86\n0.0042\n\n\n\na1 & Sex: Boys\n0.0013\n0.0481\n0.03\n0.9787\n\n\n\nTest: Star-Run & a1 & Sex: Boys\n0.0652\n0.1524\n0.43\n0.6685\n\n\n\nTest: S20-Star & a1 & Sex: Boys\n-0.1286\n0.1491\n-0.86\n0.3886\n\n\n\nTest: SLJ-S20 & a1 & Sex: Boys\n-0.0243\n0.1482\n-0.16\n0.8697\n\n\n\nTest: BPT-SLJ & a1 & Sex: Boys\n0.2004\n0.1464\n1.37\n0.1709\n\n\n\nResidual\n0.0004\n\n\n\n\n\n\n\n\n\n\nm_cpx_1_SeqDiff.PCA\n\n(Child = \nPrincipal components based on correlation matrix\n (Intercept)      1.0     .      .      .      .\n Test: Star-Run   0.49   1.0     .      .      .\n Test: S20-Star  -0.27   0.65   1.0     .      .\n Test: SLJ-S20    0.17  -0.6   -0.62   1.0     .\n Test: BPT-SLJ   -0.37   0.36   0.71  -0.43   1.0\n\nNormalized cumulative variances:\n[0.5431, 0.8399, 0.9476, 0.9966, 1.0]\n\nComponent loadings\n                   PC1    PC2   PC3    PC4    PC5\n (Intercept)     -0.11  -0.79  0.22   0.22   0.52\n Test: Star-Run   0.45  -0.54  0.06  -0.13  -0.7\n Test: S20-Star   0.56   0.07  0.17  -0.67   0.45\n Test: SLJ-S20   -0.49   0.04  0.76  -0.36  -0.22\n Test: BPT-SLJ    0.48   0.28  0.58   0.6    0.03,)"
       },
       {
         "objectID": "contrasts_fggk21.html#pca-based-hypothesiscoding-contr4",
         "href": "contrasts_fggk21.html#pca-based-hypothesiscoding-contr4",
         "title": "Mixed Models Tutorial: Contrast Coding",
         "section": "2.4 PCA-based HypothesisCoding: contr4",
    -    "text": "2.4 PCA-based HypothesisCoding: contr4\nThe fourth set of contrasts uses HypothesisCoding to specify the set of contrasts implementing the loadings of the four principle components of the published LMM based on test scores, not test effects (contrasts) - coarse-grained, that is roughly according to their signs. This is actually a very interesting and plausible solution nobody had proposed a priori.\n\nPC1: BPT - Run_r\nPC2: (Star_r + S20_r + SLJ) - (BPT + Run_r)\nPC3: Star_r - (S20_r + SLJ)\nPC4: S20_r - SLJ\n\nPC1 contrasts the worst and the best indicator of physical health; PC2 contrasts these two against the core indicators of physical fitness; PC3 contrasts the cognitive and the physical tests within the narrow set of physical fitness components; and PC4, finally, contrasts two types of lower muscular fitness differing in speed and power.\n\ncontr4 = Dict(\n  :School => Grouping(),\n  :Child => Grouping(),\n  :Cohort => Grouping(),\n  :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n  :Test => HypothesisCoding(\n    [\n      -1 0 0 0 +1\n      -3 +2 +2 +2 -3\n      0 +2 -1 -1 0\n      0 0 +1 -1 0\n    ];\n    levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n    labels=[\"c5.1\", \"c234.15\", \"c2.34\", \"c3.4\"],\n  ),\n);\n\n\nm_cpx_1_PC = fit(MixedModel, f_cpx_1, dat; contrasts=contr4)\n\nMinimizing 1681      Time: 0:00:09 ( 5.78 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0140\n0.0141\n-0.99\n0.3217\n0.7540\n\n\nTest: c5.1\n-0.0231\n0.0432\n-0.53\n0.5931\n1.3977\n\n\nTest: c234.15\n0.0251\n0.1680\n0.15\n0.8811\n1.3502\n\n\nTest: c2.34\n-0.0316\n0.0764\n-0.41\n0.6798\n1.1365\n\n\nTest: c3.4\n-0.0048\n0.0440\n-0.11\n0.9124\n1.0727\n\n\na1\n0.2374\n0.0480\n4.95\n<1e-06\n\n\n\nSex: Boys\n0.2300\n0.0141\n16.32\n<1e-59\n\n\n\nTest: c5.1 & a1\n0.2815\n0.1458\n1.93\n0.0536\n\n\n\nTest: c234.15 & a1\n-0.1049\n0.5709\n-0.18\n0.8543\n\n\n\nTest: c2.34 & a1\n0.0733\n0.2610\n0.28\n0.7788\n\n\n\nTest: c3.4 & a1\n0.1284\n0.1499\n0.86\n0.3915\n\n\n\nTest: c5.1 & Sex: Boys\n0.1237\n0.0432\n2.87\n0.0042\n\n\n\nTest: c234.15 & Sex: Boys\n-0.6244\n0.1680\n-3.72\n0.0002\n\n\n\nTest: c2.34 & Sex: Boys\n-0.1842\n0.0764\n-2.41\n0.0159\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0331\n0.0440\n-0.75\n0.4525\n\n\n\na1 & Sex: Boys\n-0.0546\n0.0480\n-1.14\n0.2554\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n0.0979\n0.1458\n0.67\n0.5018\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n-0.4897\n0.5709\n-0.86\n0.3910\n\n\n\nTest: c2.34 & a1 & Sex: Boys\n0.5315\n0.2610\n2.04\n0.0417\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n-0.0054\n0.1499\n-0.04\n0.9714\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_cpx_1_PC)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.56856388\n0.75403175\n\n\n\n\n\n\n\nTest: c5.1\n1.95351062\n1.39768044\n-0.03\n\n\n\n\n\n\nTest: c234.15\n1.82313476\n1.35023508\n+0.88\n+0.03\n\n\n\n\n\nTest: c2.34\n1.29169133\n1.13652599\n+0.18\n-0.25\n+0.54\n\n\n\n\nTest: c3.4\n1.15071042\n1.07271171\n-0.01\n-0.06\n+0.24\n+0.07\n\n\nResidual\n\n0.00000000\n0.00000607\n\n\n\n\n\n\n\n\n\n\nm_cpx_1_PC.PCA\n\n(Child = \nPrincipal components based on correlation matrix\n (Intercept)     1.0     .      .      .      .\n Test: c5.1     -0.03   1.0     .      .      .\n Test: c234.15   0.88   0.03   1.0     .      .\n Test: c2.34     0.18  -0.25   0.54   1.0     .\n Test: c3.4     -0.01  -0.06   0.24   0.07   1.0\n\nNormalized cumulative variances:\n[0.4324, 0.6616, 0.859, 1.0, 1.0]\n\nComponent loadings\n                  PC1    PC2    PC3    PC4    PC5\n (Intercept)    -0.57  -0.33  -0.16  -0.44   0.59\n Test: c5.1      0.1   -0.79   0.25   0.54   0.12\n Test: c234.15  -0.67  -0.17   0.06   0.02  -0.72\n Test: c2.34    -0.43   0.43  -0.18   0.71   0.3\n Test: c3.4     -0.17   0.25   0.94  -0.08   0.17,)\n\n\nThere is a numerical interaction with a z-value > 2.0 for the first PCA (i.e., BPT - Run_r). This interaction would really need to be replicated to be taken seriously. It is probably due to larger “unfitness” gains in boys than girls (i.e., in BPT) relative to the slightly larger health-related “fitness” gains of girls than boys (i.e., in Run_r).\n\ncontr4b = merge(\n  Dict(nm => Grouping() for nm in (:School, :Child, :Cohort)),\n  Dict(\n    :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n    :Test => HypothesisCoding(\n      [\n        0.49 -0.04 0.20 0.03 -0.85\n        0.70 -0.56 -0.21 -0.13 0.37\n        0.31 0.68 -0.56 -0.35 0.00\n        0.04 0.08 0.61 -0.78 0.13\n      ];\n      levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n      labels=[\"c5.1\", \"c234.15\", \"c12.34\", \"c3.4\"],\n    ),\n  ),\n);\n\n\nm_cpx_1_PC_2 = fit(MixedModel, f_cpx_1, dat; contrasts=contr4b)\n\nMinimizing 1651      Time: 0:00:09 ( 5.82 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0137\n0.0142\n-0.96\n0.3353\n0.7072\n\n\nTest: c5.1\n0.0176\n0.0300\n0.58\n0.5589\n0.4204\n\n\nTest: c234.15\n0.0028\n0.0312\n0.09\n0.9294\n0.6347\n\n\nTest: c12.34\n-0.0062\n0.0313\n-0.20\n0.8434\n0.9747\n\n\nTest: c3.4\n-0.0083\n0.0312\n-0.27\n0.7904\n0.7563\n\n\na1\n0.2325\n0.0484\n4.81\n<1e-05\n\n\n\nSex: Boys\n0.2237\n0.0142\n15.75\n<1e-55\n\n\n\nTest: c5.1 & a1\n-0.1865\n0.1012\n-1.84\n0.0654\n\n\n\nTest: c234.15 & a1\n-0.0594\n0.1064\n-0.56\n0.5768\n\n\n\nTest: c12.34 & a1\n-0.0348\n0.1072\n-0.32\n0.7456\n\n\n\nTest: c3.4 & a1\n0.1104\n0.1058\n1.04\n0.2965\n\n\n\nTest: c5.1 & Sex: Boys\n-0.1089\n0.0300\n-3.62\n0.0003\n\n\n\nTest: c234.15 & Sex: Boys\n0.1016\n0.0312\n3.26\n0.0011\n\n\n\nTest: c12.34 & Sex: Boys\n-0.0564\n0.0313\n-1.81\n0.0710\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0156\n0.0312\n-0.50\n0.6180\n\n\n\na1 & Sex: Boys\n-0.0669\n0.0484\n-1.38\n0.1669\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n-0.1300\n0.1012\n-1.28\n0.1989\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n0.0097\n0.1064\n0.09\n0.9273\n\n\n\nTest: c12.34 & a1 & Sex: Boys\n0.2129\n0.1072\n1.99\n0.0470\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n0.0417\n0.1058\n0.39\n0.6932\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_cpx_1_PC_2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.50011155\n0.70718565\n\n\n\n\n\n\n\nTest: c5.1\n0.17675544\n0.42042293\n-0.61\n\n\n\n\n\n\nTest: c234.15\n0.40282840\n0.63468764\n-0.05\n+0.60\n\n\n\n\n\nTest: c12.34\n0.95009974\n0.97473060\n+0.04\n+0.72\n+0.48\n\n\n\n\nTest: c3.4\n0.57197002\n0.75628700\n+0.01\n-0.14\n-0.76\n+0.14\n\n\nResidual\n\n0.00000000\n0.00002314\n\n\n\n\n\n\n\n\n\n\nm_cpx_1_PC_2.PCA\n\n(Child = \nPrincipal components based on correlation matrix\n (Intercept)     1.0     .      .      .      .\n Test: c5.1     -0.61   1.0     .      .      .\n Test: c234.15  -0.05   0.6    1.0     .      .\n Test: c12.34    0.04   0.72   0.48   1.0     .\n Test: c3.4      0.01  -0.14  -0.76   0.14   1.0\n\nNormalized cumulative variances:\n[0.4912, 0.7732, 0.992, 0.9997, 1.0]\n\nComponent loadings\n                  PC1    PC2    PC3    PC4    PC5\n (Intercept)    -0.26  -0.39   0.76   0.04   0.46\n Test: c5.1      0.59   0.33  -0.08   0.12   0.73\n Test: c234.15   0.55  -0.39   0.11  -0.71  -0.14\n Test: c12.34    0.44   0.32   0.59   0.35  -0.49\n Test: c3.4     -0.31   0.7    0.24  -0.59   0.06,)\n\n\n\nf_zcp_1 = @formula(zScore ~ 1 + Test*a1*Sex + zerocorr(1 + Test | Child))\nm_zcp_1_PC_2 = fit(MixedModel, f_zcp_1, dat; contrasts=contr4b)\n\nMinimizing 483   Time: 0:00:01 ( 3.93 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0140\n0.0143\n-0.98\n0.3284\n0.7941\n\n\nTest: c5.1\n0.0176\n0.0307\n0.57\n0.5669\n0.6404\n\n\nTest: c234.15\n0.0051\n0.0307\n0.17\n0.8680\n0.2384\n\n\nTest: c12.34\n-0.0082\n0.0317\n-0.26\n0.7960\n0.9077\n\n\nTest: c3.4\n-0.0126\n0.0308\n-0.41\n0.6825\n0.5112\n\n\na1\n0.2305\n0.0486\n4.74\n<1e-05\n\n\n\nSex: Boys\n0.2232\n0.0143\n15.64\n<1e-54\n\n\n\nTest: c5.1 & a1\n-0.1998\n0.1033\n-1.93\n0.0531\n\n\n\nTest: c234.15 & a1\n-0.0490\n0.1048\n-0.47\n0.6401\n\n\n\nTest: c12.34 & a1\n-0.0244\n0.1091\n-0.22\n0.8233\n\n\n\nTest: c3.4 & a1\n0.1181\n0.1043\n1.13\n0.2576\n\n\n\nTest: c5.1 & Sex: Boys\n-0.1097\n0.0307\n-3.58\n0.0003\n\n\n\nTest: c234.15 & Sex: Boys\n0.1138\n0.0307\n3.71\n0.0002\n\n\n\nTest: c12.34 & Sex: Boys\n-0.0535\n0.0317\n-1.69\n0.0914\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0167\n0.0308\n-0.54\n0.5879\n\n\n\na1 & Sex: Boys\n-0.0631\n0.0486\n-1.30\n0.1947\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n-0.1217\n0.1033\n-1.18\n0.2386\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n0.0039\n0.1048\n0.04\n0.9703\n\n\n\nTest: c12.34 & a1 & Sex: Boys\n0.1955\n0.1091\n1.79\n0.0731\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n0.0397\n0.1043\n0.38\n0.7032\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_zcp_1_PC_2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.63053296\n0.79406106\n\n\n\n\n\n\n\nTest: c5.1\n0.41015466\n0.64043318\n.\n\n\n\n\n\n\nTest: c234.15\n0.05685035\n0.23843312\n.\n.\n\n\n\n\n\nTest: c12.34\n0.82395429\n0.90771928\n.\n.\n.\n\n\n\n\nTest: c3.4\n0.26132429\n0.51119888\n.\n.\n.\n.\n\n\nResidual\n\n0.00000000\n0.00000166\n\n\n\n\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_zcp_1_PC_2, m_cpx_1_PC_2)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13232\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13330\n-98\n10\nNaN"
    +    "text": "2.4 PCA-based HypothesisCoding: contr4\nThe fourth set of contrasts uses HypothesisCoding to specify the set of contrasts implementing the loadings of the four principle components of the published LMM based on test scores, not test effects (contrasts) - coarse-grained, that is roughly according to their signs. This is actually a very interesting and plausible solution nobody had proposed a priori.\n\nPC1: BPT - Run_r\nPC2: (Star_r + S20_r + SLJ) - (BPT + Run_r)\nPC3: Star_r - (S20_r + SLJ)\nPC4: S20_r - SLJ\n\nPC1 contrasts the worst and the best indicator of physical health; PC2 contrasts these two against the core indicators of physical fitness; PC3 contrasts the cognitive and the physical tests within the narrow set of physical fitness components; and PC4, finally, contrasts two types of lower muscular fitness differing in speed and power.\n\ncontr4 = Dict(\n  :School => Grouping(),\n  :Child => Grouping(),\n  :Cohort => Grouping(),\n  :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n  :Test => HypothesisCoding(\n    [\n      -1 0 0 0 +1\n      -3 +2 +2 +2 -3\n      0 +2 -1 -1 0\n      0 0 +1 -1 0\n    ];\n    levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n    labels=[\"c5.1\", \"c234.15\", \"c2.34\", \"c3.4\"],\n  ),\n);\n\n\nm_cpx_1_PC = fit(MixedModel, f_cpx_1, dat; contrasts=contr4)\n\nMinimizing 1916      Time: 0:00:04 ( 2.46 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0206\n0.0141\n-1.46\n0.1446\n0.7027\n\n\nTest: c5.1\n-0.0400\n0.0434\n-0.92\n0.3573\n1.4474\n\n\nTest: c234.15\n0.0504\n0.1688\n0.30\n0.7654\n0.8754\n\n\nTest: c2.34\n-0.0164\n0.0774\n-0.21\n0.8326\n1.5834\n\n\nTest: c3.4\n0.0031\n0.0442\n0.07\n0.9449\n1.2183\n\n\na1\n0.3189\n0.0481\n6.63\n<1e-10\n\n\n\nSex: Boys\n0.1935\n0.0141\n13.70\n<1e-42\n\n\n\nTest: c5.1 & a1\n0.5323\n0.1495\n3.56\n0.0004\n\n\n\nTest: c234.15 & a1\n-0.9229\n0.5784\n-1.60\n0.1106\n\n\n\nTest: c2.34 & a1\n-0.1633\n0.2649\n-0.62\n0.5375\n\n\n\nTest: c3.4 & a1\n0.0173\n0.1485\n0.12\n0.9074\n\n\n\nTest: c5.1 & Sex: Boys\n0.0904\n0.0434\n2.08\n0.0374\n\n\n\nTest: c234.15 & Sex: Boys\n-0.7858\n0.1688\n-4.65\n<1e-05\n\n\n\nTest: c2.34 & Sex: Boys\n-0.1657\n0.0774\n-2.14\n0.0323\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0336\n0.0442\n-0.76\n0.4471\n\n\n\na1 & Sex: Boys\n0.0029\n0.0481\n0.06\n0.9524\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n0.0936\n0.1495\n0.63\n0.5311\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n-0.4144\n0.5784\n-0.72\n0.4737\n\n\n\nTest: c2.34 & a1 & Sex: Boys\n0.3054\n0.2649\n1.15\n0.2490\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n-0.0072\n0.1485\n-0.05\n0.9614\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_cpx_1_PC)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.49382403\n0.70272614\n\n\n\n\n\n\n\nTest: c5.1\n2.09506421\n1.44743366\n-0.04\n\n\n\n\n\n\nTest: c234.15\n0.76635120\n0.87541487\n+0.93\n+0.20\n\n\n\n\n\nTest: c2.34\n2.50700186\n1.58335147\n+0.16\n+0.11\n+0.36\n\n\n\n\nTest: c3.4\n1.48425184\n1.21829875\n-0.03\n-0.03\n+0.07\n-0.25\n\n\nResidual\n\n0.00000000\n0.00003566\n\n\n\n\n\n\n\n\n\n\nm_cpx_1_PC.PCA\n\n(Child = \nPrincipal components based on correlation matrix\n (Intercept)     1.0     .      .      .      .\n Test: c5.1     -0.04   1.0     .      .      .\n Test: c234.15   0.93   0.2    1.0     .      .\n Test: c2.34     0.16   0.11   0.36   1.0     .\n Test: c3.4     -0.03  -0.03   0.07  -0.25   1.0\n\nNormalized cumulative variances:\n[0.4162, 0.6571, 0.8573, 0.9971, 1.0]\n\nComponent loadings\n                  PC1    PC2    PC3    PC4    PC5\n (Intercept)    -0.63   0.26  -0.2    0.27  -0.65\n Test: c5.1     -0.14  -0.28   0.91   0.22  -0.16\n Test: c234.15  -0.68   0.17   0.06   0.03   0.71\n Test: c2.34    -0.35  -0.54  -0.07  -0.74  -0.17\n Test: c3.4      0.06   0.73   0.36  -0.57  -0.12,)\n\n\nThere is a numerical interaction with a z-value > 2.0 for the first PCA (i.e., BPT - Run_r). This interaction would really need to be replicated to be taken seriously. It is probably due to larger “unfitness” gains in boys than girls (i.e., in BPT) relative to the slightly larger health-related “fitness” gains of girls than boys (i.e., in Run_r).\n\ncontr4b = merge(\n  Dict(nm => Grouping() for nm in (:School, :Child, :Cohort)),\n  Dict(\n    :Sex => EffectsCoding(; levels=[\"Girls\", \"Boys\"]),\n    :Test => HypothesisCoding(\n      [\n        0.49 -0.04 0.20 0.03 -0.85\n        0.70 -0.56 -0.21 -0.13 0.37\n        0.31 0.68 -0.56 -0.35 0.00\n        0.04 0.08 0.61 -0.78 0.13\n      ];\n      levels=[\"Run\", \"Star_r\", \"S20_r\", \"SLJ\", \"BPT\"],\n      labels=[\"c5.1\", \"c234.15\", \"c12.34\", \"c3.4\"],\n    ),\n  ),\n);\n\n\nm_cpx_1_PC_2 = fit(MixedModel, f_cpx_1, dat; contrasts=contr4b)\n\nMinimizing 1148      Time: 0:00:02 ( 2.46 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0194\n0.0143\n-1.36\n0.1744\n0.7705\n\n\nTest: c5.1\n0.0328\n0.0303\n1.08\n0.2795\n0.5652\n\n\nTest: c234.15\n0.0003\n0.0313\n0.01\n0.9934\n0.8700\n\n\nTest: c12.34\n0.0016\n0.0311\n0.05\n0.9581\n0.5517\n\n\nTest: c3.4\n-0.0009\n0.0312\n-0.03\n0.9760\n0.6532\n\n\na1\n0.3054\n0.0487\n6.27\n<1e-09\n\n\n\nSex: Boys\n0.1866\n0.0143\n13.03\n<1e-38\n\n\n\nTest: c5.1 & a1\n-0.3933\n0.1042\n-3.77\n0.0002\n\n\n\nTest: c234.15 & a1\n0.1080\n0.1077\n1.00\n0.3160\n\n\n\nTest: c12.34 & a1\n-0.0761\n0.1055\n-0.72\n0.4708\n\n\n\nTest: c3.4 & a1\n0.0332\n0.1058\n0.31\n0.7538\n\n\n\nTest: c5.1 & Sex: Boys\n-0.0908\n0.0303\n-2.99\n0.0028\n\n\n\nTest: c234.15 & Sex: Boys\n0.1349\n0.0313\n4.31\n<1e-04\n\n\n\nTest: c12.34 & Sex: Boys\n-0.0384\n0.0311\n-1.24\n0.2159\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0065\n0.0312\n-0.21\n0.8355\n\n\n\na1 & Sex: Boys\n-0.0062\n0.0487\n-0.13\n0.8994\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n-0.1310\n0.1042\n-1.26\n0.2087\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n0.0208\n0.1077\n0.19\n0.8471\n\n\n\nTest: c12.34 & a1 & Sex: Boys\n0.1106\n0.1055\n1.05\n0.2942\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n0.0345\n0.1058\n0.33\n0.7445\n\n\n\nResidual\n0.0003\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_cpx_1_PC_2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.593654829\n0.770489993\n\n\n\n\n\n\n\nTest: c5.1\n0.319452379\n0.565201184\n+0.05\n\n\n\n\n\n\nTest: c234.15\n0.756926221\n0.870015069\n-0.19\n-0.05\n\n\n\n\n\nTest: c12.34\n0.304380620\n0.551707006\n-0.08\n+0.66\n+0.19\n\n\n\n\nTest: c3.4\n0.426679824\n0.653207336\n-0.10\n-0.84\n-0.25\n-0.41\n\n\nResidual\n\n0.000000083\n0.000287906\n\n\n\n\n\n\n\n\n\n\nm_cpx_1_PC_2.PCA\n\n(Child = \nPrincipal components based on correlation matrix\n (Intercept)     1.0     .      .      .      .\n Test: c5.1      0.05   1.0     .      .      .\n Test: c234.15  -0.19  -0.05   1.0     .      .\n Test: c12.34   -0.08   0.66   0.19   1.0     .\n Test: c3.4     -0.1   -0.84  -0.25  -0.41   1.0\n\nNormalized cumulative variances:\n[0.4645, 0.7088, 0.8788, 0.9906, 1.0]\n\nComponent loadings\n                  PC1    PC2    PC3    PC4    PC5\n (Intercept)    -0.01   0.7   -0.64  -0.32   0.04\n Test: c5.1     -0.62   0.2    0.2    0.16   0.72\n Test: c234.15  -0.16  -0.67  -0.67  -0.09   0.25\n Test: c12.34   -0.51  -0.13   0.23  -0.76  -0.3\n Test: c3.4      0.58  -0.07   0.22  -0.53   0.57,)\n\n\n\nf_zcp_1 = @formula(zScore ~ 1 + Test*a1*Sex + zerocorr(1 + Test | Child))\nm_zcp_1_PC_2 = fit(MixedModel, f_zcp_1, dat; contrasts=contr4b)\n\nMinimizing 485   Time: 0:00:00 ( 1.51 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0195\n0.0143\n-1.36\n0.1737\n0.7483\n\n\nTest: c5.1\n0.0298\n0.0302\n0.99\n0.3240\n0.5858\n\n\nTest: c234.15\n0.0016\n0.0310\n0.05\n0.9584\n0.6231\n\n\nTest: c12.34\n-0.0019\n0.0318\n-0.06\n0.9513\n0.8468\n\n\nTest: c3.4\n-0.0016\n0.0314\n-0.05\n0.9598\n0.6906\n\n\na1\n0.3040\n0.0487\n6.25\n<1e-09\n\n\n\nSex: Boys\n0.1856\n0.0143\n12.96\n<1e-37\n\n\n\nTest: c5.1 & a1\n-0.3721\n0.1036\n-3.59\n0.0003\n\n\n\nTest: c234.15 & a1\n0.1017\n0.1071\n0.95\n0.3421\n\n\n\nTest: c12.34 & a1\n-0.0923\n0.1082\n-0.85\n0.3933\n\n\n\nTest: c3.4 & a1\n0.0487\n0.1066\n0.46\n0.6477\n\n\n\nTest: c5.1 & Sex: Boys\n-0.0921\n0.0302\n-3.05\n0.0023\n\n\n\nTest: c234.15 & Sex: Boys\n0.1349\n0.0310\n4.35\n<1e-04\n\n\n\nTest: c12.34 & Sex: Boys\n-0.0367\n0.0318\n-1.15\n0.2493\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0064\n0.0314\n-0.20\n0.8386\n\n\n\na1 & Sex: Boys\n-0.0051\n0.0487\n-0.10\n0.9173\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n-0.1212\n0.1036\n-1.17\n0.2420\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n0.0138\n0.1071\n0.13\n0.8977\n\n\n\nTest: c12.34 & a1 & Sex: Boys\n0.1150\n0.1082\n1.06\n0.2876\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n0.0314\n0.1066\n0.29\n0.7687\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_zcp_1_PC_2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.55990707\n0.74826938\n\n\n\n\n\n\n\nTest: c5.1\n0.34321342\n0.58584420\n.\n\n\n\n\n\n\nTest: c234.15\n0.38822082\n0.62307369\n.\n.\n\n\n\n\n\nTest: c12.34\n0.71707090\n0.84680039\n.\n.\n.\n\n\n\n\nTest: c3.4\n0.47688065\n0.69056546\n.\n.\n.\n.\n\n\nResidual\n\n0.00000000\n0.00000346\n\n\n\n\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_zcp_1_PC_2, m_cpx_1_PC_2)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13331\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13502\n-171\n10\nNaN"
       },
       {
         "objectID": "contrasts_fggk21.html#contrasts-are-re-parameterizations-of-the-same-model",
         "href": "contrasts_fggk21.html#contrasts-are-re-parameterizations-of-the-same-model",
         "title": "Mixed Models Tutorial: Contrast Coding",
         "section": "3.1 Contrasts are re-parameterizations of the same model",
    -    "text": "3.1 Contrasts are re-parameterizations of the same model\nThe choice of contrast does not affect the model objective, in other words, they all yield the same goodness of fit. It does not matter whether a contrast is orthogonal or not.\n\n[\n  objective(m_ovi_SeqDiff),\n  objective(m_ovi_Helmert),\n  objective(m_ovi_Hypo),\n]\n\n3-element Vector{Float64}:\n 13805.524890108634\n 13805.524890108683\n 13805.524890108614"
    +    "text": "3.1 Contrasts are re-parameterizations of the same model\nThe choice of contrast does not affect the model objective, in other words, they all yield the same goodness of fit. It does not matter whether a contrast is orthogonal or not.\n\n[\n  objective(m_ovi_SeqDiff),\n  objective(m_ovi_Helmert),\n  objective(m_ovi_Hypo),\n]\n\n3-element Vector{Float64}:\n 13851.100119301136\n 13851.100119301156\n 13851.100119301174"
       },
       {
         "objectID": "contrasts_fggk21.html#vcs-and-cps-depend-on-contrast-coding",
         "href": "contrasts_fggk21.html#vcs-and-cps-depend-on-contrast-coding",
         "title": "Mixed Models Tutorial: Contrast Coding",
         "section": "3.2 VCs and CPs depend on contrast coding",
    -    "text": "3.2 VCs and CPs depend on contrast coding\nTrivially, the meaning of a contrast depends on its definition. Consequently, the contrast specification has a big effect on the random-effect structure. As an illustration, we refit the LMMs with variance components (VCs) and correlation parameters (CPs) for Child-related contrasts of Test. Unfortunately, it is not easy, actually rather quite difficult, to grasp the meaning of correlations of contrast-based effects; they represent two-way interactions.\n\nbegin\n  f_Child = @formula zScore ~\n    1 + Test * a1 * Sex + (1 + Test | Child)\n  m_Child_SDC = fit(MixedModel, f_Child, dat; contrasts=contr1)\n  m_Child_HeC = fit(MixedModel, f_Child, dat; contrasts=contr2)\n  m_Child_HyC = fit(MixedModel, f_Child, dat; contrasts=contr3)\n  m_Child_PCA = fit(MixedModel, f_Child, dat; contrasts=contr4)\nend\n\nMinimizing 1681      Time: 0:00:09 ( 5.75 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0140\n0.0141\n-0.99\n0.3217\n0.7540\n\n\nTest: c5.1\n-0.0231\n0.0432\n-0.53\n0.5931\n1.3977\n\n\nTest: c234.15\n0.0251\n0.1680\n0.15\n0.8811\n1.3502\n\n\nTest: c2.34\n-0.0316\n0.0764\n-0.41\n0.6798\n1.1365\n\n\nTest: c3.4\n-0.0048\n0.0440\n-0.11\n0.9124\n1.0727\n\n\na1\n0.2374\n0.0480\n4.95\n<1e-06\n\n\n\nSex: Boys\n0.2300\n0.0141\n16.32\n<1e-59\n\n\n\nTest: c5.1 & a1\n0.2815\n0.1458\n1.93\n0.0536\n\n\n\nTest: c234.15 & a1\n-0.1049\n0.5709\n-0.18\n0.8543\n\n\n\nTest: c2.34 & a1\n0.0733\n0.2610\n0.28\n0.7788\n\n\n\nTest: c3.4 & a1\n0.1284\n0.1499\n0.86\n0.3915\n\n\n\nTest: c5.1 & Sex: Boys\n0.1237\n0.0432\n2.87\n0.0042\n\n\n\nTest: c234.15 & Sex: Boys\n-0.6244\n0.1680\n-3.72\n0.0002\n\n\n\nTest: c2.34 & Sex: Boys\n-0.1842\n0.0764\n-2.41\n0.0159\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0331\n0.0440\n-0.75\n0.4525\n\n\n\na1 & Sex: Boys\n-0.0546\n0.0480\n-1.14\n0.2554\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n0.0979\n0.1458\n0.67\n0.5018\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n-0.4897\n0.5709\n-0.86\n0.3910\n\n\n\nTest: c2.34 & a1 & Sex: Boys\n0.5315\n0.2610\n2.04\n0.0417\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n-0.0054\n0.1499\n-0.04\n0.9714\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_Child_SDC)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.56211796\n0.74974526\n\n\n\n\n\n\n\nTest: Star_r\n0.52251672\n0.72285318\n+0.29\n\n\n\n\n\n\nTest: S20_r\n0.69271093\n0.83229257\n-0.12\n+0.24\n\n\n\n\n\nTest: SLJ\n0.81392090\n0.90217565\n-0.07\n-0.55\n-0.05\n\n\n\n\nTest: BPT\n0.43000263\n0.65574586\n+0.22\n+0.34\n-0.80\n-0.36\n\n\nResidual\n\n0.00000000\n0.00002102\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_Child_HeC)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.43353075\n0.65843052\n\n\n\n\n\n\n\nTest: Star_r\n0.18629729\n0.43162169\n+0.28\n\n\n\n\n\n\nTest: S20_r\n0.15806152\n0.39756952\n+0.09\n+0.56\n\n\n\n\n\nTest: SLJ\n0.05583349\n0.23629112\n+0.02\n-0.44\n+0.48\n\n\n\n\nTest: BPT\n0.02466654\n0.15705584\n+0.03\n+0.30\n+0.44\n+0.14\n\n\nResidual\n\n0.00000000\n0.00004079\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_Child_HyC)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.55282557\n0.74352241\n\n\n\n\n\n\n\nTest: BPT-other\n0.67427276\n0.82114113\n+1.00\n\n\n\n\n\n\nTest: Star-End\n0.99071927\n0.99534882\n+0.30\n+0.31\n\n\n\n\n\nTest: S20-Star\n1.20348486\n1.09703458\n-0.15\n-0.13\n-0.03\n\n\n\n\nTest: SLJ-S20\n0.59215750\n0.76951771\n+0.17\n+0.16\n-0.13\n-0.51\n\n\nResidual\n\n0.00000000\n0.00002684\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_Child_PCA)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.56856388\n0.75403175\n\n\n\n\n\n\n\nTest: c5.1\n1.95351062\n1.39768044\n-0.03\n\n\n\n\n\n\nTest: c234.15\n1.82313476\n1.35023508\n+0.88\n+0.03\n\n\n\n\n\nTest: c2.34\n1.29169133\n1.13652599\n+0.18\n-0.25\n+0.54\n\n\n\n\nTest: c3.4\n1.15071042\n1.07271171\n-0.01\n-0.06\n+0.24\n+0.07\n\n\nResidual\n\n0.00000000\n0.00000607\n\n\n\n\n\n\n\n\n\nThe CPs for the various contrasts are in line with expectations. For the SDC we observe substantial negative CPs between neighboring contrasts. For the orthogonal HeC, all CPs are small; they are uncorrelated. HyC contains some of the SDC contrasts and we observe again the negative CPs. The (roughly) PCA-based contrasts are small with one exception; there is a sizeable CP of +.41 between GM and the core of adjusted physical fitness (c234.15).\nDo these differences in CPs imply that we can move to zcpLMMs when we have orthogonal contrasts? We pursue this question with by refitting the four LMMs with zerocorr() and compare the goodness of fit.\n\nbegin\n  f_Child0 = @formula zScore ~\n    1 + Test * a1 * Sex + zerocorr(1 + Test | Child)\n  m_Child_SDC0 = fit(MixedModel, f_Child0, dat; contrasts=contr1)\n  m_Child_HeC0 = fit(MixedModel, f_Child0, dat; contrasts=contr2)\n  m_Child_HyC0 = fit(MixedModel, f_Child0, dat; contrasts=contr3)\n  m_Child_PCA0 = fit(MixedModel, f_Child0, dat; contrasts=contr4)\nend\n\nMinimizing 473   Time: 0:00:01 ( 4.00 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0146\n0.0142\n-1.03\n0.3024\n0.8465\n\n\nTest: c5.1\n-0.0208\n0.0430\n-0.48\n0.6285\n0.8888\n\n\nTest: c234.15\n0.0492\n0.1661\n0.30\n0.7672\n0.9984\n\n\nTest: c2.34\n-0.0384\n0.0744\n-0.52\n0.6063\n1.2892\n\n\nTest: c3.4\n-0.0062\n0.0442\n-0.14\n0.8892\n0.9230\n\n\na1\n0.2381\n0.0482\n4.93\n<1e-06\n\n\n\nSex: Boys\n0.2297\n0.0142\n16.19\n<1e-58\n\n\n\nTest: c5.1 & a1\n0.2937\n0.1454\n2.02\n0.0434\n\n\n\nTest: c234.15 & a1\n-0.1040\n0.5646\n-0.18\n0.8538\n\n\n\nTest: c2.34 & a1\n0.0702\n0.2540\n0.28\n0.7823\n\n\n\nTest: c3.4 & a1\n0.1182\n0.1509\n0.78\n0.4334\n\n\n\nTest: c5.1 & Sex: Boys\n0.1182\n0.0430\n2.75\n0.0060\n\n\n\nTest: c234.15 & Sex: Boys\n-0.6206\n0.1661\n-3.74\n0.0002\n\n\n\nTest: c2.34 & Sex: Boys\n-0.1750\n0.0744\n-2.35\n0.0187\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0325\n0.0442\n-0.73\n0.4632\n\n\n\na1 & Sex: Boys\n-0.0548\n0.0482\n-1.13\n0.2564\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n0.1211\n0.1454\n0.83\n0.4049\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n-0.3976\n0.5646\n-0.70\n0.4812\n\n\n\nTest: c2.34 & a1 & Sex: Boys\n0.5051\n0.2540\n1.99\n0.0467\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n0.0003\n0.1509\n0.00\n0.9984\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_Child_SDC0, m_Child_SDC)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13295\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13325\n-30\n10\nNaN\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_Child_HeC0, m_Child_HeC)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13248\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13354\n-107\n10\nNaN\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_Child_HyC0, m_Child_HyC)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13333\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13336\n-4\n10\nNaN\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_Child_PCA0, m_Child_PCA)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13260\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13273\n-13\n10\nNaN\n\n\n\n\n\nObviously, we can not drop CPs from any of the LMMs. The full LMMs all have the same objective, but we can compare the goodness-of-fit statistics of zcpLMMs more directly.\n\nbegin\n  zcpLMM = [\"SDC0\", \"HeC0\", \"HyC0\", \"PCA0\"]\n  mods = [m_Child_SDC0, m_Child_HeC0, m_Child_HyC0, m_Child_PCA0]\n  gof_summary = sort!(\n    DataFrame(;\n      zcpLMM=zcpLMM,\n      dof=dof.(mods),\n      deviance=deviance.(mods),\n      AIC=aic.(mods),\n      BIC=bic.(mods),\n    ),\n    :deviance,\n  )\nend\n\n4×5 DataFrame\n\n\n\nRow\nzcpLMM\ndof\ndeviance\nAIC\nBIC\n\n\n\nString\nInt64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\nHeC0\n26\n13247.7\n13299.7\n13469.2\n\n\n2\nPCA0\n26\n13259.9\n13311.9\n13481.3\n\n\n3\nSDC0\n26\n13294.7\n13346.7\n13516.1\n\n\n4\nHyC0\n26\n13332.7\n13384.7\n13554.2\n\n\n\n\n\n\nThe best fit was obtained for the PCA-based zcpLMM. Somewhat surprisingly the second best fit was obtained for the SDC. The relatively poor performance of HeC-based zcpLMM is puzzling to me. I thought it might be related to imbalance in design in the present data, but this does not appear to be the case. The same comparison of SequentialDifferenceCoding and Helmert Coding also showed a worse fit for the zcp-HeC LMM than the zcp-SDC LMM."
    +    "text": "3.2 VCs and CPs depend on contrast coding\nTrivially, the meaning of a contrast depends on its definition. Consequently, the contrast specification has a big effect on the random-effect structure. As an illustration, we refit the LMMs with variance components (VCs) and correlation parameters (CPs) for Child-related contrasts of Test. Unfortunately, it is not easy, actually rather quite difficult, to grasp the meaning of correlations of contrast-based effects; they represent two-way interactions.\n\nbegin\n  f_Child = @formula zScore ~\n    1 + Test * a1 * Sex + (1 + Test | Child)\n  m_Child_SDC = fit(MixedModel, f_Child, dat; contrasts=contr1)\n  m_Child_HeC = fit(MixedModel, f_Child, dat; contrasts=contr2)\n  m_Child_HyC = fit(MixedModel, f_Child, dat; contrasts=contr3)\n  m_Child_PCA = fit(MixedModel, f_Child, dat; contrasts=contr4)\nend\n\nMinimizing 1916      Time: 0:00:04 ( 2.34 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0206\n0.0141\n-1.46\n0.1446\n0.7027\n\n\nTest: c5.1\n-0.0400\n0.0434\n-0.92\n0.3573\n1.4474\n\n\nTest: c234.15\n0.0504\n0.1688\n0.30\n0.7654\n0.8754\n\n\nTest: c2.34\n-0.0164\n0.0774\n-0.21\n0.8326\n1.5834\n\n\nTest: c3.4\n0.0031\n0.0442\n0.07\n0.9449\n1.2183\n\n\na1\n0.3189\n0.0481\n6.63\n<1e-10\n\n\n\nSex: Boys\n0.1935\n0.0141\n13.70\n<1e-42\n\n\n\nTest: c5.1 & a1\n0.5323\n0.1495\n3.56\n0.0004\n\n\n\nTest: c234.15 & a1\n-0.9229\n0.5784\n-1.60\n0.1106\n\n\n\nTest: c2.34 & a1\n-0.1633\n0.2649\n-0.62\n0.5375\n\n\n\nTest: c3.4 & a1\n0.0173\n0.1485\n0.12\n0.9074\n\n\n\nTest: c5.1 & Sex: Boys\n0.0904\n0.0434\n2.08\n0.0374\n\n\n\nTest: c234.15 & Sex: Boys\n-0.7858\n0.1688\n-4.65\n<1e-05\n\n\n\nTest: c2.34 & Sex: Boys\n-0.1657\n0.0774\n-2.14\n0.0323\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0336\n0.0442\n-0.76\n0.4471\n\n\n\na1 & Sex: Boys\n0.0029\n0.0481\n0.06\n0.9524\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n0.0936\n0.1495\n0.63\n0.5311\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n-0.4144\n0.5784\n-0.72\n0.4737\n\n\n\nTest: c2.34 & a1 & Sex: Boys\n0.3054\n0.2649\n1.15\n0.2490\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n-0.0072\n0.1485\n-0.05\n0.9614\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_Child_SDC)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.51458282\n0.71734428\n\n\n\n\n\n\n\nTest: Star_r\n0.44019968\n0.66347546\n+0.58\n\n\n\n\n\n\nTest: S20_r\n0.64736611\n0.80459065\n-0.38\n+0.47\n\n\n\n\n\nTest: SLJ\n1.02871501\n1.01425589\n+0.28\n-0.17\n-0.76\n\n\n\n\nTest: BPT\n0.54741412\n0.73987439\n-0.58\n-0.00\n+0.44\n-0.09\n\n\nResidual\n\n0.00000001\n0.00010262\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_Child_HeC)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.451412937\n0.671872709\n\n\n\n\n\n\n\nTest: Star_r\n0.162222113\n0.402768064\n+0.43\n\n\n\n\n\n\nTest: S20_r\n0.144222900\n0.379766903\n-0.21\n+0.79\n\n\n\n\n\nTest: SLJ\n0.038273590\n0.195636371\n+0.24\n-0.32\n-0.47\n\n\n\n\nTest: BPT\n0.039451782\n0.198624726\n-0.21\n+0.15\n+0.34\n+0.54\n\n\nResidual\n\n0.000000113\n0.000336881\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_Child_HyC)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.535369771\n0.731689668\n\n\n\n\n\n\n\nTest: BPT-other\n1.377639883\n1.173729050\n+0.81\n\n\n\n\n\n\nTest: Star-End\n0.928931177\n0.963810758\n+0.20\n+0.05\n\n\n\n\n\nTest: S20-Star\n1.989235435\n1.410402579\n-0.16\n+0.45\n-0.33\n\n\n\n\nTest: SLJ-S20\n0.965830245\n0.982766628\n+0.33\n-0.20\n+0.47\n-0.88\n\n\nResidual\n\n0.000000138\n0.000371215\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_Child_PCA)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.49382403\n0.70272614\n\n\n\n\n\n\n\nTest: c5.1\n2.09506421\n1.44743366\n-0.04\n\n\n\n\n\n\nTest: c234.15\n0.76635120\n0.87541487\n+0.93\n+0.20\n\n\n\n\n\nTest: c2.34\n2.50700186\n1.58335147\n+0.16\n+0.11\n+0.36\n\n\n\n\nTest: c3.4\n1.48425184\n1.21829875\n-0.03\n-0.03\n+0.07\n-0.25\n\n\nResidual\n\n0.00000000\n0.00003566\n\n\n\n\n\n\n\n\n\nThe CPs for the various contrasts are in line with expectations. For the SDC we observe substantial negative CPs between neighboring contrasts. For the orthogonal HeC, all CPs are small; they are uncorrelated. HyC contains some of the SDC contrasts and we observe again the negative CPs. The (roughly) PCA-based contrasts are small with one exception; there is a sizeable CP of +.41 between GM and the core of adjusted physical fitness (c234.15).\nDo these differences in CPs imply that we can move to zcpLMMs when we have orthogonal contrasts? We pursue this question with by refitting the four LMMs with zerocorr() and compare the goodness of fit.\n\nbegin\n  f_Child0 = @formula zScore ~\n    1 + Test * a1 * Sex + zerocorr(1 + Test | Child)\n  m_Child_SDC0 = fit(MixedModel, f_Child0, dat; contrasts=contr1)\n  m_Child_HeC0 = fit(MixedModel, f_Child0, dat; contrasts=contr2)\n  m_Child_HyC0 = fit(MixedModel, f_Child0, dat; contrasts=contr3)\n  m_Child_PCA0 = fit(MixedModel, f_Child0, dat; contrasts=contr4)\nend\n\nMinimizing 466   Time: 0:00:00 ( 1.31 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\n\n\n\n\n(Intercept)\n-0.0206\n0.0142\n-1.45\n0.1461\n0.7572\n\n\nTest: c5.1\n-0.0398\n0.0418\n-0.95\n0.3405\n1.0616\n\n\nTest: c234.15\n0.0416\n0.1665\n0.25\n0.8026\n0.3424\n\n\nTest: c2.34\n-0.0249\n0.0784\n-0.32\n0.7509\n1.9359\n\n\nTest: c3.4\n0.0090\n0.0457\n0.20\n0.8443\n1.1564\n\n\na1\n0.3199\n0.0483\n6.63\n<1e-10\n\n\n\nSex: Boys\n0.1926\n0.0142\n13.58\n<1e-41\n\n\n\nTest: c5.1 & a1\n0.5170\n0.1440\n3.59\n0.0003\n\n\n\nTest: c234.15 & a1\n-0.9459\n0.5711\n-1.66\n0.0977\n\n\n\nTest: c2.34 & a1\n-0.1480\n0.2684\n-0.55\n0.5814\n\n\n\nTest: c3.4 & a1\n0.0161\n0.1538\n0.10\n0.9168\n\n\n\nTest: c5.1 & Sex: Boys\n0.0869\n0.0418\n2.08\n0.0376\n\n\n\nTest: c234.15 & Sex: Boys\n-0.7775\n0.1665\n-4.67\n<1e-05\n\n\n\nTest: c2.34 & Sex: Boys\n-0.1606\n0.0784\n-2.05\n0.0404\n\n\n\nTest: c3.4 & Sex: Boys\n-0.0330\n0.0457\n-0.72\n0.4702\n\n\n\na1 & Sex: Boys\n0.0029\n0.0483\n0.06\n0.9517\n\n\n\nTest: c5.1 & a1 & Sex: Boys\n0.1091\n0.1440\n0.76\n0.4485\n\n\n\nTest: c234.15 & a1 & Sex: Boys\n-0.4682\n0.5711\n-0.82\n0.4124\n\n\n\nTest: c2.34 & a1 & Sex: Boys\n0.3041\n0.2684\n1.13\n0.2572\n\n\n\nTest: c3.4 & a1 & Sex: Boys\n-0.0086\n0.1538\n-0.06\n0.9553\n\n\n\nResidual\n0.0000\n\n\n\n\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_Child_SDC0, m_Child_SDC)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13413\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13459\n-46\n10\nNaN\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_Child_HeC0, m_Child_HeC)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13415\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13504\n-89\n10\nNaN\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_Child_HyC0, m_Child_HyC)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13412\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13516\n-104\n10\nNaN\n\n\n\n\n\n\nMixedModels.likelihoodratiotest(m_Child_PCA0, m_Child_PCA)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Child)\n26\n13359\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 + Test | Child)\n36\n13411\n-53\n10\nNaN\n\n\n\n\n\nObviously, we can not drop CPs from any of the LMMs. The full LMMs all have the same objective, but we can compare the goodness-of-fit statistics of zcpLMMs more directly.\n\nbegin\n  zcpLMM = [\"SDC0\", \"HeC0\", \"HyC0\", \"PCA0\"]\n  mods = [m_Child_SDC0, m_Child_HeC0, m_Child_HyC0, m_Child_PCA0]\n  gof_summary = sort!(\n    DataFrame(;\n      zcpLMM=zcpLMM,\n      dof=dof.(mods),\n      deviance=deviance.(mods),\n      AIC=aic.(mods),\n      BIC=bic.(mods),\n    ),\n    :deviance,\n  )\nend\n\n4×5 DataFrame\n\n\n\nRow\nzcpLMM\ndof\ndeviance\nAIC\nBIC\n\n\n\nString\nInt64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\nPCA0\n26\n13358.7\n13410.7\n13580.2\n\n\n2\nHyC0\n26\n13412.1\n13464.1\n13633.6\n\n\n3\nSDC0\n26\n13412.9\n13464.9\n13634.4\n\n\n4\nHeC0\n26\n13415.5\n13467.5\n13636.9\n\n\n\n\n\n\nThe best fit was obtained for the PCA-based zcpLMM. Somewhat surprisingly the second best fit was obtained for the SDC. The relatively poor performance of HeC-based zcpLMM is puzzling to me. I thought it might be related to imbalance in design in the present data, but this does not appear to be the case. The same comparison of SequentialDifferenceCoding and Helmert Coding also showed a worse fit for the zcp-HeC LMM than the zcp-SDC LMM."
       },
       {
         "objectID": "contrasts_fggk21.html#vcs-and-cps-depend-on-random-factor",
         "href": "contrasts_fggk21.html#vcs-and-cps-depend-on-random-factor",
         "title": "Mixed Models Tutorial: Contrast Coding",
         "section": "3.3 VCs and CPs depend on random factor",
    -    "text": "3.3 VCs and CPs depend on random factor\nVCs and CPs resulting from a set of test contrasts can also be estimated for the random factor School. Of course, these VCs and CPs may look different from the ones we just estimated for Child.\nThe effect of age (i.e., developmental gain) varies within School. Therefore, we also include its VCs and CPs in this model; the school-related VC for Sex was not significant.\n\nf_School = @formula zScore ~\n  1 + Test * a1 * Sex + (1 + Test + a1 | School);\nm_School_SeqDiff = fit(MixedModel, f_School, dat; contrasts=contr1);\nm_School_Helmert = fit(MixedModel, f_School, dat; contrasts=contr2);\nm_School_Hypo = fit(MixedModel, f_School, dat; contrasts=contr3);\nm_School_PCA = fit(MixedModel, f_School, dat; contrasts=contr4);\n\nMinimizing 1078      Time: 0:00:00 ( 0.58 ms/it)\n  objective:  13775.002576180374\n\n\n\nVarCorr(m_School_SeqDiff)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.0420086\n0.2049600\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0982765\n0.3134909\n+0.14\n\n\n\n\n\n\n\nTest: S20_r\n0.1216938\n0.3488464\n+0.05\n-0.19\n\n\n\n\n\n\nTest: SLJ\n0.1105319\n0.3324634\n-0.17\n-0.21\n-0.63\n\n\n\n\n\nTest: BPT\n0.0987757\n0.3142859\n-0.23\n+0.54\n-0.42\n-0.37\n\n\n\n\na1\n0.0074306\n0.0862012\n+0.08\n+0.48\n-0.90\n+0.65\n+0.30\n\n\nResidual\n\n0.8489464\n0.9213829\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_School_Helmert)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.0420088\n0.2049604\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0245878\n0.1568050\n+0.14\n\n\n\n\n\n\n\nTest: S20_r\n0.0139867\n0.1182652\n+0.11\n+0.26\n\n\n\n\n\n\nTest: SLJ\n0.0034051\n0.0583532\n-0.13\n-0.04\n-0.00\n\n\n\n\n\nTest: BPT\n0.0020465\n0.0452385\n-0.41\n+0.71\n-0.24\n-0.21\n\n\n\n\na1\n0.0074273\n0.0861820\n+0.08\n+0.48\n-0.67\n+0.24\n+0.61\n\n\nResidual\n\n0.8489416\n0.9213803\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_School_Hypo)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.042008\n0.204958\n\n\n\n\n\n\n\n\nTest: BPT-other\n0.818744\n0.904845\n-0.41\n\n\n\n\n\n\n\nTest: Star-End\n0.098362\n0.313626\n+0.14\n+0.71\n\n\n\n\n\n\nTest: S20-Star\n0.121763\n0.348946\n+0.05\n-0.57\n-0.19\n\n\n\n\n\nTest: SLJ-S20\n0.110524\n0.332452\n-0.17\n+0.02\n-0.21\n-0.63\n\n\n\n\na1\n0.007438\n0.086245\n+0.08\n+0.61\n+0.48\n-0.90\n+0.65\n\n\nResidual\n\n0.848938\n0.921378\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_School_PCA)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.0420042\n0.2049494\n\n\n\n\n\n\n\n\nTest: c5.1\n0.1339417\n0.3659805\n-0.18\n\n\n\n\n\n\n\nTest: c234.15\n1.2439576\n1.1153285\n+0.38\n+0.32\n\n\n\n\n\n\nTest: c2.34\n0.3067810\n0.5538781\n+0.04\n+0.29\n-0.66\n\n\n\n\n\nTest: c3.4\n0.1104516\n0.3323425\n+0.17\n+0.19\n+0.38\n-0.18\n\n\n\n\na1\n0.0075571\n0.0869314\n+0.07\n+0.41\n-0.33\n+0.73\n-0.66\n\n\nResidual\n\n0.8489538\n0.9213869\n\n\n\n\n\n\n\n\n\n\nWe compare again how much of the fit resides in the CPs.\n\nbegin\n  f_School0 = @formula zScore ~\n    1 + Test * a1 * Sex + zerocorr(1 + Test + a1 | School)\n  m_School_SDC0 = fit(MixedModel, f_School0, dat; contrasts=contr1)\n  m_School_HeC0 = fit(MixedModel, f_School0, dat; contrasts=contr2)\n  m_School_HyC0 = fit(MixedModel, f_School0, dat; contrasts=contr3)\n  m_School_PCA0 = fit(MixedModel, f_School0, dat; contrasts=contr4)\n  #\n  zcpLMM2 = [\"SDC0\", \"HeC0\", \"HyC0\", \"PCA0\"]\n  mods2 = [\n    m_School_SDC0, m_School_HeC0, m_School_HyC0, m_School_PCA0\n  ]\n  gof_summary2 = sort!(\n    DataFrame(;\n      zcpLMM=zcpLMM2,\n      dof=dof.(mods2),\n      deviance=deviance.(mods2),\n      AIC=aic.(mods2),\n      BIC=bic.(mods2),\n    ),\n    :deviance,\n  )\nend\n\nMinimizing 287   Time: 0:00:00 ( 0.45 ms/it)\n\n\n4×5 DataFrame\n\n\n\nRow\nzcpLMM\ndof\ndeviance\nAIC\nBIC\n\n\n\nString\nInt64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\nHeC0\n27\n13785.1\n13839.1\n14015.0\n\n\n2\nPCA0\n27\n13787.0\n13841.0\n14016.9\n\n\n3\nHyC0\n27\n13790.1\n13844.1\n14020.1\n\n\n4\nSDC0\n27\n13793.6\n13847.6\n14023.6\n\n\n\n\n\n\nFor the random factor School the Helmert contrast, followed by PCA-based contrasts have least information in the CPs; SDC has the largest contribution from CPs. Interesting."
    +    "text": "3.3 VCs and CPs depend on random factor\nVCs and CPs resulting from a set of test contrasts can also be estimated for the random factor School. Of course, these VCs and CPs may look different from the ones we just estimated for Child.\nThe effect of age (i.e., developmental gain) varies within School. Therefore, we also include its VCs and CPs in this model; the school-related VC for Sex was not significant.\n\nf_School = @formula zScore ~\n  1 + Test * a1 * Sex + (1 + Test + a1 | School);\nm_School_SeqDiff = fit(MixedModel, f_School, dat; contrasts=contr1);\nm_School_Helmert = fit(MixedModel, f_School, dat; contrasts=contr2);\nm_School_Hypo = fit(MixedModel, f_School, dat; contrasts=contr3);\nm_School_PCA = fit(MixedModel, f_School, dat; contrasts=contr4);\n\nMinimizing 1874      Time: 0:00:00 ( 0.34 ms/it)\n\n\n\nVarCorr(m_School_SeqDiff)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.042884\n0.207084\n\n\n\n\n\n\n\n\nTest: Star_r\n0.189169\n0.434935\n-0.05\n\n\n\n\n\n\n\nTest: S20_r\n0.178229\n0.422172\n-0.05\n-0.59\n\n\n\n\n\n\nTest: SLJ\n0.062911\n0.250822\n+0.21\n-0.01\n-0.80\n\n\n\n\n\nTest: BPT\n0.042820\n0.206930\n-0.97\n+0.12\n-0.11\n-0.06\n\n\n\n\na1\n0.107585\n0.328002\n+0.10\n+0.57\n-0.24\n-0.11\n+0.06\n\n\nResidual\n\n0.846734\n0.920182\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_School_Helmert)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.0428835\n0.2070833\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0473123\n0.2175138\n-0.05\n\n\n\n\n\n\n\nTest: S20_r\n0.0130709\n0.1143283\n-0.10\n-0.09\n\n\n\n\n\n\nTest: SLJ\n0.0001081\n0.0103977\n+0.72\n-0.56\n-0.47\n\n\n\n\n\nTest: BPT\n0.0014011\n0.0374311\n-0.95\n+0.04\n-0.14\n-0.58\n\n\n\n\na1\n0.1076031\n0.3280291\n+0.10\n+0.57\n+0.06\n-0.32\n+0.01\n\n\nResidual\n\n0.8467348\n0.9201820\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_School_Hypo)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.042900\n0.207123\n\n\n\n\n\n\n\n\nTest: BPT-other\n0.567435\n0.753283\n-0.95\n\n\n\n\n\n\n\nTest: Star-End\n0.189263\n0.435044\n-0.05\n+0.04\n\n\n\n\n\n\nTest: S20-Star\n0.178179\n0.422113\n-0.05\n-0.13\n-0.59\n\n\n\n\n\nTest: SLJ-S20\n0.064246\n0.253467\n+0.20\n+0.02\n-0.01\n-0.79\n\n\n\n\na1\n0.107755\n0.328261\n+0.10\n+0.01\n+0.57\n-0.24\n-0.11\n\n\nResidual\n\n0.846455\n0.920030\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_School_PCA)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.042875\n0.207063\n\n\n\n\n\n\n\n\nTest: c5.1\n0.082489\n0.287209\n-0.67\n\n\n\n\n\n\n\nTest: c234.15\n1.710233\n1.307759\n+0.35\n+0.40\n\n\n\n\n\n\nTest: c2.34\n0.439032\n0.662595\n-0.01\n+0.38\n+0.24\n\n\n\n\n\nTest: c3.4\n0.063745\n0.252478\n-0.20\n+0.37\n+0.43\n-0.63\n\n\n\n\na1\n0.107783\n0.328304\n+0.10\n+0.45\n+0.48\n+0.35\n+0.11\n\n\nResidual\n\n0.846554\n0.920084\n\n\n\n\n\n\n\n\n\n\nWe compare again how much of the fit resides in the CPs.\n\nbegin\n  f_School0 = @formula zScore ~\n    1 + Test * a1 * Sex + zerocorr(1 + Test + a1 | School)\n  m_School_SDC0 = fit(MixedModel, f_School0, dat; contrasts=contr1)\n  m_School_HeC0 = fit(MixedModel, f_School0, dat; contrasts=contr2)\n  m_School_HyC0 = fit(MixedModel, f_School0, dat; contrasts=contr3)\n  m_School_PCA0 = fit(MixedModel, f_School0, dat; contrasts=contr4)\n  #\n  zcpLMM2 = [\"SDC0\", \"HeC0\", \"HyC0\", \"PCA0\"]\n  mods2 = [\n    m_School_SDC0, m_School_HeC0, m_School_HyC0, m_School_PCA0\n  ]\n  gof_summary2 = sort!(\n    DataFrame(;\n      zcpLMM=zcpLMM2,\n      dof=dof.(mods2),\n      deviance=deviance.(mods2),\n      AIC=aic.(mods2),\n      BIC=bic.(mods2),\n    ),\n    :deviance,\n  )\nend\n\n4×5 DataFrame\n\n\n\nRow\nzcpLMM\ndof\ndeviance\nAIC\nBIC\n\n\n\nString\nInt64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\nHeC0\n27\n13804.4\n13858.4\n14034.4\n\n\n2\nPCA0\n27\n13813.1\n13867.1\n14043.1\n\n\n3\nHyC0\n27\n13817.9\n13871.9\n14047.9\n\n\n4\nSDC0\n27\n13819.9\n13873.9\n14049.9\n\n\n\n\n\n\nFor the random factor School the Helmert contrast, followed by PCA-based contrasts have least information in the CPs; SDC has the largest contribution from CPs. Interesting."
       },
       {
         "objectID": "fggk21.html",
    @@ -515,14 +515,14 @@
         "href": "fggk21.html#lmm-m_zcp",
         "title": "Basics with Emotikon Project",
         "section": "4.2 LMM m_zcp",
    -    "text": "4.2 LMM m_zcp\nIn this LMM we allow that schools differ not only in GM, but also in the size of the four contrasts defined for Test, in the difference between boys and girls (Sex) and the developmental gain children achieve within the third grade (age).\nWe assume that there is covariance associated with these CPs beyond residual noise, that is we assume that there is no detectable evidence in the data that the CPs are different from zero.\n\nm_zcp = let\n  f = @formula(\n    zScore ~\n      1 + Test * Sex * a1 + zerocorr(1 + Test + Sex + a1 | School)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\nMinimizing 148   Time: 0:00:00 ( 1.86 ms/it)\n  objective:  25923.460469750276\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_School\n\n\n\n\n(Intercept)\n-0.0247\n0.0198\n-1.24\n0.2136\n0.3257\n\n\nTest: Star_r\n0.0029\n0.0311\n0.09\n0.9254\n0.2208\n\n\nTest: S20_r\n0.0102\n0.0286\n0.36\n0.7209\n0.0503\n\n\nTest: SLJ\n0.0049\n0.0283\n0.17\n0.8634\n0.0000\n\n\nTest: BMT\n-0.0460\n0.0309\n-1.49\n0.1368\n0.2286\n\n\nSex: Girls\n-0.4399\n0.0322\n-13.64\n<1e-41\n0.4503\n\n\na1\n0.1840\n0.0573\n3.21\n0.0013\n0.7780\n\n\nTest: Star_r & Sex: Girls\n0.3784\n0.0577\n6.55\n<1e-10\n\n\n\nTest: S20_r & Sex: Girls\n-0.2019\n0.0570\n-3.54\n0.0004\n\n\n\nTest: SLJ & Sex: Girls\n-0.0666\n0.0566\n-1.18\n0.2392\n\n\n\nTest: BMT & Sex: Girls\n-0.2780\n0.0570\n-4.87\n<1e-05\n\n\n\nTest: Star_r & a1\n0.3101\n0.0992\n3.13\n0.0018\n\n\n\nTest: S20_r & a1\n-0.0728\n0.0976\n-0.75\n0.4558\n\n\n\nTest: SLJ & a1\n-0.0784\n0.0968\n-0.81\n0.4180\n\n\n\nTest: BMT & a1\n0.4741\n0.0979\n4.84\n<1e-05\n\n\n\nSex: Girls & a1\n-0.1453\n0.0791\n-1.84\n0.0662\n\n\n\nTest: Star_r & Sex: Girls & a1\n-0.1570\n0.1982\n-0.79\n0.4284\n\n\n\nTest: S20_r & Sex: Girls & a1\n0.1799\n0.1952\n0.92\n0.3566\n\n\n\nTest: SLJ & Sex: Girls & a1\n0.0061\n0.1936\n0.03\n0.9749\n\n\n\nTest: BMT & Sex: Girls & a1\n0.1657\n0.1958\n0.85\n0.3974\n\n\n\nResidual\n0.8623\n\n\n\n\n\n\n\n\n\nDepending on sampling, this model estimating variance components for School may or may not be supported by the data.\n\nissingular(m_zcp)\n\ntrue"
    +    "text": "4.2 LMM m_zcp\nIn this LMM we allow that schools differ not only in GM, but also in the size of the four contrasts defined for Test, in the difference between boys and girls (Sex) and the developmental gain children achieve within the third grade (age).\nWe assume that there is covariance associated with these CPs beyond residual noise, that is we assume that there is no detectable evidence in the data that the CPs are different from zero.\n\nm_zcp = let\n  f = @formula(\n    zScore ~\n      1 + Test * Sex * a1 + zerocorr(1 + Test + Sex + a1 | School)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_School\n\n\n\n\n(Intercept)\n-0.0247\n0.0198\n-1.24\n0.2136\n0.3257\n\n\nTest: Star_r\n0.0029\n0.0311\n0.09\n0.9254\n0.2208\n\n\nTest: S20_r\n0.0102\n0.0286\n0.36\n0.7209\n0.0503\n\n\nTest: SLJ\n0.0049\n0.0283\n0.17\n0.8634\n0.0000\n\n\nTest: BMT\n-0.0460\n0.0309\n-1.49\n0.1368\n0.2286\n\n\nSex: Girls\n-0.4399\n0.0322\n-13.64\n<1e-41\n0.4503\n\n\na1\n0.1840\n0.0573\n3.21\n0.0013\n0.7780\n\n\nTest: Star_r & Sex: Girls\n0.3784\n0.0577\n6.55\n<1e-10\n\n\n\nTest: S20_r & Sex: Girls\n-0.2019\n0.0570\n-3.54\n0.0004\n\n\n\nTest: SLJ & Sex: Girls\n-0.0666\n0.0566\n-1.18\n0.2392\n\n\n\nTest: BMT & Sex: Girls\n-0.2780\n0.0570\n-4.87\n<1e-05\n\n\n\nTest: Star_r & a1\n0.3101\n0.0992\n3.13\n0.0018\n\n\n\nTest: S20_r & a1\n-0.0728\n0.0976\n-0.75\n0.4558\n\n\n\nTest: SLJ & a1\n-0.0784\n0.0968\n-0.81\n0.4180\n\n\n\nTest: BMT & a1\n0.4741\n0.0979\n4.84\n<1e-05\n\n\n\nSex: Girls & a1\n-0.1453\n0.0791\n-1.84\n0.0662\n\n\n\nTest: Star_r & Sex: Girls & a1\n-0.1570\n0.1982\n-0.79\n0.4284\n\n\n\nTest: S20_r & Sex: Girls & a1\n0.1799\n0.1952\n0.92\n0.3566\n\n\n\nTest: SLJ & Sex: Girls & a1\n0.0061\n0.1936\n0.03\n0.9749\n\n\n\nTest: BMT & Sex: Girls & a1\n0.1657\n0.1958\n0.85\n0.3974\n\n\n\nResidual\n0.8623\n\n\n\n\n\n\n\n\n\nDepending on sampling, this model estimating variance components for School may or may not be supported by the data.\n\nissingular(m_zcp)\n\ntrue"
       },
       {
         "objectID": "fggk21.html#lmm-m_cpx",
         "href": "fggk21.html#lmm-m_cpx",
         "title": "Basics with Emotikon Project",
         "section": "4.3 LMM m_cpx",
    -    "text": "4.3 LMM m_cpx\nIn the complex LMM investigated in this sequence we give up the assumption of zero-correlation between VCs.\n\nm_cpx = let\n  f = @formula(\n    zScore ~ 1 + Test * Sex * a1 + (1 + Test + Sex + a1 | School)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\nMinimizing 2857      Time: 0:00:01 ( 0.69 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_School\n\n\n\n\n(Intercept)\n-0.0268\n0.0198\n-1.35\n0.1757\n0.3264\n\n\nTest: Star_r\n0.0056\n0.0310\n0.18\n0.8574\n0.2203\n\n\nTest: S20_r\n0.0104\n0.0301\n0.35\n0.7294\n0.1755\n\n\nTest: SLJ\n0.0024\n0.0294\n0.08\n0.9355\n0.1476\n\n\nTest: BMT\n-0.0401\n0.0305\n-1.32\n0.1881\n0.2242\n\n\nSex: Girls\n-0.4356\n0.0320\n-13.61\n<1e-41\n0.4482\n\n\na1\n0.1877\n0.0566\n3.31\n0.0009\n0.7686\n\n\nTest: Star_r & Sex: Girls\n0.3759\n0.0575\n6.53\n<1e-10\n\n\n\nTest: S20_r & Sex: Girls\n-0.1969\n0.0572\n-3.44\n0.0006\n\n\n\nTest: SLJ & Sex: Girls\n-0.0673\n0.0567\n-1.19\n0.2349\n\n\n\nTest: BMT & Sex: Girls\n-0.2717\n0.0566\n-4.80\n<1e-05\n\n\n\nTest: Star_r & a1\n0.3112\n0.0988\n3.15\n0.0016\n\n\n\nTest: S20_r & a1\n-0.0707\n0.0981\n-0.72\n0.4710\n\n\n\nTest: SLJ & a1\n-0.0642\n0.0971\n-0.66\n0.5085\n\n\n\nTest: BMT & a1\n0.4678\n0.0971\n4.82\n<1e-05\n\n\n\nSex: Girls & a1\n-0.1405\n0.0783\n-1.79\n0.0728\n\n\n\nTest: Star_r & Sex: Girls & a1\n-0.1632\n0.1975\n-0.83\n0.4085\n\n\n\nTest: S20_r & Sex: Girls & a1\n0.1862\n0.1961\n0.95\n0.3424\n\n\n\nTest: SLJ & Sex: Girls & a1\n0.0011\n0.1941\n0.01\n0.9954\n\n\n\nTest: BMT & Sex: Girls & a1\n0.1639\n0.1942\n0.84\n0.3987\n\n\n\nResidual\n0.8598\n\n\n\n\n\n\n\n\n\nWe also need to see the VCs and CPs of the random-effect structure (RES).\n\nVarCorr(m_cpx)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.106506\n0.326352\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.048510\n0.220251\n+0.10\n\n\n\n\n\n\n\n\nTest: S20_r\n0.030805\n0.175513\n-0.19\n-0.22\n\n\n\n\n\n\n\nTest: SLJ\n0.021774\n0.147561\n-0.10\n+0.07\n-0.83\n\n\n\n\n\n\nTest: BMT\n0.050266\n0.224200\n-0.75\n+0.43\n-0.13\n+0.16\n\n\n\n\n\nSex: Girls\n0.200891\n0.448209\n-0.04\n+0.25\n+0.20\n-0.26\n-0.10\n\n\n\n\na1\n0.590683\n0.768559\n+0.02\n-0.13\n+0.03\n-0.49\n+0.17\n-0.06\n\n\nResidual\n\n0.739305\n0.859829\n\n\n\n\n\n\n\n\n\n\n\n\nissingular(m_cpx)\n\ntrue\n\n\nThe complex model may or may not be supported by the data."
    +    "text": "4.3 LMM m_cpx\nIn the complex LMM investigated in this sequence we give up the assumption of zero-correlation between VCs.\n\nm_cpx = let\n  f = @formula(\n    zScore ~ 1 + Test * Sex * a1 + (1 + Test + Sex + a1 | School)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\nMinimizing 2458      Time: 0:00:01 ( 0.45 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_School\n\n\n\n\n(Intercept)\n-0.0268\n0.0198\n-1.35\n0.1757\n0.3264\n\n\nTest: Star_r\n0.0056\n0.0310\n0.18\n0.8575\n0.2202\n\n\nTest: S20_r\n0.0104\n0.0301\n0.35\n0.7293\n0.1756\n\n\nTest: SLJ\n0.0024\n0.0294\n0.08\n0.9355\n0.1476\n\n\nTest: BMT\n-0.0402\n0.0305\n-1.32\n0.1880\n0.2242\n\n\nSex: Girls\n-0.4356\n0.0320\n-13.61\n<1e-41\n0.4482\n\n\na1\n0.1877\n0.0566\n3.31\n0.0009\n0.7687\n\n\nTest: Star_r & Sex: Girls\n0.3759\n0.0575\n6.53\n<1e-10\n\n\n\nTest: S20_r & Sex: Girls\n-0.1969\n0.0572\n-3.44\n0.0006\n\n\n\nTest: SLJ & Sex: Girls\n-0.0673\n0.0567\n-1.19\n0.2349\n\n\n\nTest: BMT & Sex: Girls\n-0.2717\n0.0566\n-4.80\n<1e-05\n\n\n\nTest: Star_r & a1\n0.3112\n0.0988\n3.15\n0.0016\n\n\n\nTest: S20_r & a1\n-0.0707\n0.0981\n-0.72\n0.4710\n\n\n\nTest: SLJ & a1\n-0.0642\n0.0971\n-0.66\n0.5086\n\n\n\nTest: BMT & a1\n0.4678\n0.0971\n4.82\n<1e-05\n\n\n\nSex: Girls & a1\n-0.1404\n0.0783\n-1.79\n0.0728\n\n\n\nTest: Star_r & Sex: Girls & a1\n-0.1632\n0.1974\n-0.83\n0.4085\n\n\n\nTest: S20_r & Sex: Girls & a1\n0.1863\n0.1961\n0.95\n0.3423\n\n\n\nTest: SLJ & Sex: Girls & a1\n0.0011\n0.1941\n0.01\n0.9955\n\n\n\nTest: BMT & Sex: Girls & a1\n0.1639\n0.1942\n0.84\n0.3988\n\n\n\nResidual\n0.8598\n\n\n\n\n\n\n\n\n\nWe also need to see the VCs and CPs of the random-effect structure (RES).\n\nVarCorr(m_cpx)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nSchool\n(Intercept)\n0.106539\n0.326404\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.048484\n0.220190\n+0.10\n\n\n\n\n\n\n\n\nTest: S20_r\n0.030825\n0.175570\n-0.19\n-0.21\n\n\n\n\n\n\n\nTest: SLJ\n0.021787\n0.147603\n-0.10\n+0.07\n-0.83\n\n\n\n\n\n\nTest: BMT\n0.050266\n0.224200\n-0.75\n+0.43\n-0.13\n+0.16\n\n\n\n\n\nSex: Girls\n0.200922\n0.448243\n-0.04\n+0.25\n+0.20\n-0.27\n-0.10\n\n\n\n\na1\n0.590868\n0.768680\n+0.02\n-0.13\n+0.03\n-0.49\n+0.17\n-0.06\n\n\nResidual\n\n0.739285\n0.859817\n\n\n\n\n\n\n\n\n\n\n\n\nissingular(m_cpx)\n\nfalse\n\n\nThe complex model may or may not be supported by the data."
       },
       {
         "objectID": "fggk21.html#model-comparisons",
    @@ -536,14 +536,14 @@
         "href": "fggk21.html#fitting-an-overparameterized-lmm",
         "title": "Basics with Emotikon Project",
         "section": "4.5 Fitting an overparameterized LMM",
    -    "text": "4.5 Fitting an overparameterized LMM\nThe complex LMM was not overparameterized with respect to School, because there are over 400 schools in the data. When the number of units (levels) of a grouping factor is small relative to the number of parameters we are trying to estimate, we often end up with an overparameterized / degenerate random-effect structure.\nAs an illustration, we fit a full CP matrix for the Cohort. As there are only nine cohorts in the data, we may be asking too much to estimate 5*6/2 = 15 VC/CP parameters.\n\nm_cpxCohort = let\n  f = @formula zScore ~ 1 + Test * a1 * Sex + (1 + Test | Cohort)\n  fit(MixedModel, f, dat; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0009\n0.0161\n-0.06\n0.9548\n0.0378\n\n\nTest: Star_r\n-0.0073\n0.0380\n-0.19\n0.8482\n0.0614\n\n\nTest: S20_r\n0.0056\n0.0383\n0.15\n0.8845\n0.0636\n\n\nTest: SLJ\n0.0101\n0.0451\n0.22\n0.8226\n0.0958\n\n\nTest: BMT\n-0.0556\n0.0335\n-1.66\n0.0968\n0.0330\n\n\na1\n0.2055\n0.0349\n5.90\n<1e-08\n\n\n\nSex: Girls\n-0.4238\n0.0201\n-21.07\n<1e-97\n\n\n\nTest: Star_r & a1\n0.2849\n0.1101\n2.59\n0.0097\n\n\n\nTest: S20_r & a1\n-0.1172\n0.1096\n-1.07\n0.2851\n\n\n\nTest: SLJ & a1\n-0.0270\n0.1094\n-0.25\n0.8049\n\n\n\nTest: BMT & a1\n0.4555\n0.1084\n4.20\n<1e-04\n\n\n\nTest: Star_r & Sex: Girls\n0.3700\n0.0640\n5.78\n<1e-08\n\n\n\nTest: S20_r & Sex: Girls\n-0.2116\n0.0638\n-3.32\n0.0009\n\n\n\nTest: SLJ & Sex: Girls\n-0.0552\n0.0634\n-0.87\n0.3844\n\n\n\nTest: BMT & Sex: Girls\n-0.2718\n0.0632\n-4.30\n<1e-04\n\n\n\na1 & Sex: Girls\n-0.1368\n0.0690\n-1.98\n0.0473\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.2099\n0.2194\n-0.96\n0.3387\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1609\n0.2186\n0.74\n0.4615\n\n\n\nTest: SLJ & a1 & Sex: Girls\n0.0225\n0.2172\n0.10\n0.9174\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1901\n0.2166\n0.88\n0.3801\n\n\n\nResidual\n0.9671\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_cpxCohort)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nCohort\n(Intercept)\n0.0014272\n0.0377788\n\n\n\n\n\n\n\nTest: Star_r\n0.0037684\n0.0613873\n-0.90\n\n\n\n\n\n\nTest: S20_r\n0.0040406\n0.0635659\n-1.00\n+0.87\n\n\n\n\n\nTest: SLJ\n0.0091867\n0.0958474\n+0.98\n-0.97\n-0.97\n\n\n\n\nTest: BMT\n0.0010891\n0.0330020\n-1.00\n+0.91\n+0.99\n-0.99\n\n\nResidual\n\n0.9353139\n0.9671163\n\n\n\n\n\n\n\n\n\n\nissingular(m_cpxCohort)\n\ntrue\n\n\nThe model is overparameterized with several CPs estimated between |.98| and |1.00|. How about the zero-correlation parameter (zcp) version of this LMM?\n\nm_zcpCohort = let\n  f = @formula(\n    zScore ~ 1 + Test * a1 * Sex + zerocorr(1 + Test | Cohort)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0022\n0.0152\n-0.15\n0.8837\n0.0341\n\n\nTest: Star_r\n-0.0042\n0.0339\n-0.12\n0.9023\n0.0331\n\n\nTest: S20_r\n0.0088\n0.0319\n0.27\n0.7837\n0.0000\n\n\nTest: SLJ\n0.0045\n0.0317\n0.14\n0.8876\n0.0000\n\n\nTest: BMT\n-0.0536\n0.0316\n-1.69\n0.0903\n0.0000\n\n\na1\n0.1999\n0.0351\n5.70\n<1e-07\n\n\n\nSex: Girls\n-0.4245\n0.0201\n-21.08\n<1e-97\n\n\n\nTest: Star_r & a1\n0.3078\n0.1101\n2.80\n0.0052\n\n\n\nTest: S20_r & a1\n-0.0849\n0.1093\n-0.78\n0.4377\n\n\n\nTest: SLJ & a1\n-0.0748\n0.1086\n-0.69\n0.4911\n\n\n\nTest: BMT & a1\n0.4717\n0.1084\n4.35\n<1e-04\n\n\n\nTest: Star_r & Sex: Girls\n0.3729\n0.0640\n5.82\n<1e-08\n\n\n\nTest: S20_r & Sex: Girls\n-0.2079\n0.0638\n-3.26\n0.0011\n\n\n\nTest: SLJ & Sex: Girls\n-0.0611\n0.0634\n-0.96\n0.3354\n\n\n\nTest: BMT & Sex: Girls\n-0.2697\n0.0632\n-4.27\n<1e-04\n\n\n\na1 & Sex: Girls\n-0.1372\n0.0691\n-1.99\n0.0470\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.2041\n0.2195\n-0.93\n0.3525\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1733\n0.2187\n0.79\n0.4280\n\n\n\nTest: SLJ & a1 & Sex: Girls\n0.0051\n0.2172\n0.02\n0.9811\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1962\n0.2168\n0.90\n0.3655\n\n\n\nResidual\n0.9680\n\n\n\n\n\n\n\n\n\n\nissingular(m_zcpCohort)\n\ntrue\n\n\nThis zcpLMM is also singular. Three of the five VCs are estimated as zero. This raises the possibility that LMM m_oviCohort might fit as well as LMM m_zcpCohort.\n\nm_oviCohort = let\n  f = @formula zScore ~ 1 + Test * a1 * Sex + (1 | Cohort)\n  fit(MixedModel, f, dat; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0022\n0.0152\n-0.15\n0.8835\n0.0340\n\n\nTest: Star_r\n-0.0032\n0.0320\n-0.10\n0.9196\n\n\n\nTest: S20_r\n0.0087\n0.0319\n0.27\n0.7847\n\n\n\nTest: SLJ\n0.0045\n0.0317\n0.14\n0.8869\n\n\n\nTest: BMT\n-0.0536\n0.0316\n-1.69\n0.0903\n\n\n\na1\n0.1999\n0.0351\n5.69\n<1e-07\n\n\n\nSex: Girls\n-0.4245\n0.0201\n-21.08\n<1e-97\n\n\n\nTest: Star_r & a1\n0.3135\n0.1097\n2.86\n0.0043\n\n\n\nTest: S20_r & a1\n-0.0848\n0.1093\n-0.78\n0.4378\n\n\n\nTest: SLJ & a1\n-0.0748\n0.1086\n-0.69\n0.4910\n\n\n\nTest: BMT & a1\n0.4718\n0.1084\n4.35\n<1e-04\n\n\n\nTest: Star_r & Sex: Girls\n0.3736\n0.0640\n5.84\n<1e-08\n\n\n\nTest: S20_r & Sex: Girls\n-0.2079\n0.0638\n-3.26\n0.0011\n\n\n\nTest: SLJ & Sex: Girls\n-0.0611\n0.0634\n-0.96\n0.3356\n\n\n\nTest: BMT & Sex: Girls\n-0.2697\n0.0632\n-4.27\n<1e-04\n\n\n\na1 & Sex: Girls\n-0.1371\n0.0691\n-1.99\n0.0471\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.2022\n0.2195\n-0.92\n0.3568\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1733\n0.2187\n0.79\n0.4281\n\n\n\nTest: SLJ & a1 & Sex: Girls\n0.0051\n0.2172\n0.02\n0.9811\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1961\n0.2168\n0.90\n0.3657\n\n\n\nResidual\n0.9681\n\n\n\n\n\n\n\n\n\n\nissingular(m_oviCohort)\n\nfalse\n\n\nThis solves the problem with singularity, but does LMM m_zcpCohort fit noise relative to the LMM m_oviCohort?\n\nMixedModels.likelihoodratiotest(m_oviCohort, m_zcpCohort)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 | Cohort)\n22\n26803\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Cohort)\n26\n26803\n0\n4\n0.9968\n\n\n\n\n\n\ngof_summary2 = let\n  mods = [m_oviCohort, m_zcpCohort, m_cpxCohort]\n  DataFrame(;\n    dof=dof.(mods),\n    deviance=deviance.(mods),\n    AIC=aic.(mods),\n    AICc=aicc.(mods),\n    BIC=bic.(mods),\n  )\nend\n\n3×5 DataFrame\n\n\n\nRow\ndof\ndeviance\nAIC\nAICc\nBIC\n\n\n\nInt64\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\n22\n26802.9\n26846.9\n26847.0\n27004.7\n\n\n2\n26\n26802.7\n26854.7\n26854.8\n27041.3\n\n\n3\n36\n26790.5\n26862.5\n26862.7\n27120.8\n\n\n\n\n\n\nIndeed, adding VCs is fitting noise. Again, the goodness of fit statistics unanimously favor the selection of the LMM m_oviCohort.\nNot shown here, but the Cohort-related VCs for the Test contrasts could be estimated reliably for the full data. Thus, the small number of cohorts does not necessarily prevent the determination of reliable differences between tests across cohorts. What if we include VCs and CPs related to random factors Child and School?"
    +    "text": "4.5 Fitting an overparameterized LMM\nThe complex LMM was not overparameterized with respect to School, because there are over 400 schools in the data. When the number of units (levels) of a grouping factor is small relative to the number of parameters we are trying to estimate, we often end up with an overparameterized / degenerate random-effect structure.\nAs an illustration, we fit a full CP matrix for the Cohort. As there are only nine cohorts in the data, we may be asking too much to estimate 5*6/2 = 15 VC/CP parameters.\n\nm_cpxCohort = let\n  f = @formula zScore ~ 1 + Test * a1 * Sex + (1 + Test | Cohort)\n  fit(MixedModel, f, dat; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0009\n0.0161\n-0.06\n0.9548\n0.0378\n\n\nTest: Star_r\n-0.0073\n0.0380\n-0.19\n0.8482\n0.0614\n\n\nTest: S20_r\n0.0056\n0.0383\n0.15\n0.8845\n0.0636\n\n\nTest: SLJ\n0.0101\n0.0451\n0.22\n0.8226\n0.0959\n\n\nTest: BMT\n-0.0556\n0.0335\n-1.66\n0.0968\n0.0330\n\n\na1\n0.2055\n0.0349\n5.90\n<1e-08\n\n\n\nSex: Girls\n-0.4238\n0.0201\n-21.07\n<1e-97\n\n\n\nTest: Star_r & a1\n0.2849\n0.1101\n2.59\n0.0097\n\n\n\nTest: S20_r & a1\n-0.1172\n0.1096\n-1.07\n0.2851\n\n\n\nTest: SLJ & a1\n-0.0270\n0.1094\n-0.25\n0.8049\n\n\n\nTest: BMT & a1\n0.4555\n0.1084\n4.20\n<1e-04\n\n\n\nTest: Star_r & Sex: Girls\n0.3700\n0.0640\n5.78\n<1e-08\n\n\n\nTest: S20_r & Sex: Girls\n-0.2116\n0.0638\n-3.32\n0.0009\n\n\n\nTest: SLJ & Sex: Girls\n-0.0552\n0.0634\n-0.87\n0.3844\n\n\n\nTest: BMT & Sex: Girls\n-0.2718\n0.0632\n-4.30\n<1e-04\n\n\n\na1 & Sex: Girls\n-0.1368\n0.0690\n-1.98\n0.0473\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.2099\n0.2194\n-0.96\n0.3387\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1609\n0.2186\n0.74\n0.4615\n\n\n\nTest: SLJ & a1 & Sex: Girls\n0.0225\n0.2172\n0.10\n0.9174\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1901\n0.2166\n0.88\n0.3801\n\n\n\nResidual\n0.9671\n\n\n\n\n\n\n\n\n\n\nVarCorr(m_cpxCohort)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\nCohort\n(Intercept)\n0.0014270\n0.0377751\n\n\n\n\n\n\n\nTest: Star_r\n0.0037661\n0.0613683\n-0.90\n\n\n\n\n\n\nTest: S20_r\n0.0040405\n0.0635650\n-1.00\n+0.87\n\n\n\n\n\nTest: SLJ\n0.0091876\n0.0958520\n+0.98\n-0.97\n-0.97\n\n\n\n\nTest: BMT\n0.0010887\n0.0329948\n-1.00\n+0.91\n+0.99\n-0.99\n\n\nResidual\n\n0.9353141\n0.9671164\n\n\n\n\n\n\n\n\n\n\nissingular(m_cpxCohort)\n\ntrue\n\n\nThe model is overparameterized with several CPs estimated between |.98| and |1.00|. How about the zero-correlation parameter (zcp) version of this LMM?\n\nm_zcpCohort = let\n  f = @formula(\n    zScore ~ 1 + Test * a1 * Sex + zerocorr(1 + Test | Cohort)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0022\n0.0152\n-0.15\n0.8837\n0.0341\n\n\nTest: Star_r\n-0.0042\n0.0339\n-0.12\n0.9023\n0.0331\n\n\nTest: S20_r\n0.0088\n0.0319\n0.27\n0.7837\n0.0000\n\n\nTest: SLJ\n0.0045\n0.0317\n0.14\n0.8876\n0.0000\n\n\nTest: BMT\n-0.0536\n0.0316\n-1.69\n0.0903\n0.0000\n\n\na1\n0.1999\n0.0351\n5.70\n<1e-07\n\n\n\nSex: Girls\n-0.4245\n0.0201\n-21.08\n<1e-97\n\n\n\nTest: Star_r & a1\n0.3078\n0.1101\n2.80\n0.0052\n\n\n\nTest: S20_r & a1\n-0.0849\n0.1093\n-0.78\n0.4377\n\n\n\nTest: SLJ & a1\n-0.0748\n0.1086\n-0.69\n0.4911\n\n\n\nTest: BMT & a1\n0.4717\n0.1084\n4.35\n<1e-04\n\n\n\nTest: Star_r & Sex: Girls\n0.3729\n0.0640\n5.82\n<1e-08\n\n\n\nTest: S20_r & Sex: Girls\n-0.2079\n0.0638\n-3.26\n0.0011\n\n\n\nTest: SLJ & Sex: Girls\n-0.0611\n0.0634\n-0.96\n0.3354\n\n\n\nTest: BMT & Sex: Girls\n-0.2697\n0.0632\n-4.27\n<1e-04\n\n\n\na1 & Sex: Girls\n-0.1372\n0.0691\n-1.99\n0.0470\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.2041\n0.2195\n-0.93\n0.3525\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1733\n0.2187\n0.79\n0.4280\n\n\n\nTest: SLJ & a1 & Sex: Girls\n0.0051\n0.2172\n0.02\n0.9811\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1962\n0.2168\n0.90\n0.3655\n\n\n\nResidual\n0.9680\n\n\n\n\n\n\n\n\n\n\nissingular(m_zcpCohort)\n\ntrue\n\n\nThis zcpLMM is also singular. Three of the five VCs are estimated as zero. This raises the possibility that LMM m_oviCohort might fit as well as LMM m_zcpCohort.\n\nm_oviCohort = let\n  f = @formula zScore ~ 1 + Test * a1 * Sex + (1 | Cohort)\n  fit(MixedModel, f, dat; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0022\n0.0152\n-0.15\n0.8835\n0.0340\n\n\nTest: Star_r\n-0.0032\n0.0320\n-0.10\n0.9196\n\n\n\nTest: S20_r\n0.0087\n0.0319\n0.27\n0.7847\n\n\n\nTest: SLJ\n0.0045\n0.0317\n0.14\n0.8869\n\n\n\nTest: BMT\n-0.0536\n0.0316\n-1.69\n0.0903\n\n\n\na1\n0.1999\n0.0351\n5.69\n<1e-07\n\n\n\nSex: Girls\n-0.4245\n0.0201\n-21.08\n<1e-97\n\n\n\nTest: Star_r & a1\n0.3135\n0.1097\n2.86\n0.0043\n\n\n\nTest: S20_r & a1\n-0.0848\n0.1093\n-0.78\n0.4378\n\n\n\nTest: SLJ & a1\n-0.0748\n0.1086\n-0.69\n0.4910\n\n\n\nTest: BMT & a1\n0.4718\n0.1084\n4.35\n<1e-04\n\n\n\nTest: Star_r & Sex: Girls\n0.3736\n0.0640\n5.84\n<1e-08\n\n\n\nTest: S20_r & Sex: Girls\n-0.2079\n0.0638\n-3.26\n0.0011\n\n\n\nTest: SLJ & Sex: Girls\n-0.0611\n0.0634\n-0.96\n0.3356\n\n\n\nTest: BMT & Sex: Girls\n-0.2697\n0.0632\n-4.27\n<1e-04\n\n\n\na1 & Sex: Girls\n-0.1371\n0.0691\n-1.99\n0.0471\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.2022\n0.2195\n-0.92\n0.3568\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1733\n0.2187\n0.79\n0.4281\n\n\n\nTest: SLJ & a1 & Sex: Girls\n0.0051\n0.2172\n0.02\n0.9811\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1961\n0.2168\n0.90\n0.3657\n\n\n\nResidual\n0.9681\n\n\n\n\n\n\n\n\n\n\nissingular(m_oviCohort)\n\nfalse\n\n\nThis solves the problem with singularity, but does LMM m_zcpCohort fit noise relative to the LMM m_oviCohort?\n\nMixedModels.likelihoodratiotest(m_oviCohort, m_zcpCohort)\n\n\n\n\n\n\n\n\n\n\n\n\n\nmodel-dof\ndeviance\nχ²\nχ²-dof\nP(>χ²)\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + (1 | Cohort)\n22\n26803\n\n\n\n\n\nzScore ~ 1 + Test + a1 + Sex + Test & a1 + Test & Sex + a1 & Sex + Test & a1 & Sex + zerocorr(1 + Test | Cohort)\n26\n26803\n0\n4\n0.9968\n\n\n\n\n\n\ngof_summary2 = let\n  mods = [m_oviCohort, m_zcpCohort, m_cpxCohort]\n  DataFrame(;\n    dof=dof.(mods),\n    deviance=deviance.(mods),\n    AIC=aic.(mods),\n    AICc=aicc.(mods),\n    BIC=bic.(mods),\n  )\nend\n\n3×5 DataFrame\n\n\n\nRow\ndof\ndeviance\nAIC\nAICc\nBIC\n\n\n\nInt64\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\n22\n26802.9\n26846.9\n26847.0\n27004.7\n\n\n2\n26\n26802.7\n26854.7\n26854.8\n27041.3\n\n\n3\n36\n26790.5\n26862.5\n26862.7\n27120.8\n\n\n\n\n\n\nIndeed, adding VCs is fitting noise. Again, the goodness of fit statistics unanimously favor the selection of the LMM m_oviCohort.\nNot shown here, but the Cohort-related VCs for the Test contrasts could be estimated reliably for the full data. Thus, the small number of cohorts does not necessarily prevent the determination of reliable differences between tests across cohorts. What if we include VCs and CPs related to random factors Child and School?"
       },
       {
         "objectID": "fggk21.html#fitting-the-published-lmm-m1-to-the-reduced-data",
         "href": "fggk21.html#fitting-the-published-lmm-m1-to-the-reduced-data",
         "title": "Basics with Emotikon Project",
         "section": "4.6 Fitting the published LMM m1 to the reduced data",
    -    "text": "4.6 Fitting the published LMM m1 to the reduced data\n\n\n\n\n\n\nWarning\n\n\n\nThe following LMMs m1, m2, etc. take a bit longer (e.g., close to 6 minutes in the Pluto notebook, close to 3 minutes in the REPL on a MacBook Pro).\n\n\nLMM m1 reported in Fühner et al. (2021) included random factors for School, Child, and Cohort. The RES for School was specified like in LMM m_cpx. The RES for Child included VCs and CPs for Test, but not for linear developmental gain in the ninth year of life a1 or Sex; they are between-Child effects.\nThe RES for Cohort included only VCs, no CPs for Test. The parsimony was due to the small number of nine levels for this grouping factor.\nHere we fit this LMM m1 for the reduced data. For a different subset of similar size on MacBook Pro [13 | 15 | 16] this took [303 | 250 | 244 ] s; for LMM m1a (i.e., dropping 1 school-relate VC for Sex), times are [212 | 165 | 160] s. The corresponding lme4 times for LMM m1 are [397 | 348 | 195].\nFinally, times for fitting the full set of data –not in this script–, for LMM m1are [60 | 62 | 85] minutes (!); for LMM m1a the times were [46 | 48 | 34] minutes. It was not possible to fit the full set of data with lme4; after about 13 to 18 minutes the program stopped with: Error in eval_f(x, ...) : Downdated VtV is not positive definite.\n\nm1 = let\n  f = @formula(\n    zScore ~\n      1 +\n      Test * a1 * Sex +\n      (1 + Test + a1 + Sex | School) +\n      (1 + Test | Child) +\n      zerocorr(1 + Test | Cohort)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\nMinimizing 1474      Time: 0:00:19 (13.15 ms/it)\n  objective:  24651.01449586962\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\nσ_School\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0133\n0.0192\n-0.69\n0.4874\n0.5899\n0.2138\n0.0131\n\n\nTest: Star_r\n0.0089\n0.0375\n0.24\n0.8132\n0.7640\n0.3330\n0.0637\n\n\nTest: S20_r\n0.0092\n0.0292\n0.31\n0.7535\n0.6582\n0.3280\n0.0020\n\n\nTest: SLJ\n0.0034\n0.0299\n0.11\n0.9107\n0.5700\n0.3210\n0.0336\n\n\nTest: BMT\n-0.0383\n0.0296\n-1.29\n0.1954\n0.7425\n0.3128\n0.0000\n\n\na1\n0.1956\n0.0545\n3.59\n0.0003\n\n0.2826\n\n\n\nSex: Girls\n-0.4287\n0.0312\n-13.75\n<1e-42\n\n0.1438\n\n\n\nTest: Star_r & a1\n0.2897\n0.0887\n3.26\n0.0011\n\n\n\n\n\nTest: S20_r & a1\n-0.0781\n0.0817\n-0.96\n0.3394\n\n\n\n\n\nTest: SLJ & a1\n-0.0633\n0.0769\n-0.82\n0.4106\n\n\n\n\n\nTest: BMT & a1\n0.4713\n0.0852\n5.53\n<1e-07\n\n\n\n\n\nTest: Star_r & Sex: Girls\n0.3756\n0.0511\n7.35\n<1e-12\n\n\n\n\n\nTest: S20_r & Sex: Girls\n-0.1867\n0.0475\n-3.93\n<1e-04\n\n\n\n\n\nTest: SLJ & Sex: Girls\n-0.0695\n0.0445\n-1.56\n0.1183\n\n\n\n\n\nTest: BMT & Sex: Girls\n-0.2812\n0.0495\n-5.68\n<1e-07\n\n\n\n\n\na1 & Sex: Girls\n-0.1267\n0.1048\n-1.21\n0.2269\n\n\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.1382\n0.1756\n-0.79\n0.4311\n\n\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1754\n0.1633\n1.07\n0.2828\n\n\n\n\n\nTest: SLJ & a1 & Sex: Girls\n-0.0155\n0.1530\n-0.10\n0.9193\n\n\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1548\n0.1702\n0.91\n0.3630\n\n\n\n\n\nResidual\n0.5184\n\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m1)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.34801743\n0.58993002\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.58363674\n0.76396121\n+0.14\n\n\n\n\n\n\n\n\nTest: S20_r\n0.43325315\n0.65821968\n+0.00\n-0.52\n\n\n\n\n\n\n\nTest: SLJ\n0.32492588\n0.57002270\n+0.05\n-0.04\n-0.37\n\n\n\n\n\n\nTest: BMT\n0.55135686\n0.74253408\n-0.33\n+0.13\n-0.17\n-0.24\n\n\n\n\nSchool\n(Intercept)\n0.04569159\n0.21375591\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.11087441\n0.33297810\n-0.06\n\n\n\n\n\n\n\n\nTest: S20_r\n0.10760948\n0.32803884\n-0.08\n-0.39\n\n\n\n\n\n\n\nTest: SLJ\n0.10302512\n0.32097527\n-0.19\n+0.21\n-0.80\n\n\n\n\n\n\nTest: BMT\n0.09785675\n0.31282064\n-0.33\n-0.02\n+0.13\n-0.38\n\n\n\n\n\na1\n0.07988894\n0.28264632\n+0.62\n-0.20\n+0.11\n-0.61\n+0.45\n\n\n\n\nSex: Girls\n0.02068432\n0.14382046\n-0.45\n+0.45\n+0.31\n-0.27\n-0.15\n-0.37\n\n\nCohort\n(Intercept)\n0.00017292\n0.01314996\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.00405923\n0.06371208\n.\n\n\n\n\n\n\n\n\nTest: S20_r\n0.00000413\n0.00203252\n.\n.\n\n\n\n\n\n\n\nTest: SLJ\n0.00113003\n0.03361595\n.\n.\n.\n\n\n\n\n\n\nTest: BMT\n0.00000000\n0.00000000\n.\n.\n.\n.\n\n\n\n\nResidual\n\n0.26873924\n0.51840065\n\n\n\n\n\n\n\n\n\n\n\n\nissingular(m1)\n\ntrue\n\n\nDepending on the random number for stratified samplign, LMM m1 may or may not be supported by the data.\nWe also fit an alternative parameterization, estimating VCs and CPs for Test scores rather than Test effects by replacing the 1 + ... in the RE terms with 0 + ....\n\nm2 = let\n  f = @formula(\n    zScore ~\n      1 +\n      Test * a1 * Sex +\n      (0 + Test + a1 + Sex | School) +\n      (0 + Test | Child) +\n      zerocorr(0 + Test | Cohort)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\nMinimizing 1592      Time: 0:00:20 (13.02 ms/it)\n  objective:  24646.87204583089\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\nσ_School\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0136\n0.0195\n-0.70\n0.4846\n\n\n\n\n\nTest: Star_r\n0.0093\n0.0365\n0.25\n0.7988\n0.7983\n0.3103\n0.0208\n\n\nTest: S20_r\n0.0060\n0.0354\n0.17\n0.8653\n0.7689\n0.3304\n0.0563\n\n\nTest: SLJ\n0.0052\n0.0339\n0.15\n0.8786\n0.7818\n0.2476\n0.0157\n\n\nTest: BMT\n-0.0388\n0.0300\n-1.29\n0.1966\n0.6983\n0.1967\n0.0000\n\n\na1\n0.1934\n0.0545\n3.55\n0.0004\n\n0.2832\n\n\n\nSex: Girls\n-0.4290\n0.0312\n-13.75\n<1e-42\n\n0.1434\n\n\n\nTest: Star_r & a1\n0.2932\n0.0887\n3.31\n0.0009\n\n\n\n\n\nTest: S20_r & a1\n-0.1007\n0.0826\n-1.22\n0.2227\n\n\n\n\n\nTest: SLJ & a1\n-0.0456\n0.0773\n-0.59\n0.5550\n\n\n\n\n\nTest: BMT & a1\n0.4685\n0.0853\n5.50\n<1e-07\n\n\n\n\n\nTest: Star_r & Sex: Girls\n0.3759\n0.0511\n7.36\n<1e-12\n\n\n\n\n\nTest: S20_r & Sex: Girls\n-0.1892\n0.0475\n-3.98\n<1e-04\n\n\n\n\n\nTest: SLJ & Sex: Girls\n-0.0680\n0.0445\n-1.53\n0.1262\n\n\n\n\n\nTest: BMT & Sex: Girls\n-0.2815\n0.0495\n-5.68\n<1e-07\n\n\n\n\n\na1 & Sex: Girls\n-0.1262\n0.1049\n-1.20\n0.2289\n\n\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.1371\n0.1756\n-0.78\n0.4348\n\n\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1720\n0.1634\n1.05\n0.2926\n\n\n\n\n\nTest: SLJ & a1 & Sex: Girls\n-0.0125\n0.1529\n-0.08\n0.9348\n\n\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1542\n0.1702\n0.91\n0.3648\n\n\n\n\n\nTest: Run\n\n\n\n\n0.7513\n0.3701\n0.0548\n\n\nResidual\n0.5101\n\n\n\n\n\n\n\n\n\n\n\n\nissingular(m2)\n\ntrue\n\n\nDepending on the random number generator seed, the model may or may not be supported in the alternative parameterization of scores. The fixed-effects profile is not affected (see 2.8 below).\n\n\n\n\n\n\nCaution\n\n\n\nRK: The order of RE terms is critical. In formula f2 the zerocorr() term must be placed last as shown. If it is placed first, School-related and Child-related CPs are estimated/reported (?) as zero. This was not the case for formula m1. Thus, it appears to be related to the 0-intercepts in School and Child terms. Need a reprex.\n\n\n\nVarCorr(m2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nChild\nTest: Run\n0.5644446\n0.7512953\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.6372678\n0.7982906\n+0.50\n\n\n\n\n\n\n\n\nTest: S20_r\n0.5912539\n0.7689304\n+0.56\n+0.64\n\n\n\n\n\n\n\nTest: SLJ\n0.6111377\n0.7817530\n+0.55\n+0.60\n+0.72\n\n\n\n\n\n\nTest: BMT\n0.4876120\n0.6982922\n+0.19\n+0.40\n+0.37\n+0.49\n\n\n\n\nSchool\nTest: Run\n0.1369534\n0.3700721\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0962706\n0.3102750\n+0.53\n\n\n\n\n\n\n\n\nTest: S20_r\n0.1091782\n0.3304212\n+0.47\n+0.48\n\n\n\n\n\n\n\nTest: SLJ\n0.0613205\n0.2476297\n+0.47\n+0.76\n+0.41\n\n\n\n\n\n\nTest: BMT\n0.0387012\n0.1967263\n+0.15\n+0.38\n+0.18\n+0.02\n\n\n\n\n\na1\n0.0801896\n0.2831776\n+0.58\n+0.47\n+0.56\n-0.05\n+0.65\n\n\n\n\nSex: Girls\n0.0205758\n0.1434427\n-0.63\n-0.26\n+0.06\n-0.28\n-0.58\n-0.37\n\n\nCohort\nTest: Run\n0.0030051\n0.0548189\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0004342\n0.0208386\n.\n\n\n\n\n\n\n\n\nTest: S20_r\n0.0031741\n0.0563393\n.\n.\n\n\n\n\n\n\n\nTest: SLJ\n0.0002468\n0.0157111\n.\n.\n.\n\n\n\n\n\n\nTest: BMT\n0.0000000\n0.0000000\n.\n.\n.\n.\n\n\n\n\nResidual\n\n0.2601583\n0.5100571"
    +    "text": "4.6 Fitting the published LMM m1 to the reduced data\n\n\n\n\n\n\nWarning\n\n\n\nThe following LMMs m1, m2, etc. take a bit longer (e.g., close to 6 minutes in the Pluto notebook, close to 3 minutes in the REPL on a MacBook Pro).\n\n\nLMM m1 reported in Fühner et al. (2021) included random factors for School, Child, and Cohort. The RES for School was specified like in LMM m_cpx. The RES for Child included VCs and CPs for Test, but not for linear developmental gain in the ninth year of life a1 or Sex; they are between-Child effects.\nThe RES for Cohort included only VCs, no CPs for Test. The parsimony was due to the small number of nine levels for this grouping factor.\nHere we fit this LMM m1 for the reduced data. For a different subset of similar size on MacBook Pro [13 | 15 | 16] this took [303 | 250 | 244 ] s; for LMM m1a (i.e., dropping 1 school-relate VC for Sex), times are [212 | 165 | 160] s. The corresponding lme4 times for LMM m1 are [397 | 348 | 195].\nFinally, times for fitting the full set of data –not in this script–, for LMM m1are [60 | 62 | 85] minutes (!); for LMM m1a the times were [46 | 48 | 34] minutes. It was not possible to fit the full set of data with lme4; after about 13 to 18 minutes the program stopped with: Error in eval_f(x, ...) : Downdated VtV is not positive definite.\n\nm1 = let\n  f = @formula(\n    zScore ~\n      1 +\n      Test * a1 * Sex +\n      (1 + Test + a1 + Sex | School) +\n      (1 + Test | Child) +\n      zerocorr(1 + Test | Cohort)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\nMinimizing 2152      Time: 0:00:10 ( 4.81 ms/it)\n  objective:  24651.013714010696\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\nσ_School\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0133\n0.0192\n-0.69\n0.4882\n0.5851\n0.2137\n0.0133\n\n\nTest: Star_r\n0.0088\n0.0375\n0.24\n0.8134\n0.7253\n0.3329\n0.0637\n\n\nTest: S20_r\n0.0092\n0.0292\n0.31\n0.7531\n0.6129\n0.3280\n0.0000\n\n\nTest: SLJ\n0.0033\n0.0299\n0.11\n0.9109\n0.5170\n0.3212\n0.0336\n\n\nTest: BMT\n-0.0383\n0.0296\n-1.30\n0.1953\n0.7026\n0.3129\n0.0000\n\n\na1\n0.1956\n0.0544\n3.59\n0.0003\n\n0.2822\n\n\n\nSex: Girls\n-0.4287\n0.0312\n-13.75\n<1e-42\n\n0.1437\n\n\n\nTest: Star_r & a1\n0.2897\n0.0887\n3.26\n0.0011\n\n\n\n\n\nTest: S20_r & a1\n-0.0780\n0.0817\n-0.96\n0.3394\n\n\n\n\n\nTest: SLJ & a1\n-0.0633\n0.0769\n-0.82\n0.4104\n\n\n\n\n\nTest: BMT & a1\n0.4713\n0.0851\n5.54\n<1e-07\n\n\n\n\n\nTest: Star_r & Sex: Girls\n0.3756\n0.0511\n7.35\n<1e-12\n\n\n\n\n\nTest: S20_r & Sex: Girls\n-0.1867\n0.0475\n-3.93\n<1e-04\n\n\n\n\n\nTest: SLJ & Sex: Girls\n-0.0695\n0.0445\n-1.56\n0.1183\n\n\n\n\n\nTest: BMT & Sex: Girls\n-0.2812\n0.0495\n-5.68\n<1e-07\n\n\n\n\n\na1 & Sex: Girls\n-0.1266\n0.1048\n-1.21\n0.2270\n\n\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.1382\n0.1756\n-0.79\n0.4311\n\n\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1754\n0.1633\n1.07\n0.2828\n\n\n\n\n\nTest: SLJ & a1 & Sex: Girls\n-0.0155\n0.1530\n-0.10\n0.9194\n\n\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1548\n0.1702\n0.91\n0.3630\n\n\n\n\n\nResidual\n0.5455\n\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m1)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.3422958\n0.5850605\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.5260874\n0.7253188\n+0.15\n\n\n\n\n\n\n\n\nTest: S20_r\n0.3756117\n0.6128717\n+0.00\n-0.52\n\n\n\n\n\n\n\nTest: SLJ\n0.2672826\n0.5169938\n+0.05\n-0.04\n-0.34\n\n\n\n\n\n\nTest: BMT\n0.4936581\n0.7026081\n-0.36\n+0.14\n-0.20\n-0.20\n\n\n\n\nSchool\n(Intercept)\n0.0456784\n0.2137250\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.1107999\n0.3328662\n-0.06\n\n\n\n\n\n\n\n\nTest: S20_r\n0.1076039\n0.3280303\n-0.08\n-0.39\n\n\n\n\n\n\n\nTest: SLJ\n0.1031705\n0.3212016\n-0.19\n+0.21\n-0.80\n\n\n\n\n\n\nTest: BMT\n0.0979344\n0.3129448\n-0.33\n-0.02\n+0.13\n-0.38\n\n\n\n\n\na1\n0.0796529\n0.2822285\n+0.62\n-0.20\n+0.11\n-0.61\n+0.45\n\n\n\n\nSex: Girls\n0.0206632\n0.1437471\n-0.45\n+0.45\n+0.31\n-0.27\n-0.15\n-0.37\n\n\nCohort\n(Intercept)\n0.0001763\n0.0132772\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0040587\n0.0637077\n.\n\n\n\n\n\n\n\n\nTest: S20_r\n0.0000000\n0.0000000\n.\n.\n\n\n\n\n\n\n\nTest: SLJ\n0.0011272\n0.0335732\n.\n.\n.\n\n\n\n\n\n\nTest: BMT\n0.0000000\n0.0000000\n.\n.\n.\n.\n\n\n\n\nResidual\n\n0.2975465\n0.5454782\n\n\n\n\n\n\n\n\n\n\n\n\nissingular(m1)\n\ntrue\n\n\nDepending on the random number for stratified samplign, LMM m1 may or may not be supported by the data.\nWe also fit an alternative parameterization, estimating VCs and CPs for Test scores rather than Test effects by replacing the 1 + ... in the RE terms with 0 + ....\n\nm2 = let\n  f = @formula(\n    zScore ~\n      1 +\n      Test * a1 * Sex +\n      (0 + Test + a1 + Sex | School) +\n      (0 + Test | Child) +\n      zerocorr(0 + Test | Cohort)\n  )\n  fit(MixedModel, f, dat; contrasts)\nend\n\nMinimizing 1542      Time: 0:00:07 ( 4.59 ms/it)\n  objective:  24646.87196275666\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Child\nσ_School\nσ_Cohort\n\n\n\n\n(Intercept)\n-0.0136\n0.0195\n-0.70\n0.4843\n\n\n\n\n\nTest: Star_r\n0.0093\n0.0365\n0.26\n0.7987\n0.8032\n0.3103\n0.0209\n\n\nTest: S20_r\n0.0060\n0.0354\n0.17\n0.8653\n0.7740\n0.3305\n0.0563\n\n\nTest: SLJ\n0.0052\n0.0339\n0.15\n0.8787\n0.7867\n0.2478\n0.0157\n\n\nTest: BMT\n-0.0388\n0.0300\n-1.29\n0.1968\n0.7039\n0.1969\n0.0000\n\n\na1\n0.1935\n0.0545\n3.55\n0.0004\n\n0.2834\n\n\n\nSex: Girls\n-0.4290\n0.0312\n-13.75\n<1e-42\n\n0.1433\n\n\n\nTest: Star_r & a1\n0.2932\n0.0887\n3.31\n0.0009\n\n\n\n\n\nTest: S20_r & a1\n-0.1006\n0.0826\n-1.22\n0.2228\n\n\n\n\n\nTest: SLJ & a1\n-0.0456\n0.0773\n-0.59\n0.5550\n\n\n\n\n\nTest: BMT & a1\n0.4685\n0.0853\n5.50\n<1e-07\n\n\n\n\n\nTest: Star_r & Sex: Girls\n0.3759\n0.0511\n7.36\n<1e-12\n\n\n\n\n\nTest: S20_r & Sex: Girls\n-0.1892\n0.0475\n-3.98\n<1e-04\n\n\n\n\n\nTest: SLJ & Sex: Girls\n-0.0680\n0.0445\n-1.53\n0.1262\n\n\n\n\n\nTest: BMT & Sex: Girls\n-0.2815\n0.0495\n-5.68\n<1e-07\n\n\n\n\n\na1 & Sex: Girls\n-0.1262\n0.1049\n-1.20\n0.2290\n\n\n\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.1371\n0.1756\n-0.78\n0.4349\n\n\n\n\n\nTest: S20_r & a1 & Sex: Girls\n0.1720\n0.1634\n1.05\n0.2926\n\n\n\n\n\nTest: SLJ & a1 & Sex: Girls\n-0.0125\n0.1529\n-0.08\n0.9349\n\n\n\n\n\nTest: BMT & a1 & Sex: Girls\n0.1542\n0.1702\n0.91\n0.3648\n\n\n\n\n\nTest: Run\n\n\n\n\n0.7565\n0.3702\n0.0548\n\n\nResidual\n0.5023\n\n\n\n\n\n\n\n\n\n\n\n\nissingular(m2)\n\ntrue\n\n\nDepending on the random number generator seed, the model may or may not be supported in the alternative parameterization of scores. The fixed-effects profile is not affected (see 2.8 below).\n\n\n\n\n\n\nCaution\n\n\n\nRK: The order of RE terms is critical. In formula f2 the zerocorr() term must be placed last as shown. If it is placed first, School-related and Child-related CPs are estimated/reported (?) as zero. This was not the case for formula m1. Thus, it appears to be related to the 0-intercepts in School and Child terms. Need a reprex.\n\n\n\nVarCorr(m2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nChild\nTest: Run\n0.5722276\n0.7564573\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.6450573\n0.8031546\n+0.49\n\n\n\n\n\n\n\n\nTest: S20_r\n0.5990457\n0.7739804\n+0.55\n+0.63\n\n\n\n\n\n\n\nTest: SLJ\n0.6189250\n0.7867179\n+0.54\n+0.59\n+0.71\n\n\n\n\n\n\nTest: BMT\n0.4954357\n0.7038720\n+0.19\n+0.40\n+0.36\n+0.48\n\n\n\n\nSchool\nTest: Run\n0.1370581\n0.3702136\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0963082\n0.3103357\n+0.53\n\n\n\n\n\n\n\n\nTest: S20_r\n0.1092546\n0.3305368\n+0.47\n+0.48\n\n\n\n\n\n\n\nTest: SLJ\n0.0614048\n0.2478000\n+0.47\n+0.76\n+0.41\n\n\n\n\n\n\nTest: BMT\n0.0387634\n0.1968842\n+0.15\n+0.38\n+0.18\n+0.02\n\n\n\n\n\na1\n0.0803342\n0.2834328\n+0.58\n+0.47\n+0.55\n-0.05\n+0.65\n\n\n\n\nSex: Girls\n0.0205261\n0.1432692\n-0.63\n-0.27\n+0.06\n-0.28\n-0.58\n-0.37\n\n\nCohort\nTest: Run\n0.0030058\n0.0548248\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0004352\n0.0208614\n.\n\n\n\n\n\n\n\n\nTest: S20_r\n0.0031700\n0.0563024\n.\n.\n\n\n\n\n\n\n\nTest: SLJ\n0.0002462\n0.0156897\n.\n.\n.\n\n\n\n\n\n\nTest: BMT\n0.0000000\n0.0000000\n.\n.\n.\n.\n\n\n\n\nResidual\n\n0.2523132\n0.5023079"
       },
       {
         "objectID": "fggk21.html#principle-component-analysis-of-random-effect-structure-repca",
    @@ -557,7 +557,7 @@
         "href": "fggk21.html#effects-in-res",
         "title": "Basics with Emotikon Project",
         "section": "4.8 Effects in RES",
    -    "text": "4.8 Effects in RES\nFor every random factor, MixedModels.PCA() extracts as many PCs as there are VCs. Therefore, the cumulation of variance across PCs within a random factor will always add up to 100% – at the latest with the last VC, but, in the case of overparameterized LMMs, the ceiling will be reached earlier. The final PCs are usually quite small.\nPCs are extracted in the order of the amount of unique variance they account for. The first PC accounts for the largest and the final PC for the least amount of variance. The number the PCs with percent variance above a certain threshold indicates the number of weighted composites needed and reflects the dimensionality of the orthogonal space within which (almost) all the variance can be accounted for. The weights for forming composite scores are the listed loadings. For ease of interpretation it is often useful to change the sign of some composite scores.\nThe PCA for LMM m1 shows that each of the five PCs for Child accounts for a non-zero percent of unique variance.\nFor School fewer than seven PCs have unique variance. The exact number depends on sampling. The overparameterization of School might be resolved when the CPs for Sex are dropped from the LMM.\nCohort was estimated with CPs forced to zero. Therefore, the VCs were forced to be orthogonal; they already represent the PCA solution. However, depending on sampling, not all PCs may be identified for this random factor either.\nImportantly, again depending on sampling, a non-singular fit does not imply that unique variance is associated with all PCs (i.e., not for last PC for School). Embrace uncertainty!\n\nMixedModels.PCA(m1)\n\n(Child = \nPrincipal components based on correlation matrix\n (Intercept)    1.0     .      .      .      .\n Test: Star_r   0.14   1.0     .      .      .\n Test: S20_r    0.0   -0.52   1.0     .      .\n Test: SLJ      0.05  -0.04  -0.37   1.0     .\n Test: BMT     -0.33   0.13  -0.17  -0.24   1.0\n\nNormalized cumulative variances:\n[0.3284, 0.6158, 0.8283, 0.9385, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5\n (Intercept)   -0.07   0.55   0.58  -0.59  -0.02\n Test: Star_r  -0.6   -0.09   0.45   0.41   0.5\n Test: S20_r    0.71   0.02   0.15   0.05   0.69\n Test: SLJ     -0.32   0.44  -0.66  -0.21   0.47\n Test: BMT     -0.15  -0.7   -0.01  -0.65   0.24, School = \nPrincipal components based on correlation matrix\n (Intercept)    1.0     .      .      .      .      .      .\n Test: Star_r  -0.06   1.0     .      .      .      .      .\n Test: S20_r   -0.08  -0.39   1.0     .      .      .      .\n Test: SLJ     -0.19   0.21  -0.8    1.0     .      .      .\n Test: BMT     -0.33  -0.02   0.13  -0.38   1.0     .      .\n a1             0.62  -0.2    0.11  -0.61   0.45   1.0     .\n Sex: Girls    -0.45   0.45   0.31  -0.27  -0.15  -0.37   1.0\n\nNormalized cumulative variances:\n[0.3564, 0.6346, 0.8055, 0.9685, 1.0, 1.0, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5    PC6    PC7\n (Intercept)   -0.25  -0.49  -0.4   -0.38   0.18   0.54   0.25\n Test: Star_r   0.31   0.12   0.2   -0.75   0.47  -0.25  -0.08\n Test: S20_r   -0.4    0.44  -0.32   0.19   0.52  -0.26   0.41\n Test: SLJ      0.55  -0.31   0.1    0.2    0.03  -0.16   0.73\n Test: BMT     -0.29   0.14   0.79   0.03   0.16   0.43   0.25\n a1            -0.52  -0.27   0.17  -0.31  -0.41  -0.55   0.24\n Sex: Girls     0.14   0.6   -0.18  -0.35  -0.53   0.25   0.35, Cohort = \nPrincipal components based on correlation matrix\n (Intercept)   1.0  .    .    .    .\n Test: Star_r  0.0  1.0  .    .    .\n Test: S20_r   0.0  0.0  1.0  .    .\n Test: SLJ     0.0  0.0  0.0  1.0  .\n Test: BMT     0.0  0.0  0.0  0.0  0.0\n\nNormalized cumulative variances:\n[0.25, 0.5, 0.75, 1.0, 1.0]\n\nComponent loadings\n                PC1   PC2   PC3   PC4     PC5\n (Intercept)   1.0   0.0   0.0   0.0     0.0\n Test: Star_r  0.0   1.0   0.0   0.0     0.0\n Test: S20_r   0.0   0.0   0.0   1.0     0.0\n Test: SLJ     0.0   0.0   1.0   0.0     0.0\n Test: BMT     0.0   0.0   0.0   0.0   NaN)\n\n\n\n4.8.1 Scores in RES\nNow lets looks at the PCA results for the alternative parameterization of LMM m2. It is important to note that the reparameterization to base estimates of VCs and CPs on scores rather than effects applies only to the Test factor (i.e., the first factor in the formula); VCs for Sex and age refer to the associated effects.\nDepending on sampling, the difference between LMM m1 and LMM m2 may show that overparameterization according to PCs may depend on the specification chosen for the other the random-effect structure.\n\n\n\n\n\n\nNote\n\n\n\nFor the complete data, all PCs had unique variance associated with them.\n\n\n\nMixedModels.PCA(m2)\n\n(Child = \nPrincipal components based on correlation matrix\n Test: Run     1.0    .     .     .     .\n Test: Star_r  0.5   1.0    .     .     .\n Test: S20_r   0.56  0.64  1.0    .     .\n Test: SLJ     0.55  0.6   0.72  1.0    .\n Test: BMT     0.19  0.4   0.37  0.49  1.0\n\nNormalized cumulative variances:\n[0.6101, 0.7756, 0.8667, 0.948, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5\n Test: Run     -0.42   0.53   0.63   0.37   0.08\n Test: Star_r  -0.47   0.03  -0.65   0.58  -0.16\n Test: S20_r   -0.49   0.15  -0.24  -0.49   0.66\n Test: SLJ     -0.5   -0.05   0.09  -0.5   -0.7\n Test: BMT     -0.34  -0.83   0.33   0.2    0.2, School = \nPrincipal components based on correlation matrix\n Test: Run      1.0     .      .      .      .      .      .\n Test: Star_r   0.53   1.0     .      .      .      .      .\n Test: S20_r    0.47   0.48   1.0     .      .      .      .\n Test: SLJ      0.47   0.76   0.41   1.0     .      .      .\n Test: BMT      0.15   0.38   0.18   0.02   1.0     .      .\n a1             0.58   0.47   0.56  -0.05   0.65   1.0     .\n Sex: Girls    -0.63  -0.26   0.06  -0.28  -0.58  -0.37   1.0\n\nNormalized cumulative variances:\n[0.4822, 0.694, 0.8509, 0.9554, 1.0, 1.0, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5    PC6    PC7\n Test: Run     -0.44   0.08   0.15  -0.64  -0.16   0.56   0.17\n Test: Star_r  -0.44   0.28   0.02   0.41  -0.56   0.06  -0.49\n Test: S20_r   -0.34   0.27  -0.58  -0.11   0.6   -0.0   -0.32\n Test: SLJ     -0.32   0.56   0.33   0.25   0.22  -0.24   0.55\n Test: BMT     -0.32  -0.53  -0.02   0.55   0.25   0.46   0.21\n a1            -0.41  -0.35  -0.42  -0.14  -0.33  -0.53   0.35\n Sex: Girls     0.34   0.35  -0.59   0.18  -0.29   0.37   0.4, Cohort = \nPrincipal components based on correlation matrix\n Test: Run     1.0  .    .    .    .\n Test: Star_r  0.0  1.0  .    .    .\n Test: S20_r   0.0  0.0  1.0  .    .\n Test: SLJ     0.0  0.0  0.0  1.0  .\n Test: BMT     0.0  0.0  0.0  0.0  0.0\n\nNormalized cumulative variances:\n[0.25, 0.5, 0.75, 1.0, 1.0]\n\nComponent loadings\n                PC1   PC2   PC3   PC4     PC5\n Test: Run     1.0   0.0   0.0   0.0     0.0\n Test: Star_r  0.0   1.0   0.0   0.0     0.0\n Test: S20_r   0.0   0.0   1.0   0.0     0.0\n Test: SLJ     0.0   0.0   0.0   1.0     0.0\n Test: BMT     0.0   0.0   0.0   0.0   NaN)"
    +    "text": "4.8 Effects in RES\nFor every random factor, MixedModels.PCA() extracts as many PCs as there are VCs. Therefore, the cumulation of variance across PCs within a random factor will always add up to 100% – at the latest with the last VC, but, in the case of overparameterized LMMs, the ceiling will be reached earlier. The final PCs are usually quite small.\nPCs are extracted in the order of the amount of unique variance they account for. The first PC accounts for the largest and the final PC for the least amount of variance. The number the PCs with percent variance above a certain threshold indicates the number of weighted composites needed and reflects the dimensionality of the orthogonal space within which (almost) all the variance can be accounted for. The weights for forming composite scores are the listed loadings. For ease of interpretation it is often useful to change the sign of some composite scores.\nThe PCA for LMM m1 shows that each of the five PCs for Child accounts for a non-zero percent of unique variance.\nFor School fewer than seven PCs have unique variance. The exact number depends on sampling. The overparameterization of School might be resolved when the CPs for Sex are dropped from the LMM.\nCohort was estimated with CPs forced to zero. Therefore, the VCs were forced to be orthogonal; they already represent the PCA solution. However, depending on sampling, not all PCs may be identified for this random factor either.\nImportantly, again depending on sampling, a non-singular fit does not imply that unique variance is associated with all PCs (i.e., not for last PC for School). Embrace uncertainty!\n\nMixedModels.PCA(m1)\n\n(Child = \nPrincipal components based on correlation matrix\n (Intercept)    1.0     .      .      .     .\n Test: Star_r   0.15   1.0     .      .     .\n Test: S20_r    0.0   -0.52   1.0     .     .\n Test: SLJ      0.05  -0.04  -0.34   1.0    .\n Test: BMT     -0.36   0.14  -0.2   -0.2   1.0\n\nNormalized cumulative variances:\n[0.3297, 0.6164, 0.8287, 0.9358, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5\n (Intercept)   -0.02   0.6    0.51   0.61   0.04\n Test: Star_r  -0.61   0.02   0.45  -0.37  -0.53\n Test: S20_r    0.7   -0.06   0.15   0.01  -0.69\n Test: SLJ     -0.25   0.43  -0.72   0.2   -0.45\n Test: BMT     -0.26  -0.67  -0.0    0.67  -0.2, School = \nPrincipal components based on correlation matrix\n (Intercept)    1.0     .      .      .      .      .      .\n Test: Star_r  -0.06   1.0     .      .      .      .      .\n Test: S20_r   -0.08  -0.39   1.0     .      .      .      .\n Test: SLJ     -0.19   0.21  -0.8    1.0     .      .      .\n Test: BMT     -0.33  -0.02   0.13  -0.38   1.0     .      .\n a1             0.62  -0.2    0.11  -0.61   0.45   1.0     .\n Sex: Girls    -0.45   0.45   0.31  -0.27  -0.15  -0.37   1.0\n\nNormalized cumulative variances:\n[0.3569, 0.635, 0.8057, 0.9686, 1.0, 1.0, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5    PC6    PC7\n (Intercept)   -0.25  -0.49  -0.42  -0.36   0.18   0.52  -0.28\n Test: Star_r   0.31   0.12   0.16  -0.76   0.47  -0.21   0.16\n Test: S20_r   -0.4    0.44  -0.31   0.21   0.52   0.17   0.45\n Test: SLJ      0.55  -0.31   0.11   0.19   0.03   0.49   0.56\n Test: BMT     -0.29   0.14   0.79  -0.0    0.15   0.46  -0.2\n a1            -0.52  -0.27   0.16  -0.32  -0.41  -0.14   0.59\n Sex: Girls     0.14   0.6   -0.2   -0.34  -0.53   0.43   0.0, Cohort = \nPrincipal components based on correlation matrix\n (Intercept)   1.0  .    .    .    .\n Test: Star_r  0.0  1.0  .    .    .\n Test: S20_r   0.0  0.0  0.0  .    .\n Test: SLJ     0.0  0.0  0.0  1.0  .\n Test: BMT     0.0  0.0  0.0  0.0  0.0\n\nNormalized cumulative variances:\n[0.3333, 0.6667, 1.0, 1.0, 1.0]\n\nComponent loadings\n                PC1   PC2   PC3     PC4     PC5\n (Intercept)   1.0   0.0   0.0     0.0     0.0\n Test: Star_r  0.0   1.0   0.0     0.0     0.0\n Test: S20_r   0.0   0.0   0.0   NaN       0.0\n Test: SLJ     0.0   0.0   1.0     0.0     0.0\n Test: BMT     0.0   0.0   0.0     0.0   NaN)\n\n\n\n4.8.1 Scores in RES\nNow lets looks at the PCA results for the alternative parameterization of LMM m2. It is important to note that the reparameterization to base estimates of VCs and CPs on scores rather than effects applies only to the Test factor (i.e., the first factor in the formula); VCs for Sex and age refer to the associated effects.\nDepending on sampling, the difference between LMM m1 and LMM m2 may show that overparameterization according to PCs may depend on the specification chosen for the other the random-effect structure.\n\n\n\n\n\n\nNote\n\n\n\nFor the complete data, all PCs had unique variance associated with them.\n\n\n\nMixedModels.PCA(m2)\n\n(Child = \nPrincipal components based on correlation matrix\n Test: Run     1.0    .     .     .     .\n Test: Star_r  0.49  1.0    .     .     .\n Test: S20_r   0.55  0.63  1.0    .     .\n Test: SLJ     0.54  0.59  0.71  1.0    .\n Test: BMT     0.19  0.4   0.36  0.48  1.0\n\nNormalized cumulative variances:\n[0.6047, 0.7707, 0.8633, 0.9461, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5\n Test: Run     -0.42   0.53   0.64   0.37   0.08\n Test: Star_r  -0.47   0.03  -0.64   0.58  -0.16\n Test: S20_r   -0.49   0.15  -0.25  -0.49   0.66\n Test: SLJ     -0.5   -0.05   0.09  -0.5   -0.7\n Test: BMT     -0.34  -0.83   0.34   0.19   0.2, School = \nPrincipal components based on correlation matrix\n Test: Run      1.0     .      .      .      .      .      .\n Test: Star_r   0.53   1.0     .      .      .      .      .\n Test: S20_r    0.47   0.48   1.0     .      .      .      .\n Test: SLJ      0.47   0.76   0.41   1.0     .      .      .\n Test: BMT      0.15   0.38   0.18   0.02   1.0     .      .\n a1             0.58   0.47   0.55  -0.05   0.65   1.0     .\n Sex: Girls    -0.63  -0.27   0.06  -0.28  -0.58  -0.37   1.0\n\nNormalized cumulative variances:\n[0.482, 0.6937, 0.8507, 0.9553, 1.0, 1.0, 1.0]\n\nComponent loadings\n                 PC1    PC2    PC3    PC4    PC5    PC6    PC7\n Test: Run     -0.44   0.08   0.15  -0.64  -0.16  -0.51   0.29\n Test: Star_r  -0.44   0.28   0.02   0.41  -0.56   0.31   0.38\n Test: S20_r   -0.34   0.27  -0.58  -0.1    0.6    0.24   0.21\n Test: SLJ     -0.32   0.56   0.33   0.25   0.22  -0.23  -0.55\n Test: BMT     -0.32  -0.53  -0.02   0.55   0.25  -0.47   0.19\n a1            -0.41  -0.35  -0.42  -0.14  -0.33   0.11  -0.62\n Sex: Girls     0.34   0.35  -0.59   0.18  -0.29  -0.55   0.0, Cohort = \nPrincipal components based on correlation matrix\n Test: Run     1.0  .    .    .    .\n Test: Star_r  0.0  1.0  .    .    .\n Test: S20_r   0.0  0.0  1.0  .    .\n Test: SLJ     0.0  0.0  0.0  1.0  .\n Test: BMT     0.0  0.0  0.0  0.0  0.0\n\nNormalized cumulative variances:\n[0.25, 0.5, 0.75, 1.0, 1.0]\n\nComponent loadings\n                PC1   PC2   PC3   PC4     PC5\n Test: Run     1.0   0.0   0.0   0.0     0.0\n Test: Star_r  0.0   1.0   0.0   0.0     0.0\n Test: S20_r   0.0   0.0   0.0   1.0     0.0\n Test: SLJ     0.0   0.0   1.0   0.0     0.0\n Test: BMT     0.0   0.0   0.0   0.0   NaN)"
       },
       {
         "objectID": "fggk21.html#summary-of-results-for-stratified-subset-of-data",
    @@ -571,28 +571,28 @@
         "href": "fggk21.html#overall-summary-statistics",
         "title": "Basics with Emotikon Project",
         "section": "6.1 Overall summary statistics",
    -    "text": "6.1 Overall summary statistics\n+ julia> m1.optsum         # MixedModels.OptSummary:  gets all info\n+ julia> loglikelihood(m1) # StatsBase.loglikelihood: return loglikelihood\n                             of the model\n+ julia> deviance(m1)      # StatsBase.deviance: negative twice the log-likelihood\n                             relative to saturated model\n+ julia> objective(m1)     # MixedModels.objective: saturated model not clear:\n                             negative twice the log-likelihood\n+ julia> nobs(m1)          # n of observations; they are not independent\n+ julia> dof(m1)           # n of degrees of freedom is number of model parameters\n+ julia> aic(m1)           # objective(m1) + 2*dof(m1)\n+ julia> bic(m1)           # objective(m1) + dof(m1)*log(nobs(m1))\n\nm1.optsum            # MixedModels.OptSummary:  gets all info\n\n\n\n\n\n\n\n\nInitialization\n\n\n\nInitial parameter vector\n[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]\n\n\nInitial objective value\n25840.65375540981\n\n\nOptimizer settings\n\n\n\nOptimizer (from NLopt)\nLN_BOBYQA\n\n\nLower bounds\n[0.0, -Inf, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, 0.0, -Inf, 0.0, 0.0, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, 0.0, -Inf, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]\n\n\nftol_rel\n1.0e-12\n\n\nftol_abs\n1.0e-8\n\n\nxtol_rel\n0.0\n\n\nxtol_abs\n[1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10]\n\n\ninitial_step\n[0.75, 1.0, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 0.75, 1.0, 0.75, 0.75, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 0.75, 1.0, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75]\n\n\nmaxfeval\n-1\n\n\nmaxtime\n-1.0\n\n\nResult\n\n\n\nFunction evaluations\n1473\n\n\nFinal parameter vector\n[1.138, 0.2048, 0.0008, 0.0502, -0.4783, 1.4594, -0.6667, -0.0489, 0.2519, 1.0806, -0.5036, -0.1341, 0.975, -0.4254, 1.2492, 0.4123, -0.0382, -0.0482, -0.1148, -0.2013, 0.3377, -0.1245, 0.6412, -0.2524, 0.1239, -0.0249, -0.0896, 0.1169, 0.5783, -0.5004, 0.0587, 0.0528, 0.1349, 0.3231, -0.4144, -0.3978, -0.026, 0.3845, 0.1184, -0.1701, 0.0125, -0.0043, 0.0014, 0.0254, 0.1229, 0.0039, 0.0648, 0.0]\n\n\nFinal objective value\n24651.0145\n\n\nReturn code\nFTOL_REACHED\n\n\n\n\n\n\nloglikelihood(m1) # StatsBase.loglikelihood: return loglikelihood of the model\n\n-12325.50724793481\n\n\n\ndeviance(m1)      # StatsBase.deviance: negative twice the log-likelihood relative to saturated mode`\n\n24651.01449586962\n\n\n\nobjective(m1)    # MixedModels.objective: saturated model not clear: negative twice the log-likelihood\n\n24651.01449586962\n\n\n\nnobs(m1) # n of observations; they are not independent\n\n9663\n\n\n\nn_, p_, q_, k_ = size(m1)\n\n(9663, 20, 13076, 3)\n\n\n\ndof(m1)  # n of degrees of freedom is number of model parameters\n\n69\n\n\n\ngeom_df = sum(leverage(m1)) # trace of hat / rank of model matrix / geom dof\n\n5672.4491657979415\n\n\n\nresid_df = nobs(m1) - geom_df  # eff. residual degrees of freedom\n\n3990.5508342020585\n\n\n\naic(m1)  # objective(m1) + 2*dof(m1)\n\n24789.01449586962\n\n\n\nbic(m1)  # objective(m1) + dof(m1)*log(nobs(m1))\n\n25284.16259709157"
    +    "text": "6.1 Overall summary statistics\n+ julia> m1.optsum         # MixedModels.OptSummary:  gets all info\n+ julia> loglikelihood(m1) # StatsBase.loglikelihood: return loglikelihood\n                             of the model\n+ julia> deviance(m1)      # StatsBase.deviance: negative twice the log-likelihood\n                             relative to saturated model\n+ julia> objective(m1)     # MixedModels.objective: saturated model not clear:\n                             negative twice the log-likelihood\n+ julia> nobs(m1)          # n of observations; they are not independent\n+ julia> dof(m1)           # n of degrees of freedom is number of model parameters\n+ julia> aic(m1)           # objective(m1) + 2*dof(m1)\n+ julia> bic(m1)           # objective(m1) + dof(m1)*log(nobs(m1))\n\nm1.optsum            # MixedModels.OptSummary:  gets all info\n\n\n\n\n\n\n\n\nInitialization\n\n\n\nInitial parameter vector\n[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]\n\n\nInitial objective value\n25840.653755409716\n\n\nOptimizer settings\n\n\n\nOptimizer (from NLopt)\nLN_BOBYQA\n\n\nLower bounds\n[0.0, -Inf, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, 0.0, -Inf, 0.0, 0.0, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, -Inf, 0.0, -Inf, -Inf, 0.0, -Inf, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]\n\n\nftol_rel\n1.0e-12\n\n\nftol_abs\n1.0e-8\n\n\nxtol_rel\n0.0\n\n\nxtol_abs\n[1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10, 1.0e-10]\n\n\ninitial_step\n[0.75, 1.0, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 0.75, 1.0, 0.75, 0.75, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 1.0, 0.75, 1.0, 1.0, 0.75, 1.0, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75]\n\n\nmaxfeval\n-1\n\n\nmaxtime\n-1.0\n\n\nResult\n\n\n\nFunction evaluations\n2151\n\n\nFinal parameter vector\n[1.0726, 0.196, 0.0007, 0.0483, -0.4584, 1.3152, -0.5947, -0.0492, 0.2535, 0.9533, -0.4134, -0.1382, 0.8501, -0.3203, 1.1238, 0.3918, -0.0359, -0.0457, -0.1096, -0.1911, 0.3216, -0.1179, 0.6092, -0.2396, 0.1182, -0.0241, -0.0863, 0.1109, 0.5497, -0.4762, 0.0564, 0.0506, 0.1283, 0.3066, -0.3949, -0.3767, -0.024, 0.3646, 0.1113, -0.1619, 0.0, 0.0, 0.0, 0.0243, 0.1168, 0.0, 0.0615, 0.0]\n\n\nFinal objective value\n24651.0137\n\n\nReturn code\nFTOL_REACHED\n\n\n\n\n\n\nloglikelihood(m1) # StatsBase.loglikelihood: return loglikelihood of the model\n\n-12325.506857005348\n\n\n\ndeviance(m1)      # StatsBase.deviance: negative twice the log-likelihood relative to saturated mode`\n\n24651.013714010696\n\n\n\nobjective(m1)    # MixedModels.objective: saturated model not clear: negative twice the log-likelihood\n\n24651.013714010696\n\n\n\nnobs(m1) # n of observations; they are not independent\n\n9663\n\n\n\nn_, p_, q_, k_ = size(m1)\n\n(9663, 20, 13076, 3)\n\n\n\ndof(m1)  # n of degrees of freedom is number of model parameters\n\n69\n\n\n\ngeom_df = sum(leverage(m1)) # trace of hat / rank of model matrix / geom dof\n\n5244.700177018742\n\n\n\nresid_df = nobs(m1) - geom_df  # eff. residual degrees of freedom\n\n4418.299822981258\n\n\n\naic(m1)  # objective(m1) + 2*dof(m1)\n\n24789.013714010696\n\n\n\nbic(m1)  # objective(m1) + dof(m1)*log(nobs(m1))\n\n25284.16181523265"
       },
       {
         "objectID": "fggk21.html#fixed-effect-statistics",
         "href": "fggk21.html#fixed-effect-statistics",
         "title": "Basics with Emotikon Project",
         "section": "6.2 Fixed-effect statistics",
    -    "text": "6.2 Fixed-effect statistics\n+ julia> coeftable(m1)     # StatsBase.coeftable: fixed-effects statiscs;\n                             default level=0.95\n+ julia> Arrow.write(\"./data/m_cpx_fe.arrow\", DataFrame(coeftable(m1)));\n+ julia> coef(m1)          # StatsBase.coef - parts of the table\n+ julia> fixef(m1)         # MixedModels.fixef: not the same as coef()\n                             for rank-deficient case\n+ julia> m1.beta           # alternative extractor\n+ julia> fixefnames(m1)    # works also for coefnames(m1)\n+ julia> vcov(m1)          # StatsBase.vcov: var-cov matrix of fixed-effects coef.\n+ julia> stderror(m1)      # StatsBase.stderror: SE for fixed-effects coefficients\n+ julia> propertynames(m1) # names of available extractors\n\ncoeftable(m1) # StatsBase.coeftable: fixed-effects statiscs; default level=0.95\n\n\n\n\n\n\n\n\n\n\n\n\nCoef.\nStd. Error\nz\nPr(>\n\n\n\n\n(Intercept)\n-0.0133264\n0.0191908\n-0.69\n0.4874\n\n\nTest: Star_r\n0.00885446\n0.0374649\n0.24\n0.8132\n\n\nTest: S20_r\n0.00915936\n0.0291725\n0.31\n0.7535\n\n\nTest: SLJ\n0.00335426\n0.0299082\n0.11\n0.9107\n\n\nTest: BMT\n-0.0382894\n0.0295702\n-1.29\n0.1954\n\n\na1\n0.19562\n0.0544531\n3.59\n0.0003\n\n\nSex: Girls\n-0.428736\n0.0311862\n-13.75\n<1e-42\n\n\nTest: Star_r & a1\n0.289674\n0.0887445\n3.26\n0.0011\n\n\nTest: S20_r & a1\n-0.0780511\n0.0816905\n-0.96\n0.3394\n\n\nTest: SLJ & a1\n-0.063263\n0.0768824\n-0.82\n0.4106\n\n\nTest: BMT & a1\n0.471289\n0.0851509\n5.53\n<1e-07\n\n\nTest: Star_r & Sex: Girls\n0.375595\n0.0510834\n7.35\n<1e-12\n\n\nTest: S20_r & Sex: Girls\n-0.186708\n0.0475115\n-3.93\n<1e-04\n\n\nTest: SLJ & Sex: Girls\n-0.0695301\n0.0445173\n-1.56\n0.1183\n\n\nTest: BMT & Sex: Girls\n-0.281236\n0.0495213\n-5.68\n<1e-07\n\n\na1 & Sex: Girls\n-0.126678\n0.104825\n-1.21\n0.2269\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.138238\n0.175581\n-0.79\n0.4311\n\n\nTest: S20_r & a1 & Sex: Girls\n0.175422\n0.163343\n1.07\n0.2828\n\n\nTest: SLJ & a1 & Sex: Girls\n-0.0154911\n0.152984\n-0.10\n0.9193\n\n\nTest: BMT & a1 & Sex: Girls\n0.154795\n0.170159\n0.91\n0.3630\n\n\n\n\n\n\n#Arrow.write(\"./data/m_cpx_fe.arrow\", DataFrame(coeftable(m1)));\n\n\ncoef(m1)              # StatsBase.coef; parts of the table\n\n20-element Vector{Float64}:\n -0.013326418174543895\n  0.008854455767991822\n  0.009159355804501768\n  0.0033542600278063522\n -0.0382894498810129\n  0.19562037117168546\n -0.4287359064726347\n  0.2896737283700021\n -0.07805107265519066\n -0.06326301586054563\n  0.47128946887343964\n  0.37559463121941\n -0.18670827473612425\n -0.06953014822894996\n -0.2812361916524132\n -0.1266782570629409\n -0.13823832011459883\n  0.1754219065821277\n -0.015491064668230801\n  0.1547945432078642\n\n\n\nfixef(m1)    # MixedModels.fixef: not the same as coef() for rank-deficient case\n\n20-element Vector{Float64}:\n -0.013326418174543895\n  0.008854455767991822\n  0.009159355804501768\n  0.0033542600278063522\n -0.0382894498810129\n  0.19562037117168546\n -0.4287359064726347\n  0.2896737283700021\n -0.07805107265519066\n -0.06326301586054563\n  0.47128946887343964\n  0.37559463121941\n -0.18670827473612425\n -0.06953014822894996\n -0.2812361916524132\n -0.1266782570629409\n -0.13823832011459883\n  0.1754219065821277\n -0.015491064668230801\n  0.1547945432078642\n\n\n\nm1.β                  # alternative extractor\n\n20-element Vector{Float64}:\n -0.013326418174543895\n  0.008854455767991822\n  0.009159355804501768\n  0.0033542600278063522\n -0.0382894498810129\n  0.19562037117168546\n -0.4287359064726347\n  0.2896737283700021\n -0.07805107265519066\n -0.06326301586054563\n  0.47128946887343964\n  0.37559463121941\n -0.18670827473612425\n -0.06953014822894996\n -0.2812361916524132\n -0.1266782570629409\n -0.13823832011459883\n  0.1754219065821277\n -0.015491064668230801\n  0.1547945432078642\n\n\n\nfixefnames(m1)        # works also for coefnames(m1)\n\n20-element Vector{String}:\n \"(Intercept)\"\n \"Test: Star_r\"\n \"Test: S20_r\"\n \"Test: SLJ\"\n \"Test: BMT\"\n \"a1\"\n \"Sex: Girls\"\n \"Test: Star_r & a1\"\n \"Test: S20_r & a1\"\n \"Test: SLJ & a1\"\n \"Test: BMT & a1\"\n \"Test: Star_r & Sex: Girls\"\n \"Test: S20_r & Sex: Girls\"\n \"Test: SLJ & Sex: Girls\"\n \"Test: BMT & Sex: Girls\"\n \"a1 & Sex: Girls\"\n \"Test: Star_r & a1 & Sex: Girls\"\n \"Test: S20_r & a1 & Sex: Girls\"\n \"Test: SLJ & a1 & Sex: Girls\"\n \"Test: BMT & a1 & Sex: Girls\"\n\n\n\nvcov(m1)   # StatsBase.vcov: var-cov matrix of fixed-effects coefficients\n\n20×20 Matrix{Float64}:\n  0.000368288   2.44834e-5   -1.71765e-5   …   3.89507e-6    2.86399e-6\n  2.44834e-5    0.00140362   -0.000421413     -9.25565e-7   -1.05427e-7\n -1.71765e-5   -0.000421413   0.000851032      2.05425e-5   -6.89378e-7\n -2.68157e-5    5.43469e-5   -0.000468208     -2.4403e-5     1.36724e-6\n -0.000143255   3.25955e-5   -8.0956e-6        1.40951e-6   -1.19346e-5\n -4.45442e-5   -7.39539e-5    2.71186e-5   …  -6.03726e-5   -5.07707e-5\n -4.4393e-5     6.34994e-5    4.35402e-5      -7.3791e-5     0.000282454\n -2.72933e-5   -0.000442556   0.000212958      8.7071e-6     2.62752e-6\n  3.39758e-6    0.000213337  -0.000395714     -0.00010435    8.17628e-6\n -2.00038e-5    6.88797e-8    0.000175398      0.000158855  -6.10943e-5\n  7.30797e-5   -2.67185e-5    2.85748e-5   …  -5.78095e-5    8.26953e-5\n  6.91142e-6    8.70957e-7   -2.05397e-6       8.63739e-6   -0.000108162\n  5.11841e-6   -1.95496e-6    7.66359e-6       0.000673899   0.000117963\n -5.24346e-6   -1.56019e-6   -4.65511e-6      -0.00136393    0.000576546\n -1.12612e-6    6.33588e-7   -9.0277e-7        0.000577209  -0.00171459\n -4.55233e-6   -1.20844e-5    3.61454e-7   …   0.000151279  -0.0039188\n -1.28132e-5   -2.83547e-5    2.85268e-5      -0.000138513   0.00179136\n  4.97663e-7    2.85838e-5   -4.69381e-5      -0.0115833    -0.00195403\n  3.89507e-6   -9.25565e-7    2.05425e-5       0.0234041    -0.00998137\n  2.86399e-6   -1.05427e-7   -6.89378e-7      -0.00998137    0.028954\n\n\n\nvcov(m1; corr=true) # StatsBase.vcov: correlation matrix of fixed-effects coefficients\n\n20×20 Matrix{Float64}:\n  1.0           0.0340528    -0.0306808    …   0.00132671    0.000877047\n  0.0340528     1.0          -0.385576        -0.000161486  -1.65376e-5\n -0.0306808    -0.385576      1.0              0.00460293   -0.000138877\n -0.0467202     0.0485019    -0.53663         -0.00533341    0.000268658\n -0.252442      0.0294224    -0.00938471       0.000311577  -0.00237191\n -0.042626     -0.0362505     0.0170715    …  -0.00724721   -0.00547944\n -0.0741752     0.0543479     0.0478581       -0.0154666     0.0532268\n -0.0160258    -0.133107      0.0822583        0.000641336   0.000174001\n  0.00216723    0.069706     -0.166049        -0.00834977    0.000588207\n -0.0135579     2.39133e-5    0.0782035        0.013506     -0.00467003\n  0.0447212    -0.00837526    0.0115033    …  -0.00443776    0.00570739\n  0.00705007    0.000455085  -0.0013783        0.00110524   -0.0124435\n  0.00561361   -0.00109828    0.00552918       0.0927148     0.0145913\n -0.00613755   -0.000935458  -0.00358449      -0.20027       0.0761115\n -0.00118495    0.0003415    -0.000624902      0.0761894    -0.203476\n -0.00226294   -0.00307704    0.000118199  …   0.00943335   -0.219701\n -0.00380265   -0.00431046    0.00556933      -0.00515665    0.0599587\n  0.00015876    0.00467083   -0.00985034      -0.463536     -0.0703032\n  0.00132671   -0.000161486   0.00460293       1.0          -0.383433\n  0.000877047  -1.65376e-5   -0.000138877     -0.383433      1.0\n\n\n\nstderror(m1)       # StatsBase.stderror: SE for fixed-effects coefficients\n\n20-element Vector{Float64}:\n 0.019190838609013373\n 0.037464904374354346\n 0.029172457183929874\n 0.029908246837066204\n 0.029570247247537502\n 0.05445314275453583\n 0.03118620045393219\n 0.08874454325857666\n 0.08169050540658983\n 0.07688237996024007\n 0.08515085655609324\n 0.05108338328710162\n 0.047511503910903\n 0.0445173183865237\n 0.049521334150376524\n 0.10482540178954916\n 0.17558064233009524\n 0.16334323024815908\n 0.15298414940873858\n 0.17015877736759646\n\n\n\npropertynames(m1)  # names of available extractors\n\n(:formula, :reterms, :Xymat, :feterm, :sqrtwts, :parmap, :dims, :A, :L, :optsum, :θ, :theta, :β, :beta, :βs, :betas, :λ, :lambda, :stderror, :σ, :sigma, :σs, :sigmas, :σρs, :sigmarhos, :b, :u, :lowerbd, :X, :y, :corr, :vcov, :PCA, :rePCA, :objective, :pvalues)"
    +    "text": "6.2 Fixed-effect statistics\n+ julia> coeftable(m1)     # StatsBase.coeftable: fixed-effects statiscs;\n                             default level=0.95\n+ julia> Arrow.write(\"./data/m_cpx_fe.arrow\", DataFrame(coeftable(m1)));\n+ julia> coef(m1)          # StatsBase.coef - parts of the table\n+ julia> fixef(m1)         # MixedModels.fixef: not the same as coef()\n                             for rank-deficient case\n+ julia> m1.beta           # alternative extractor\n+ julia> fixefnames(m1)    # works also for coefnames(m1)\n+ julia> vcov(m1)          # StatsBase.vcov: var-cov matrix of fixed-effects coef.\n+ julia> stderror(m1)      # StatsBase.stderror: SE for fixed-effects coefficients\n+ julia> propertynames(m1) # names of available extractors\n\ncoeftable(m1) # StatsBase.coeftable: fixed-effects statiscs; default level=0.95\n\n\n\n\n\n\n\n\n\n\n\n\nCoef.\nStd. Error\nz\nPr(>\n\n\n\n\n(Intercept)\n-0.0133092\n0.0191999\n-0.69\n0.4882\n\n\nTest: Star_r\n0.00884113\n0.0374617\n0.24\n0.8134\n\n\nTest: S20_r\n0.00917301\n0.0291635\n0.31\n0.7531\n\n\nTest: SLJ\n0.00334797\n0.0299089\n0.11\n0.9109\n\n\nTest: BMT\n-0.0382976\n0.0295732\n-1.30\n0.1953\n\n\na1\n0.195573\n0.0544492\n3.59\n0.0003\n\n\nSex: Girls\n-0.428741\n0.0311857\n-13.75\n<1e-42\n\n\nTest: Star_r & a1\n0.289688\n0.0887452\n3.26\n0.0011\n\n\nTest: S20_r & a1\n-0.0780346\n0.0816864\n-0.96\n0.3394\n\n\nTest: SLJ & a1\n-0.0632862\n0.0768821\n-0.82\n0.4104\n\n\nTest: BMT & a1\n0.471318\n0.0851493\n5.54\n<1e-07\n\n\nTest: Star_r & Sex: Girls\n0.375598\n0.051084\n7.35\n<1e-12\n\n\nTest: S20_r & Sex: Girls\n-0.186709\n0.0475103\n-3.93\n<1e-04\n\n\nTest: SLJ & Sex: Girls\n-0.0695248\n0.0445175\n-1.56\n0.1183\n\n\nTest: BMT & Sex: Girls\n-0.281233\n0.0495203\n-5.68\n<1e-07\n\n\na1 & Sex: Girls\n-0.126646\n0.104826\n-1.21\n0.2270\n\n\nTest: Star_r & a1 & Sex: Girls\n-0.138246\n0.175582\n-0.79\n0.4311\n\n\nTest: S20_r & a1 & Sex: Girls\n0.175448\n0.163339\n1.07\n0.2828\n\n\nTest: SLJ & a1 & Sex: Girls\n-0.0154784\n0.152985\n-0.10\n0.9194\n\n\nTest: BMT & a1 & Sex: Girls\n0.154771\n0.170156\n0.91\n0.3630\n\n\n\n\n\n\n#Arrow.write(\"./data/m_cpx_fe.arrow\", DataFrame(coeftable(m1)));\n\n\ncoef(m1)              # StatsBase.coef; parts of the table\n\n20-element Vector{Float64}:\n -0.013309175931007876\n  0.00884112861200947\n  0.009173006549207096\n  0.003347970943295056\n -0.03829755605578145\n  0.19557310478621426\n -0.42874120698907664\n  0.2896877613212633\n -0.078034593399739\n -0.06328624835977936\n  0.47131815525118237\n  0.3755983491272838\n -0.18670886099513845\n -0.06952475419310636\n -0.28123278216333797\n -0.12664594944222246\n -0.1382464788399039\n  0.17544785757028258\n -0.015478369943662399\n  0.15477149991315636\n\n\n\nfixef(m1)    # MixedModels.fixef: not the same as coef() for rank-deficient case\n\n20-element Vector{Float64}:\n -0.013309175931007876\n  0.00884112861200947\n  0.009173006549207096\n  0.003347970943295056\n -0.03829755605578145\n  0.19557310478621426\n -0.42874120698907664\n  0.2896877613212633\n -0.078034593399739\n -0.06328624835977936\n  0.47131815525118237\n  0.3755983491272838\n -0.18670886099513845\n -0.06952475419310636\n -0.28123278216333797\n -0.12664594944222246\n -0.1382464788399039\n  0.17544785757028258\n -0.015478369943662399\n  0.15477149991315636\n\n\n\nm1.β                  # alternative extractor\n\n20-element Vector{Float64}:\n -0.013309175931007876\n  0.00884112861200947\n  0.009173006549207096\n  0.003347970943295056\n -0.03829755605578145\n  0.19557310478621426\n -0.42874120698907664\n  0.2896877613212633\n -0.078034593399739\n -0.06328624835977936\n  0.47131815525118237\n  0.3755983491272838\n -0.18670886099513845\n -0.06952475419310636\n -0.28123278216333797\n -0.12664594944222246\n -0.1382464788399039\n  0.17544785757028258\n -0.015478369943662399\n  0.15477149991315636\n\n\n\nfixefnames(m1)        # works also for coefnames(m1)\n\n20-element Vector{String}:\n \"(Intercept)\"\n \"Test: Star_r\"\n \"Test: S20_r\"\n \"Test: SLJ\"\n \"Test: BMT\"\n \"a1\"\n \"Sex: Girls\"\n \"Test: Star_r & a1\"\n \"Test: S20_r & a1\"\n \"Test: SLJ & a1\"\n \"Test: BMT & a1\"\n \"Test: Star_r & Sex: Girls\"\n \"Test: S20_r & Sex: Girls\"\n \"Test: SLJ & Sex: Girls\"\n \"Test: BMT & Sex: Girls\"\n \"a1 & Sex: Girls\"\n \"Test: Star_r & a1 & Sex: Girls\"\n \"Test: S20_r & a1 & Sex: Girls\"\n \"Test: SLJ & a1 & Sex: Girls\"\n \"Test: BMT & a1 & Sex: Girls\"\n\n\n\nvcov(m1)   # StatsBase.vcov: var-cov matrix of fixed-effects coefficients\n\n20×20 Matrix{Float64}:\n  0.000368635   2.45792e-5   -1.71701e-5   …   3.89162e-6    2.86536e-6\n  2.45792e-5    0.00140338   -0.000421256     -9.25828e-7   -1.01803e-7\n -1.71701e-5   -0.000421256   0.000850508      2.05407e-5   -6.94443e-7\n -2.69531e-5    5.44958e-5   -0.000468487     -2.44026e-5    1.37399e-6\n -0.000143158   3.23114e-5   -7.73605e-6       1.42228e-6   -1.1939e-5\n -4.43036e-5   -7.44531e-5    2.75121e-5   …  -6.02434e-5   -5.10277e-5\n -4.42495e-5    6.33177e-5    4.36646e-5      -7.38279e-5    0.000282193\n -2.73321e-5   -0.000442566   0.000212961      8.73037e-6    2.58046e-6\n  3.44344e-6    0.000213339  -0.000395718     -0.000104391   8.2411e-6\n -2.00104e-5    6.84757e-8    0.00017538       0.000158887  -6.11795e-5\n  7.30063e-5   -2.66966e-5    2.85523e-5   …  -5.78951e-5    8.27559e-5\n  6.8883e-6     8.75889e-7   -2.05673e-6       8.64112e-6   -0.000108103\n  5.13543e-6   -1.95673e-6    7.6624e-6        0.000673791   0.000117897\n -5.22672e-6   -1.56384e-6   -4.64923e-6      -0.00136393    0.00057671\n -1.15216e-6    6.37557e-7   -9.07973e-7       0.000577376  -0.00171451\n -4.58987e-6   -1.2076e-5     3.53589e-7   …   0.000152721  -0.00391891\n -1.28113e-5   -2.83483e-5    2.85153e-5      -0.000138431   0.00179013\n  4.95604e-7    2.85708e-5   -4.69151e-5      -0.0115817    -0.00195263\n  3.89162e-6   -9.25828e-7    2.05407e-5       0.0234045    -0.00998454\n  2.86536e-6   -1.01803e-7   -6.94443e-7      -0.00998454    0.0289529\n\n\n\nvcov(m1; corr=true) # StatsBase.vcov: correlation matrix of fixed-effects coefficients\n\n20×20 Matrix{Float64}:\n  1.0           0.034173     -0.0306645    …   0.0013249     0.00087707\n  0.034173      1.0          -0.385585        -0.000161545  -1.59708e-5\n -0.0306645    -0.385585      1.0              0.00460389   -0.000139943\n -0.0469365     0.0486379    -0.537103        -0.00533317    0.000269982\n -0.252126      0.0291655    -0.00896978       0.000314368  -0.0023726\n -0.0423789    -0.036501      0.0173258    …  -0.00723216   -0.00550768\n -0.0739018     0.054198      0.0480103       -0.0154745     0.0531796\n -0.0160409    -0.133121      0.082284         0.00064304    0.000170886\n  0.00219556    0.0697161    -0.16611         -0.00835342    0.000592911\n -0.013556      2.37752e-5    0.0782197        0.0135086    -0.00467665\n  0.0446562    -0.00836926    0.011498     …  -0.00444438    0.00571178\n  0.00702311    0.000457696  -0.00138056       0.0011057    -0.0124367\n  0.00562978   -0.0010994     0.00553017       0.0927017     0.0145838\n -0.00611506   -0.000937725  -0.00358105      -0.200268      0.0761344\n -0.0012118     0.000343676  -0.00062871       0.0762125    -0.203475\n -0.00228051   -0.00307513    0.000115661  …   0.00952306   -0.219709\n -0.00380026   -0.00430982    0.00556876      -0.00515349    0.059918\n  0.000158033   0.00466925   -0.00984883      -0.463483     -0.0702561\n  0.0013249    -0.000161545   0.00460389       1.0          -0.383559\n  0.00087707   -1.59708e-5   -0.000139943     -0.383559      1.0\n\n\n\nstderror(m1)       # StatsBase.stderror: SE for fixed-effects coefficients\n\n20-element Vector{Float64}:\n 0.019199856900105894\n 0.03746166680712168\n 0.0291634720215121\n 0.029908947317869982\n 0.02957320203560786\n 0.054449180355270105\n 0.031185689283858727\n 0.0887451746553604\n 0.08168636248556593\n 0.07688213791581955\n 0.08514931328708582\n 0.05108399545794252\n 0.0475102604276537\n 0.04451750030660286\n 0.049520299057707835\n 0.1048264966769763\n 0.17558244602551348\n 0.16333872136135616\n 0.1529853565566417\n 0.17015555631913265\n\n\n\npropertynames(m1)  # names of available extractors\n\n(:formula, :reterms, :Xymat, :feterm, :sqrtwts, :parmap, :dims, :A, :L, :optsum, :θ, :theta, :β, :beta, :βs, :betas, :λ, :lambda, :stderror, :σ, :sigma, :σs, :sigmas, :σρs, :sigmarhos, :b, :u, :lowerbd, :X, :y, :corr, :vcov, :PCA, :rePCA, :objective, :pvalues)"
       },
       {
         "objectID": "fggk21.html#covariance-parameter-estimates",
         "href": "fggk21.html#covariance-parameter-estimates",
         "title": "Basics with Emotikon Project",
         "section": "6.3 Covariance parameter estimates",
    -    "text": "6.3 Covariance parameter estimates\nThese commands inform us about the model parameters associated with the RES.\n+ julia> issingular(m1)        # Test singularity for param. vector m1.theta\n+ julia> VarCorr(m1)           # MixedModels.VarCorr: est. of RES\n+ julia> propertynames(m1)\n+ julia> m1.σ                  # residual; or: m1.sigma\n+ julia> m1.σs                 # VCs; m1.sigmas\n+ julia> m1.θ                  # Parameter vector for RES (w/o residual); m1.theta\n+ julia> MixedModels.sdest(m1) #  prsqrt(MixedModels.varest(m1))\n+ julia> BlockDescription(m1)  #  Description of blocks of A and L in an LMM\n\nissingular(m1) # Test if model is singular for paramter vector m1.theta (default)\n\ntrue\n\n\n\nissingular(m2)\n\ntrue\n\n\n\nVarCorr(m1) # MixedModels.VarCorr: estimates of random-effect structure (RES)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.34801743\n0.58993002\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.58363674\n0.76396121\n+0.14\n\n\n\n\n\n\n\n\nTest: S20_r\n0.43325315\n0.65821968\n+0.00\n-0.52\n\n\n\n\n\n\n\nTest: SLJ\n0.32492588\n0.57002270\n+0.05\n-0.04\n-0.37\n\n\n\n\n\n\nTest: BMT\n0.55135686\n0.74253408\n-0.33\n+0.13\n-0.17\n-0.24\n\n\n\n\nSchool\n(Intercept)\n0.04569159\n0.21375591\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.11087441\n0.33297810\n-0.06\n\n\n\n\n\n\n\n\nTest: S20_r\n0.10760948\n0.32803884\n-0.08\n-0.39\n\n\n\n\n\n\n\nTest: SLJ\n0.10302512\n0.32097527\n-0.19\n+0.21\n-0.80\n\n\n\n\n\n\nTest: BMT\n0.09785675\n0.31282064\n-0.33\n-0.02\n+0.13\n-0.38\n\n\n\n\n\na1\n0.07988894\n0.28264632\n+0.62\n-0.20\n+0.11\n-0.61\n+0.45\n\n\n\n\nSex: Girls\n0.02068432\n0.14382046\n-0.45\n+0.45\n+0.31\n-0.27\n-0.15\n-0.37\n\n\nCohort\n(Intercept)\n0.00017292\n0.01314996\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.00405923\n0.06371208\n.\n\n\n\n\n\n\n\n\nTest: S20_r\n0.00000413\n0.00203252\n.\n.\n\n\n\n\n\n\n\nTest: SLJ\n0.00113003\n0.03361595\n.\n.\n.\n\n\n\n\n\n\nTest: BMT\n0.00000000\n0.00000000\n.\n.\n.\n.\n\n\n\n\nResidual\n\n0.26873924\n0.51840065\n\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nChild\nTest: Run\n0.5644446\n0.7512953\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.6372678\n0.7982906\n+0.50\n\n\n\n\n\n\n\n\nTest: S20_r\n0.5912539\n0.7689304\n+0.56\n+0.64\n\n\n\n\n\n\n\nTest: SLJ\n0.6111377\n0.7817530\n+0.55\n+0.60\n+0.72\n\n\n\n\n\n\nTest: BMT\n0.4876120\n0.6982922\n+0.19\n+0.40\n+0.37\n+0.49\n\n\n\n\nSchool\nTest: Run\n0.1369534\n0.3700721\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0962706\n0.3102750\n+0.53\n\n\n\n\n\n\n\n\nTest: S20_r\n0.1091782\n0.3304212\n+0.47\n+0.48\n\n\n\n\n\n\n\nTest: SLJ\n0.0613205\n0.2476297\n+0.47\n+0.76\n+0.41\n\n\n\n\n\n\nTest: BMT\n0.0387012\n0.1967263\n+0.15\n+0.38\n+0.18\n+0.02\n\n\n\n\n\na1\n0.0801896\n0.2831776\n+0.58\n+0.47\n+0.56\n-0.05\n+0.65\n\n\n\n\nSex: Girls\n0.0205758\n0.1434427\n-0.63\n-0.26\n+0.06\n-0.28\n-0.58\n-0.37\n\n\nCohort\nTest: Run\n0.0030051\n0.0548189\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0004342\n0.0208386\n.\n\n\n\n\n\n\n\n\nTest: S20_r\n0.0031741\n0.0563393\n.\n.\n\n\n\n\n\n\n\nTest: SLJ\n0.0002468\n0.0157111\n.\n.\n.\n\n\n\n\n\n\nTest: BMT\n0.0000000\n0.0000000\n.\n.\n.\n.\n\n\n\n\nResidual\n\n0.2601583\n0.5100571\n\n\n\n\n\n\n\n\n\n\n\n\nm1.σs      # VCs; m1.sigmas\n\n(Child = (var\"(Intercept)\" = 0.5899300186248844, var\"Test: Star_r\" = 0.7639612133604953, var\"Test: S20_r\" = 0.658219681909202, var\"Test: SLJ\" = 0.5700227005978211, var\"Test: BMT\" = 0.7425340800812925), School = (var\"(Intercept)\" = 0.2137559056537366, var\"Test: Star_r\" = 0.3329780987761621, var\"Test: S20_r\" = 0.32803884473380984, var\"Test: SLJ\" = 0.32097526864411674, var\"Test: BMT\" = 0.3128206391932548, a1 = 0.28264632412497126, var\"Sex: Girls\" = 0.1438204597464808), Cohort = (var\"(Intercept)\" = 0.01314995621094276, var\"Test: Star_r\" = 0.06371208452229353, var\"Test: S20_r\" = 0.0020325210658427655, var\"Test: SLJ\" = 0.033615946290033144, var\"Test: BMT\" = 0.0))\n\n\n\nm1.θ       # Parameter vector for RES (w/o residual); m1.theta\n\n48-element Vector{Float64}:\n  1.1379808578187787\n  0.20482472350757436\n  0.0007568290993343182\n  0.05015862559035548\n -0.4783254792649123\n  1.4593852782675234\n -0.6667351473232765\n -0.048914305923583076\n  0.25189121887326976\n  1.080570675334367\n -0.5035583662207958\n -0.13405062065481124\n  0.9749848348297896\n  ⋮\n -0.025980202240427883\n  0.3845066623098876\n  0.11840626932751377\n -0.17005358340233095\n  0.012474158221657745\n -0.004267430792190249\n  0.0013652913404655612\n  0.025366395973694892\n  0.12290124304422674\n  0.003920753297880955\n  0.06484549385144353\n  0.0\n\n\n\nBlockDescription(m1) #  Description of blocks of A and L in a LinearMixedModel\n\n\n\n\nrows\nChild\nSchool\nCohort\nfixed\n\n\n\n\n9930\nBlkDiag\n\n\n\n\n\n3101\nSparse\nBlkDiag\n\n\n\n\n45\nDense\nDense\nBlkDiag/Dense\n\n\n\n21\nDense\nDense\nDense\nDense\n\n\n\n\n\n\nm2.θ\n\n48-element Vector{Float64}:\n  1.4729630067266388\n  0.7839590288563076\n  0.8442929134851123\n  0.8452773250238744\n  0.2646810066793581\n  1.354602147671133\n  0.6180607446857718\n  0.5707171082255509\n  0.4816688045536064\n  1.0852834447526913\n  0.547179574617927\n  0.21671488326108312\n  1.0047299268364405\n  ⋮\n -0.01805876323213624\n  0.31935406501511093\n  0.14056642217397697\n -0.18722520941287563\n  0.0019409804824588209\n -0.000854702979588228\n  0.0\n  0.1074759722955535\n  0.0408553982374923\n  0.11045685078823214\n  0.03080253323285869\n  0.0\n\n\n\nBlockDescription(m2)\n\n\n\n\nrows\nChild\nSchool\nCohort\nfixed\n\n\n\n\n9930\nBlkDiag\n\n\n\n\n\n3101\nSparse\nBlkDiag\n\n\n\n\n45\nDense\nDense\nBlkDiag/Dense\n\n\n\n21\nDense\nDense\nDense\nDense"
    +    "text": "6.3 Covariance parameter estimates\nThese commands inform us about the model parameters associated with the RES.\n+ julia> issingular(m1)        # Test singularity for param. vector m1.theta\n+ julia> VarCorr(m1)           # MixedModels.VarCorr: est. of RES\n+ julia> propertynames(m1)\n+ julia> m1.σ                  # residual; or: m1.sigma\n+ julia> m1.σs                 # VCs; m1.sigmas\n+ julia> m1.θ                  # Parameter vector for RES (w/o residual); m1.theta\n+ julia> MixedModels.sdest(m1) #  prsqrt(MixedModels.varest(m1))\n+ julia> BlockDescription(m1)  #  Description of blocks of A and L in an LMM\n\nissingular(m1) # Test if model is singular for paramter vector m1.theta (default)\n\ntrue\n\n\n\nissingular(m2)\n\ntrue\n\n\n\nVarCorr(m1) # MixedModels.VarCorr: estimates of random-effect structure (RES)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nChild\n(Intercept)\n0.3422958\n0.5850605\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.5260874\n0.7253188\n+0.15\n\n\n\n\n\n\n\n\nTest: S20_r\n0.3756117\n0.6128717\n+0.00\n-0.52\n\n\n\n\n\n\n\nTest: SLJ\n0.2672826\n0.5169938\n+0.05\n-0.04\n-0.34\n\n\n\n\n\n\nTest: BMT\n0.4936581\n0.7026081\n-0.36\n+0.14\n-0.20\n-0.20\n\n\n\n\nSchool\n(Intercept)\n0.0456784\n0.2137250\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.1107999\n0.3328662\n-0.06\n\n\n\n\n\n\n\n\nTest: S20_r\n0.1076039\n0.3280303\n-0.08\n-0.39\n\n\n\n\n\n\n\nTest: SLJ\n0.1031705\n0.3212016\n-0.19\n+0.21\n-0.80\n\n\n\n\n\n\nTest: BMT\n0.0979344\n0.3129448\n-0.33\n-0.02\n+0.13\n-0.38\n\n\n\n\n\na1\n0.0796529\n0.2822285\n+0.62\n-0.20\n+0.11\n-0.61\n+0.45\n\n\n\n\nSex: Girls\n0.0206632\n0.1437471\n-0.45\n+0.45\n+0.31\n-0.27\n-0.15\n-0.37\n\n\nCohort\n(Intercept)\n0.0001763\n0.0132772\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0040587\n0.0637077\n.\n\n\n\n\n\n\n\n\nTest: S20_r\n0.0000000\n0.0000000\n.\n.\n\n\n\n\n\n\n\nTest: SLJ\n0.0011272\n0.0335732\n.\n.\n.\n\n\n\n\n\n\nTest: BMT\n0.0000000\n0.0000000\n.\n.\n.\n.\n\n\n\n\nResidual\n\n0.2975465\n0.5454782\n\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\n\n\n\nChild\nTest: Run\n0.5722276\n0.7564573\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.6450573\n0.8031546\n+0.49\n\n\n\n\n\n\n\n\nTest: S20_r\n0.5990457\n0.7739804\n+0.55\n+0.63\n\n\n\n\n\n\n\nTest: SLJ\n0.6189250\n0.7867179\n+0.54\n+0.59\n+0.71\n\n\n\n\n\n\nTest: BMT\n0.4954357\n0.7038720\n+0.19\n+0.40\n+0.36\n+0.48\n\n\n\n\nSchool\nTest: Run\n0.1370581\n0.3702136\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0963082\n0.3103357\n+0.53\n\n\n\n\n\n\n\n\nTest: S20_r\n0.1092546\n0.3305368\n+0.47\n+0.48\n\n\n\n\n\n\n\nTest: SLJ\n0.0614048\n0.2478000\n+0.47\n+0.76\n+0.41\n\n\n\n\n\n\nTest: BMT\n0.0387634\n0.1968842\n+0.15\n+0.38\n+0.18\n+0.02\n\n\n\n\n\na1\n0.0803342\n0.2834328\n+0.58\n+0.47\n+0.55\n-0.05\n+0.65\n\n\n\n\nSex: Girls\n0.0205261\n0.1432692\n-0.63\n-0.27\n+0.06\n-0.28\n-0.58\n-0.37\n\n\nCohort\nTest: Run\n0.0030058\n0.0548248\n\n\n\n\n\n\n\n\n\nTest: Star_r\n0.0004352\n0.0208614\n.\n\n\n\n\n\n\n\n\nTest: S20_r\n0.0031700\n0.0563024\n.\n.\n\n\n\n\n\n\n\nTest: SLJ\n0.0002462\n0.0156897\n.\n.\n.\n\n\n\n\n\n\nTest: BMT\n0.0000000\n0.0000000\n.\n.\n.\n.\n\n\n\n\nResidual\n\n0.2523132\n0.5023079\n\n\n\n\n\n\n\n\n\n\n\n\nm1.σs      # VCs; m1.sigmas\n\n(Child = (var\"(Intercept)\" = 0.5850605295025836, var\"Test: Star_r\" = 0.7253188065638198, var\"Test: S20_r\" = 0.6128717020395804, var\"Test: SLJ\" = 0.5169937634418259, var\"Test: BMT\" = 0.7026080781925507), School = (var\"(Intercept)\" = 0.21372500397332667, var\"Test: Star_r\" = 0.3328662239048804, var\"Test: S20_r\" = 0.3280303277926459, var\"Test: SLJ\" = 0.3212016485032966, var\"Test: BMT\" = 0.312944787528044, a1 = 0.28222848702543474, var\"Sex: Girls\" = 0.14374708257478697), Cohort = (var\"(Intercept)\" = 0.01327721959958815, var\"Test: Star_r\" = 0.06370771186220402, var\"Test: S20_r\" = 0.0, var\"Test: SLJ\" = 0.0335731510538704, var\"Test: BMT\" = 0.0))\n\n\n\nm1.θ       # Parameter vector for RES (w/o residual); m1.theta\n\n48-element Vector{Float64}:\n  1.0725644087519248\n  0.19603180335365766\n  0.0006989707030939914\n  0.048333431339522906\n -0.45839575693772194\n  1.3151639159086943\n -0.5946817820228019\n -0.049231396991185894\n  0.25348341383697526\n  0.9532660805560547\n -0.4133954465348457\n -0.13824892384562082\n  0.8500780627596318\n  ⋮\n -0.024015280472054038\n  0.3645599408853215\n  0.1112553236698039\n -0.16186296476512113\n  0.0\n  4.864135018349436e-5\n  0.0\n  0.02434051259928456\n  0.1167924015734189\n  0.0\n  0.06154810501513169\n  0.0\n\n\n\nBlockDescription(m1) #  Description of blocks of A and L in a LinearMixedModel\n\n\n\n\nrows\nChild\nSchool\nCohort\nfixed\n\n\n\n\n9930\nBlkDiag\n\n\n\n\n\n3101\nSparse\nBlkDiag\n\n\n\n\n45\nDense\nDense\nBlkDiag/Dense\n\n\n\n21\nDense\nDense\nDense\nDense\n\n\n\n\n\n\nm2.θ\n\n48-element Vector{Float64}:\n  1.5059633241479313\n  0.7905595422264238\n  0.8513448636718977\n  0.8523314504015871\n  0.2669578812727323\n  1.3898162197833863\n  0.6278115977313309\n  0.5801729564758269\n  0.4859928477625174\n  1.1203923373435258\n  0.5549188422789274\n  0.22081924327455182\n  1.0401914264607808\n  ⋮\n -0.017697745938997193\n  0.3245991574690091\n  0.13984259294964374\n -0.1895823320774014\n  0.0\n  0.00012735254024911713\n  0.0\n  0.10914584187734602\n  0.041531173878651656\n  0.11208744802603994\n  0.031235131302801183\n  0.0\n\n\n\nBlockDescription(m2)\n\n\n\n\nrows\nChild\nSchool\nCohort\nfixed\n\n\n\n\n9930\nBlkDiag\n\n\n\n\n\n3101\nSparse\nBlkDiag\n\n\n\n\n45\nDense\nDense\nBlkDiag/Dense\n\n\n\n21\nDense\nDense\nDense\nDense"
       },
       {
         "objectID": "fggk21.html#model-predictions",
         "href": "fggk21.html#model-predictions",
         "title": "Basics with Emotikon Project",
         "section": "6.4 Model “predictions”",
    -    "text": "6.4 Model “predictions”\nThese commands inform us about extracion of conditional modes/means and (co-)variances, that using the model parameters to improve the predictions for units (levels) of the grouping (random) factors. We need this information, e.g., for partial-effect response profiles (e.g., facet plot) or effect profiles (e.g., caterpillar plot), or visualizing the borrowing-strength effect for correlation parameters (e.g., shrinkage plots). We are using the fit of LMM m2.\njulia> condVar(m2)\nSome plotting functions are currently available from the MixedModelsMakie package or via custom functions.\n+ julia> caterpillar!(m2)\n+ julia> shrinkage!(m2)\n\n6.4.1 Conditional covariances\n\ncondVar(m1)\n\n3-element Vector{Array{Float64, 3}}:\n [0.05646046092775441 0.008741087080492059 … 0.0031541310120115004 -0.021366492030079107; 0.008741087080492059 0.2898070743228609 … -0.007395273870692747 0.02373863963471936; … ; 0.0031541310120115004 -0.007395273870692747 … 0.20511454245689775 -0.08320864426004519; -0.021366492030079107 0.02373863963471936 … -0.08320864426004519 0.2621984696751095;;; 0.06282981191597331 0.010873340067507205 … 0.003911304320141656 -0.028546511341588685; 0.010873340067507205 0.29888738083442257 … -0.005906595669994303 0.024370676194331312; … ; 0.003911304320141656 -0.005906595669994303 … 0.20895499475382556 -0.08406553259629664; -0.028546511341588685 0.024370676194331312 … -0.08406553259629664 0.27184758398121617;;; 0.05998897485888433 0.01007026807161604 … 0.0032319545291463526 -0.025312045521883212; 0.01007026807161604 0.2940394670641541 … -0.006817553888102131 0.023795082138195707; … ; 0.0032319545291463526 -0.006817553888102131 … 0.2078092502139327 -0.08344591293042244; -0.025312045521883212 0.023795082138195707 … -0.08344591293042244 0.26738308073259914;;; … ;;; 0.0911642999173916 0.01076609564325965 … -0.005637609554982028 -0.023662455633272725; 0.01076609564325965 0.29665063424015253 … -0.007332917065768334 0.025074183712715036; … ; -0.005637609554982028 -0.007332917065768334 … 0.20700327578177205 -0.08137850941302857; -0.023662455633272725 0.025074183712715036 … -0.08137850941302857 0.2673185912381177;;; 0.09758767655129515 0.008244537154902042 … -0.0010354836383137042 -0.022662590984633135; 0.008244537154902042 0.29316657183773565 … -0.007558444051222894 0.02545529557164294; … ; -0.0010354836383137042 -0.007558444051222894 … 0.20636024095767308 -0.08204002021725448; -0.022662590984633135 0.02545529557164294 … -0.08204002021725448 0.2643140589320666;;; 0.08427902904823857 0.008137131089769597 … -5.448343803071856e-5 -0.01908570180944885; 0.008137131089769597 0.2903404218730588 … -0.0077630785771130115 0.024937151640092022; … ; -5.448343803071856e-5 -0.0077630785771130115 … 0.20514228601518525 -0.08223816422128372; -0.01908570180944885 0.024937151640092022 … -0.08223816422128372 0.2613879265256324]\n [0.037382661325217725 -0.0018051470792949033 … 0.029940911136657724 -0.01244345223719613; -0.0018051470792949033 0.09051215264208363 … -0.012244610563499873 0.017439875521624456; … ; 0.029940911136657724 -0.012244610563499873 … 0.06558800966167774 -0.012746513247199394; -0.01244345223719613 0.017439875521624456 … -0.012746513247199394 0.018352311028304123;;; 0.03217464671591924 0.00019909974801327407 … 0.02627029742637268 -0.010660132285994132; 0.00019909974801327407 0.07639620696704796 … -0.007615472878529819 0.014245884411538212; … ; 0.02627029742637268 -0.007615472878529819 … 0.057429424799467686 -0.010752601438413252; -0.010660132285994132 0.014245884411538212 … -0.010752601438413252 0.015916025259580583;;; 0.02931773029899377 -0.00318202484369497 … 0.021529371207791897 -0.010468735783714597; -0.00318202484369497 0.0877854372242869 … -0.013135551350890045 0.018155944442391866; … ; 0.021529371207791897 -0.013135551350890045 … 0.05185205623812096 -0.01035444832586628; -0.010468735783714597 0.018155944442391866 … -0.01035444832586628 0.016797747820827533;;; … ;;; 0.026752946917134604 0.0028930880769873213 … 0.01903100884665739 -0.006858818931875681; 0.0028930880769873213 0.07613947167907514 … -0.005487860383599791 0.012942351267027008; … ; 0.01903100884665739 -0.005487860383599791 … 0.05093403107631236 -0.006102052856935498; -0.006858818931875681 0.012942351267027008 … -0.006102052856935498 0.013722354630431572;;; 0.027218597898895663 0.0035105914941084113 … 0.02031450027310185 -0.006162818466481287; 0.0035105914941084113 0.07605736439573893 … -0.004958713622938641 0.012639471135981264; … ; 0.02031450027310185 -0.004958713622938641 … 0.05307335906565115 -0.006292276029352733; -0.006162818466481287 0.012639471135981264 … -0.006292276029352733 0.013744887928746738;;; 0.043329326310117225 -0.003077486069647413 … 0.03639152682395296 -0.013665784308341528; -0.003077486069647413 0.09944879336028199 … -0.014990671654062395 0.01920040229893295; … ; 0.03639152682395296 -0.014990671654062395 … 0.07512799464195363 -0.014346672368784442; -0.013665784308341528 0.01920040229893295 … -0.014346672368784442 0.019529046292703082]\n [0.0001624893302946822 6.809276760802604e-6 … -4.6917226461083115e-6 0.0; 6.809276760802604e-6 0.002350815403225895 … -0.00015352131411632052 0.0; … ; -4.6917226461083115e-6 -0.00015352131411632052 … 0.000851482182428563 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015913802081720684 8.636268905937163e-6 … -5.971228600979366e-6 0.0; 8.636268905937163e-6 0.0020370776713334775 … -0.00016803507630411106 0.0; … ; -5.971228600979366e-6 -0.00016803507630411106 … 0.0007841967975071386 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016107332729719428 7.517372519491449e-6 … -5.10400306824662e-6 0.0; 7.517372519491449e-6 0.0022348773520284035 … -0.00015922539038549057 0.0; … ; -5.10400306824662e-6 -0.00015922539038549057 … 0.0008237973652566612 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016046986147184554 8.294439488860557e-6 … -5.42301575559805e-6 0.0; 8.294439488860557e-6 0.0021568108017217787 … -0.0001637977537184879 0.0; … ; -5.42301575559805e-6 -0.0001637977537184879 … 0.0008119432272028718 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001580856198253438 8.548764514673167e-6 … -6.842906693187147e-6 0.0; 8.548764514673167e-6 0.0019544407667465287 … -0.00016998440973049989 0.0; … ; -6.842906693187147e-6 -0.00016998440973049989 … 0.000763281290146378 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015732346828528415 7.309910180796245e-6 … -7.278918997664716e-6 0.0; 7.309910180796245e-6 0.0019259339350955339 … -0.00016887030366421503 0.0; … ; -7.278918997664716e-6 -0.00016887030366421503 … 0.0007463694625123178 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001593872289661442 7.892011292068771e-6 … -6.353962391643299e-6 0.0; 7.892011292068771e-6 0.002069851138743824 … -0.00016756307945140484 0.0; … ; -6.353962391643299e-6 -0.00016756307945140484 … 0.0007884351701505988 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015708408471662314 8.323399337044809e-6 … -7.845522431501192e-6 0.0; 8.323399337044809e-6 0.0018808801004042105 … -0.00017392113057051914 0.0; … ; -7.845522431501192e-6 -0.00017392113057051914 … 0.0007429208051915409 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015529524243854123 9.604794249145802e-6 … -7.639791823552067e-6 0.0; 9.604794249145802e-6 0.0017804671632761467 … -0.0001735958331640202 0.0; … ; -7.639791823552067e-6 -0.0001735958331640202 … 0.0007169963867619168 0.0; 0.0 0.0 … 0.0 0.0]\n\n\n\ncondVar(m2)\n\n3-element Vector{Array{Float64, 3}}:\n [0.17090827908394837 0.027262026576516135 … 0.03380346024298022 -0.00725898477697015; 0.027262026576516135 0.17362860841886468 … 0.03725760536477991 0.018606919834712306; … ; 0.03380346024298022 0.03725760536477991 … 0.16027831963262387 0.028396673886695065; -0.00725898477697015 0.018606919834712306 … 0.028396673886695065 0.16044266373295085;;; 0.18217266813532992 0.03403215638194173 … 0.04110909046910593 -0.009203498970715065; 0.03403215638194173 0.1854807112555363 … 0.0484535420768501 0.021145389994612112; … ; 0.04110909046910593 0.0484535420768501 … 0.17270612527308093 0.03080503422943898; -0.009203498970715065 0.021145389994612112 … 0.03080503422943898 0.1628999798226587;;; 0.17598207538028804 0.030839707406116214 … 0.037829209453142054 -0.008027447928738635; 0.030839707406116214 0.18017131892730673 … 0.04329994145914574 0.019886266952541386; … ; 0.037829209453142054 0.04329994145914574 … 0.16700723694482034 0.029647017101376034; -0.008027447928738635 0.019886266952541386 … 0.029647017101376034 0.16162269221670272;;; … ;;; 0.2173727394927963 0.07077417442793549 … 0.0671331561164205 0.021622197935503698; 0.07077417442793549 0.22137583323754262 … 0.07253677420131632 0.05084345335238386; … ; 0.0671331561164205 0.07253677420131632 … 0.18357724232380448 0.05024789366648706; 0.021622197935503698 0.05084345335238386 … 0.05024789366648706 0.18615473888535655;;; 0.22427545347433642 0.07760416492591914 … 0.0766739573301095 0.03241003430210565; 0.07760416492591914 0.22447630154317874 … 0.07866285848857124 0.05862485650015413; … ; 0.0766739573301095 0.07866285848857124 … 0.19229940149864155 0.06063971394271496; 0.03241003430210565 0.05862485650015413 … 0.06063971394271496 0.1950709514513498;;; 0.20604841432017237 0.06133280233274787 … 0.06198644244541778 0.02228070633700272; 0.06133280233274787 0.2071819423793147 … 0.0637708267715584 0.04774655852993967; … ; 0.06198644244541778 0.0637708267715584 … 0.1791596515000308 0.051377608691885325; 0.02228070633700272 0.04774655852993967 … 0.051377608691885325 0.18669597320366366]\n [0.10762625120838518 0.04838303958232419 … 0.0477193367718641 -0.027746475219333506; 0.04838303958232419 0.07948773455156048 … 0.0348982189813234 -0.010275451351059854; … ; 0.0477193367718641 0.0348982189813234 … 0.06571253141716403 -0.012819964751108165; -0.027746475219333506 -0.010275451351059854 … -0.012819964751108165 0.018249001379576288;;; 0.08786705405494342 0.04038394833689375 … 0.04010641390582609 -0.02268094493330316; 0.04038394833689375 0.0691386963788005 … 0.03203056278906753 -0.00839840230704004; … ; 0.04010641390582609 0.03203056278906753 … 0.057460951832629205 -0.010821249376082568; -0.02268094493330316 -0.00839840230704004 … -0.010821249376082568 0.015830523970505453;;; 0.09631029751643853 0.03587539258354575 … 0.03838831009690908 -0.025396292957756198; 0.03587539258354575 0.06308408495911258 … 0.024737958411540202 -0.007211734104591098; … ; 0.03838831009690908 0.024737958411540202 … 0.05195118580798586 -0.010453523302885338; -0.025396292957756198 -0.007211734104591098 … -0.010453523302885338 0.01671012877070668;;; … ;;; 0.07438147990531531 0.0305305111571838 … 0.029412174280976297 -0.017012235372204258; 0.0305305111571838 0.06268187406983632 … 0.023453579910918183 -0.00403058941307241; … ; 0.029412174280976297 0.023453579910918183 … 0.05096069628401587 -0.00618427832636701; -0.017012235372204258 -0.00403058941307241 … -0.00618427832636701 0.013655181344400849;;; 0.07353882538543838 0.030541819753753648 … 0.030140659927341572 -0.016051860394370857; 0.030541819753753648 0.06347376869476529 … 0.024725729033149037 -0.0033653120951671655; … ; 0.030140659927341572 0.024725729033149037 … 0.053085730286024674 -0.006368644184479695; -0.016051860394370857 -0.0033653120951671655 … -0.006368644184479695 0.013679938216201639;;; 0.12465965193831827 0.0579439268525617 … 0.0576096293475985 -0.030973421607732164; 0.0579439268525617 0.09049603789220044 … 0.04197587901957836 -0.01174320550801033; … ; 0.0576096293475985 0.04197587901957836 … 0.07532213698238206 -0.01442195543124506; -0.030973421607732164 -0.01174320550801033 … -0.01442195543124506 0.019422773635780873]\n [0.0018733240498050652 3.096151407390133e-5 … 2.2244806033743188e-5 0.0; 3.096151407390133e-5 0.0003979172766731916 … 5.69132236754644e-6 0.0; … ; 2.2244806033743188e-5 5.69132236754644e-6 … 0.00023306275288016156 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0016446428664714044 3.72910599876562e-5 … 2.723027443151125e-5 0.0; 3.72910599876562e-5 0.00038664282322931987 … 7.791883693382405e-6 0.0; … ; 2.723027443151125e-5 7.791883693382405e-6 … 0.00022861952824465714 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0017877970891102882 3.243158361859379e-5 … 2.4229209032921504e-5 0.0; 3.243158361859379e-5 0.00039383229376694387 … 6.503673530124919e-6 0.0; … ; 2.4229209032921504e-5 6.503673530124919e-6 … 0.000231255131594314 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0017309507895529432 3.4360740268888014e-5 … 2.5245564123808525e-5 0.0; 3.4360740268888014e-5 0.000391740323920398 … 6.72051620707648e-6 0.0; … ; 2.5245564123808525e-5 6.72051620707648e-6 … 0.00023059331670321413 0.0; 0.0 0.0 … 0.0 0.0;;; 0.001586490132064953 3.888041156707243e-5 … 2.8017507733504467e-5 0.0; 3.888041156707243e-5 0.00038357584814544546 … 8.147743352690285e-6 0.0; … ; 2.8017507733504467e-5 8.147743352690285e-6 … 0.00022719515986812782 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015684894428273305 4.000129888505287e-5 … 2.8685004036434755e-5 0.0; 4.000129888505287e-5 0.00038013479938511346 … 8.963434176674353e-6 0.0; … ; 2.8685004036434755e-5 8.963434176674353e-6 … 0.00022596457956954328 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0016701131270366056 3.692631322356877e-5 … 2.624349422033717e-5 0.0; 3.692631322356877e-5 0.00038705399687490586 … 7.544287495385443e-6 0.0; … ; 2.624349422033717e-5 7.544287495385443e-6 … 0.00022886710469376584 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015333233660692336 4.0894638884906606e-5 … 2.924110404372773e-5 0.0; 4.0894638884906606e-5 0.00037999301464735014 … 8.864917680249245e-6 0.0; … ; 2.924110404372773e-5 8.864917680249245e-6 … 0.00022568435707695788 0.0; 0.0 0.0 … 0.0 0.0;;; 0.001453393379725358 4.285087133359302e-5 … 3.085019200677401e-5 0.0; 4.285087133359302e-5 0.0003739504094135209 … 1.0040622295976805e-5 0.0; … ; 3.085019200677401e-5 1.0040622295976805e-5 … 0.00022374726281913847 0.0; 0.0 0.0 … 0.0 0.0]\n\n\nThey are hard to look at. Let’s take pictures.\n\n\n6.4.2 Caterpillar plots\n\n\nCode\ncaterpillar!(\n  Figure(; resolution=(800, 400)), ranefinfo(m1, :Cohort)\n)\n\n\n\n\n\nFigure 3: Prediction intervals of the random effects for Cohort in model m1\n\n\n\n\n\n\n6.4.3 Shrinkage plots\nThese are just teasers. We will pick this up in a separate tutorial. Enjoy!\n\n\nCode\nshrinkageplot!(Figure(; resolution=(800, 800)), m1, :Cohort)\n\n\n\n\n\nFigure 4: Shrinkage plot of the random effects for Cohort in model m1\n\n\n\n\n\n\nCode\nshrinkageplot!(Figure(; resolution=(800, 800)), m2, :Cohort)\n\n\n\n\n\nFigure 5: Shrinkage plot of the random effects for Cohort in model m2\n\n\n\n\n\n\nFühner, T., Granacher, U., Golle, K., & Kliegl, R. (2021). Age and sex effects in physical fitness components of 108,295 third graders including 515 primary schools and 9 cohorts. Scientific Reports, 11(1). https://doi.org/10.1038/s41598-021-97000-4\n\n\nSchielzeth, H., & Forstmeier, W. (2008). Conclusions beyond support: Overconfident estimates in mixed models. Behavioral Ecology, 20(2), 416–420. https://doi.org/10.1093/beheco/arn145"
    +    "text": "6.4 Model “predictions”\nThese commands inform us about extracion of conditional modes/means and (co-)variances, that using the model parameters to improve the predictions for units (levels) of the grouping (random) factors. We need this information, e.g., for partial-effect response profiles (e.g., facet plot) or effect profiles (e.g., caterpillar plot), or visualizing the borrowing-strength effect for correlation parameters (e.g., shrinkage plots). We are using the fit of LMM m2.\njulia> condVar(m2)\nSome plotting functions are currently available from the MixedModelsMakie package or via custom functions.\n+ julia> caterpillar!(m2)\n+ julia> shrinkage!(m2)\n\n6.4.1 Conditional covariances\n\ncondVar(m1)\n\n3-element Vector{Array{Float64, 3}}:\n [0.06019418742504718 0.009503796745062064 … 0.0033834400385739888 -0.022668479351173654; 0.009503796745062064 0.2854005880473556 … -0.00958507730779486 0.028716656437979788; … ; 0.0033834400385739888 -0.00958507730779486 … 0.1844727328000474 -0.06916979669328152; -0.022668479351173654 0.028716656437979788 … -0.06916979669328152 0.25191061541703247;;; 0.06638934288350756 0.011426004515357342 … 0.003909463104620026 -0.0292119474420615; 0.011426004515357342 0.2928687317350804 … -0.008478311285984651 0.02941370590727316; … ; 0.003909463104620026 -0.008478311285984651 … 0.18703004403763182 -0.06952986363931428; -0.0292119474420615 0.02941370590727316 … -0.06952986363931428 0.26021572018283845;;; 0.06362867054593162 0.010699346006361469 … 0.0033964643426404985 -0.026279729153108257; 0.010699346006361469 0.28888125998326925 … -0.009167782850568209 0.028821548015862015; … ; 0.0033964643426404985 -0.009167782850568209 … 0.18628102304197858 -0.06916102296546002; -0.026279729153108257 0.028821548015862015 … -0.06916102296546002 0.2563896296894346;;; … ;;; 0.09363460112990261 0.012046797405318213 … -0.0032862574042418287 -0.02711142050203791; 0.012046797405318213 0.291073687094071 … -0.009685893528276247 0.029842612487591166; … ; -0.0032862574042418287 -0.009685893528276247 … 0.18550883582901173 -0.06729639981737609; -0.02711142050203791 0.029842612487591166 … -0.06729639981737609 0.256671190831006;;; 0.09976557687633258 0.010016082191638962 … 0.0006243976195820504 -0.026342260007078178; 0.010016082191638962 0.2881525540785056 … -0.009777322410713288 0.030136684275133368; … ; 0.0006243976195820504 -0.009777322410713288 … 0.18521298293304764 -0.06807597904121555; -0.026342260007078178 0.030136684275133368 … -0.06807597904121555 0.25412967605580083;;; 0.08693320547738166 0.009664117531498923 … 0.0012964873388475982 -0.022429713649827168; 0.009664117531498923 0.2858445857972337 … -0.009905239241814905 0.029695883522352712; … ; 0.0012964873388475982 -0.009905239241814905 … 0.18441693027690204 -0.06832602885070671; -0.022429713649827168 0.029695883522352712 … -0.06832602885070671 0.25135725618394045]\n [0.037365395950585974 -0.0017655779498263638 … 0.029992640730425405 -0.012406566176960596; -0.0017655779498263638 0.09045228551960292 … -0.012385246199939885 0.017386570410622106; … ; 0.029992640730425405 -0.012385246199939885 … 0.06535317542823817 -0.01276748746573651; -0.012406566176960596 0.017386570410622106 … -0.01276748746573651 0.018334154141751987;;; 0.03216249095122564 0.00022696322483036835 … 0.02630529454531921 -0.010631439799091614; 0.00022696322483036835 0.07634951401975061 … -0.0077355031375509736 0.01420287914883203; … ; 0.02630529454531921 -0.0077355031375509736 … 0.05720044917460387 -0.010766382709518987; -0.010631439799091614 0.01420287914883203 … -0.010766382709518987 0.01590307809857184;;; 0.02929681307843224 -0.0031408663505337925 … 0.02158258776750699 -0.010436205316876505; -0.0031408663505337925 0.08773510997203417 … -0.013259706737215242 0.01810475478038694; … ; 0.02158258776750699 -0.013259706737215242 … 0.051655516941355686 -0.010379390251669994; -0.010436205316876505 0.01810475478038694 … -0.010379390251669994 0.016781780508046636;;; … ;;; 0.026745929701339315 0.002917641659474549 … 0.019080622096953756 -0.006834727156841562; 0.002917641659474549 0.07609969337059758 … -0.005614009097038336 0.012904348828268273; … ; 0.019080622096953756 -0.005614009097038336 … 0.050698905689706475 -0.006126528590023523; -0.006834727156841562 0.012904348828268273 … -0.006126528590023523 0.013714527286069556;;; 0.027216188929041405 0.003530944546766289 … 0.020359086613926557 -0.006139450095676234; 0.003530944546766289 0.07601961064990106 … -0.005083424404002116 0.012605131223533494; … ; 0.020359086613926557 -0.005083424404002116 … 0.0528330485244931 -0.006308308944350414; -0.006139450095676234 0.012605131223533494 … -0.006308308944350414 0.013739395068611007;;; 0.04331653082166873 -0.0030379453893194797 … 0.036447674453436926 -0.013624830406168449; -0.0030379453893194797 0.09937883559028705 … -0.015148527887408843 0.019142855162286802; … ; 0.036447674453436926 -0.015148527887408843 … 0.07489666357201216 -0.014366751200894581; -0.013624830406168449 0.019142855162286802 … -0.014366751200894581 0.01950850481597297]\n [0.00016545568505701335 6.921929999981573e-6 … -4.769170817387602e-6 0.0; 6.921929999981573e-6 0.002350279752955536 … -0.00015337284868442632 0.0; … ; -4.769170817387602e-6 -0.00015337284868442632 … 0.0008497610242309145 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001619822900577131 8.776171492319528e-6 … -6.069472752000027e-6 0.0; 8.776171492319528e-6 0.002036458052140791 … -0.0001679553344232745 0.0; … ; -6.069472752000027e-6 -0.0001679553344232745 … 0.0007826808244322982 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016398774773102024 7.640545323880597e-6 … -5.188084036842045e-6 0.0; 7.640545323880597e-6 0.002234310283157169 … -0.00015910218072598674 0.0; … ; -5.188084036842045e-6 -0.00015910218072598674 … 0.0008221654797834798 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001633625475861464 8.429206258047161e-6 … -5.511715091305747e-6 0.0; 8.429206258047161e-6 0.0021562253114837133 … -0.00016368660493861682 0.0; … ; -5.511715091305747e-6 -0.00016368660493861682 … 0.000810348287230687 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016089264981359867 8.680226109278226e-6 … -6.954004136733749e-6 0.0; 8.680226109278226e-6 0.001953795166646088 … -0.0001699333399437687 0.0; … ; -6.954004136733749e-6 -0.0001699333399437687 … 0.0007618309710747372 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00016010322463798926 7.419377161513542e-6 … -7.397987220434422e-6 0.0; 7.419377161513542e-6 0.0019252827742582445 … -0.00016884046751908626 0.0; … ; -7.397987220434422e-6 -0.00016884046751908626 … 0.000744959564694986 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0001622410767889185 8.01528410963981e-6 … -6.456679120351298e-6 0.0; 8.01528410963981e-6 0.0020692515929081647 … -0.0001674800149112973 0.0; … ; -6.456679120351298e-6 -0.0001674800149112973 … 0.0007869107690595535 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015985536145516973 8.448304257568326e-6 … -7.972844532979829e-6 0.0; 8.448304257568326e-6 0.0018802113797502158 … -0.00017389522990241473 0.0; … ; -7.972844532979829e-6 -0.00017389522990241473 … 0.0007415238377492921 0.0; 0.0 0.0 … 0.0 0.0;;; 0.00015800318743016144 9.75269804326113e-6 … -7.763058933586718e-6 0.0; 9.75269804326113e-6 0.0017797801831911692 … -0.00017360878834771101 0.0; … ; -7.763058933586718e-6 -0.00017360878834771101 … 0.0007156601770628602 0.0; 0.0 0.0 … 0.0 0.0]\n\n\n\ncondVar(m2)\n\n3-element Vector{Array{Float64, 3}}:\n [0.16966695569915408 0.02617127694248172 … 0.03258884081091673 -0.007206240570521886; 0.02617127694248172 0.17240843577597612 … 0.036311607303949625 0.017685521894305247; … ; 0.03258884081091673 0.036311607303949625 … 0.16016849406450073 0.02700910382414811; -0.007206240570521886 0.017685521894305247 … 0.02700910382414811 0.15894754823050586;;; 0.18123324821101372 0.032970827180563524 … 0.03995868284073482 -0.009308813398023906; 0.032970827180563524 0.18449651868025052 … 0.047727398942295 0.020196526455978036; … ; 0.03995868284073482 0.047727398942295 … 0.1729130206146902 0.029390651597285412; -0.009308813398023906 0.020196526455978036 … 0.029390651597285412 0.16144344560817153;;; 0.17484149294160142 0.029746321294318603 … 0.03664654756610398 -0.0080538238837542; 0.029746321294318603 0.17906868394590209 … 0.0424605957917473 0.018944085956201298; … ; 0.03664654756610398 0.0424605957917473 … 0.16706614260704472 0.028246498043986833; -0.0080538238837542 0.018944085956201298 … 0.028246498043986833 0.16014814619477102;;; … ;;; 0.21713559937899732 0.0703232791298282 … 0.06595205177634571 0.02224836937658333; 0.0703232791298282 0.2207965785568308 … 0.0715649873399086 0.05045668458090867; … ; 0.06595205177634571 0.0715649873399086 … 0.18284532391986422 0.04876533846002718; 0.02224836937658333 0.05045668458090867 … 0.04876533846002718 0.18528720926682385;;; 0.22412902553385222 0.07722305653468363 … 0.07564573705535872 0.03327435300237856; 0.07722305653468363 0.2237846566159937 … 0.07765990648329005 0.058316403691267296; … ; 0.07564573705535872 0.07765990648329005 … 0.1915742870715255 0.05932034418821193; 0.03327435300237856 0.058316403691267296 … 0.05932034418821193 0.19437286232267642;;; 0.205527415636691 0.0607498585349418 … 0.06085868964925743 0.022971189688065028; 0.0607498585349418 0.2063016197365087 … 0.06271247545596066 0.047296418415569835; … ; 0.06085868964925743 0.06271247545596066 … 0.17846777170600717 0.05001559243541315; 0.022971189688065028 0.047296418415569835 … 0.05001559243541315 0.18581538540889578]\n [0.10769418687358297 0.0484138260546604 … 0.04763895560577541 -0.027759205229890213; 0.0484138260546604 0.07951701580471926 … 0.03495321490061306 -0.010311510372108108; … ; 0.04763895560577541 0.03495321490061306 … 0.0658350520969288 -0.01270562792721933; -0.027759205229890213 -0.010311510372108108 … -0.01270562792721933 0.018196540862379026;;; 0.0879084826520309 0.040403913310339656 … 0.040037182565219126 -0.022685563208058285; 0.040403913310339656 0.06916204870896962 … 0.03208450922319941 -0.00842678401969979; … ; 0.040037182565219126 0.03208450922319941 … 0.057579486039892006 -0.01071278176888107; -0.022685563208058285 -0.00842678401969979 … -0.01071278176888107 0.015777046740511287;;; 0.09637213624194817 0.03589422543301574 … 0.03830636300698518 -0.02541382219547382; 0.03589422543301574 0.06309224943216125 … 0.02477485898489156 -0.007248744857239961; … ; 0.03830636300698518 0.02477485898489156 … 0.05206800643939926 -0.010345170531194063; -0.02541382219547382 -0.007248744857239961 … -0.010345170531194063 0.016662358117835684;;; … ;;; 0.07441613532861045 0.030534129302106215 … 0.029358413135702772 -0.017030746639950356; 0.030534129302106215 0.06268091131640748 … 0.023507104986285554 -0.004067681652846168; … ; 0.029358413135702772 0.023507104986285554 … 0.0511310861047336 -0.006095360848082819; -0.017030746639950356 -0.004067681652846168 … -0.006095360848082819 0.013610756027601966;;; 0.07356828397556059 0.030542855562619584 … 0.030098187775322967 -0.016068996673588593; 0.030542855562619584 0.06347189659643981 … 0.02478959264016431 -0.0034032300910587046; … ; 0.030098187775322967 0.02478959264016431 … 0.05324804720352666 -0.006283052897152759; -0.016068996673588593 -0.0034032300910587046 … -0.006283052897152759 0.013633449293620056;;; 0.1247463998878555 0.05798323363917551 … 0.05754108517606356 -0.030993072866660944; 0.05798323363917551 0.090536033106285 … 0.04204624951052498 -0.011783159908059896; … ; 0.05754108517606356 0.04204624951052498 … 0.07545231569635082 -0.01431516261615476; -0.030993072866660944 -0.011783159908059896 … -0.01431516261615476 0.01937291704557192]\n [0.0018735729244332131 3.1021279739402785e-5 … 2.218901558704754e-5 0.0; 3.1021279739402785e-5 0.0003987145541487774 … 5.687922385049934e-6 0.0; … ; 2.218901558704754e-5 5.687922385049934e-6 … 0.00023246361130711195 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0016448374627962333 3.735940126370843e-5 … 2.7163163938007965e-5 0.0; 3.735940126370843e-5 0.0003873943943271986 … 7.787212545118072e-6 0.0; … ; 2.7163163938007965e-5 7.787212545118072e-6 … 0.00022804305561134738 0.0; 0.0 0.0 … 0.0 0.0;;; 0.001788023110969321 3.249144540015982e-5 … 2.4169663572572665e-5 0.0; 3.249144540015982e-5 0.0003946125070407935 … 6.4998245935627574e-6 0.0; … ; 2.4169663572572665e-5 6.4998245935627574e-6 … 0.00023066529735919788 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0017311576193917888 3.4425010639770386e-5 … 2.5182780729294603e-5 0.0; 3.4425010639770386e-5 0.00039251230085191426 … 6.716489112057239e-6 0.0; … ; 2.5182780729294603e-5 6.716489112057239e-6 … 0.00023000674697200486 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015866567728126586 3.895300927019573e-5 … 2.7947105583323014e-5 0.0; 3.895300927019573e-5 0.0003843160712136583 … 8.142851120432268e-6 0.0; … ; 2.7947105583323014e-5 8.142851120432268e-6 … 0.000226625569125888 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015686577971835273 4.007382105691694e-5 … 2.8613860602075923e-5 0.0; 4.007382105691694e-5 0.00038086108365777084 … 8.958114047331325e-6 0.0; … ; 2.8613860602075923e-5 8.958114047331325e-6 … 0.00022540117288928575 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0016703012710220753 3.6996751480078234e-5 … 2.6177223175802248e-5 0.0; 3.6996751480078234e-5 0.00038780797818598625 … 7.539703069962164e-6 0.0; … ; 2.6177223175802248e-5 7.539703069962164e-6 … 0.00022828921517269618 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0015334797920780099 4.097063267119373e-5 … 2.916768169845572e-5 0.0; 4.097063267119373e-5 0.00038071951801350813 … 8.859649467653798e-6 0.0; … ; 2.916768169845572e-5 8.859649467653798e-6 … 0.00022512224213137852 0.0; 0.0 0.0 … 0.0 0.0;;; 0.0014535411311816353 4.292579687983954e-5 … 3.077535310809958e-5 0.0; 4.292579687983954e-5 0.00037465233137207627 … 1.0034600769927935e-5 0.0; … ; 3.077535310809958e-5 1.0034600769927935e-5 … 0.00022319509436843918 0.0; 0.0 0.0 … 0.0 0.0]\n\n\nThey are hard to look at. Let’s take pictures.\n\n\n6.4.2 Caterpillar plots\n\n\nCode\ncaterpillar!(\n  Figure(; resolution=(800, 400)), ranefinfo(m1, :Cohort)\n)\n\n\n\n\n\nFigure 3: Prediction intervals of the random effects for Cohort in model m1\n\n\n\n\n\n\n6.4.3 Shrinkage plots\nThese are just teasers. We will pick this up in a separate tutorial. Enjoy!\n\n\nCode\nshrinkageplot!(Figure(; resolution=(800, 800)), m1, :Cohort)\n\n\n\n\n\nFigure 4: Shrinkage plot of the random effects for Cohort in model m1\n\n\n\n\n\n\nCode\nshrinkageplot!(Figure(; resolution=(800, 800)), m2, :Cohort)\n\n\n\n\n\nFigure 5: Shrinkage plot of the random effects for Cohort in model m2\n\n\n\n\n\n\nFühner, T., Granacher, U., Golle, K., & Kliegl, R. (2021). Age and sex effects in physical fitness components of 108,295 third graders including 515 primary schools and 9 cohorts. Scientific Reports, 11(1). https://doi.org/10.1038/s41598-021-97000-4\n\n\nSchielzeth, H., & Forstmeier, W. (2008). Conclusions beyond support: Overconfident estimates in mixed models. Behavioral Ecology, 20(2), 416–420. https://doi.org/10.1093/beheco/arn145"
       },
       {
         "objectID": "index.html",
    @@ -662,7 +662,7 @@
         "href": "kkl15.html#caterpillar-plot",
         "title": "RePsychLing Kliegl, Kuschela, & Laubrock (2015)",
         "section": "6.1 Caterpillar plot",
    -    "text": "6.1 Caterpillar plot\n\n\nCode\ncm1 = only(ranefinfo(m1))\ncaterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=2)\n\n\n\n\n\nFigure 9: Prediction intervals of the subject random effects in model m1\n\n\n\n\nWhen we order the conditional modes for GM, that is (Intercept), the outlier subject S113 becomes visible; the associated experimental effects are not unusual.\n\n\nCode\ncaterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=1)\n\n\n\n\n\nFigure 10: Prediction intervals of the subject random effects in model m1 ordered by mean response\n\n\n\n\nThe caterpillar plot also reveals that credibility intervals are much shorter for subjects’ Grand Means, shown in (Intercept), than the subjects’ experimental effects, because the latter are based on difference scores not means. Moreover, credibility intervals are shorter for the first spatial effect sod than the other two effects, because the spatial effect involves the valid condition which yielded three times as many trials than the other three conditions. Consequently, the spatial effect is more reliable. Unfortunately, due to differences in scaling of the x-axis of the panels this effect must be inferred. One option to reveal this difference is to reparameterize the LMM such model parameters estimate the conditional modes for the levels of condition rather than the contrast-based effects. This is accomplished by replacing the 1 in the random effect term with 0, as shown next.\n\nm1L = let\n  form = @formula rt ~ 1 + CTR + (0 + CTR | Subj)\n  fit(MixedModel, form, dat; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n308.2059\n6.4153\n48.04\n<1e-99\n\n\n\nCTR: sod\n23.0720\n2.6415\n8.73\n<1e-17\n60.1796\n\n\nCTR: dos\n13.0855\n1.4584\n8.97\n<1e-18\n62.4789\n\n\nCTR: dod\n2.6860\n2.0607\n1.30\n0.1924\n71.5439\n\n\nCTR: val\n\n\n\n\n47.2925\n\n\nResidual\n65.2246\n\n\n\n\n\n\n\n\n\n\nVarCorr(m1L)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\nSubj\nCTR: val\n2236.5784\n47.2925\n\n\n\n\n\n\nCTR: sod\n3621.5816\n60.1796\n+0.94\n\n\n\n\n\nCTR: dos\n3903.6132\n62.4789\n+0.93\n+0.99\n\n\n\n\nCTR: dod\n5118.5225\n71.5439\n+0.89\n+0.98\n+0.98\n\n\nResidual\n\n4254.2483\n65.2246\n\n\n\n\n\n\n\n\nThe caterpillar plot for levels shows the effect of the number of trials on credibility intervals; they are obviously much shorter for the valid condition. Note that this effect is not visible in a repeated-measure ANOVA with four condition means per subject as input.\n\n\nCode\n@chain m1L begin\n  ranefinfo\n  only\n  caterpillar!(Figure(; resolution=(800, 1000)), _; orderby=1)\nend\n\n\n\n\n\nFigure 11: Prediction intervals of the subject random effects in model m1L"
    +    "text": "6.1 Caterpillar plot\n\n\nCode\ncm1 = only(ranefinfo(m1))\ncaterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=2)\n\n\n\n\n\nFigure 9: Prediction intervals of the subject random effects in model m1\n\n\n\n\nWhen we order the conditional modes for GM, that is (Intercept), the outlier subject S113 becomes visible; the associated experimental effects are not unusual.\n\n\nCode\ncaterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=1)\n\n\n\n\n\nFigure 10: Prediction intervals of the subject random effects in model m1 ordered by mean response\n\n\n\n\nThe caterpillar plot also reveals that credibility intervals are much shorter for subjects’ Grand Means, shown in (Intercept), than the subjects’ experimental effects, because the latter are based on difference scores not means. Moreover, credibility intervals are shorter for the first spatial effect sod than the other two effects, because the spatial effect involves the valid condition which yielded three times as many trials than the other three conditions. Consequently, the spatial effect is more reliable. Unfortunately, due to differences in scaling of the x-axis of the panels this effect must be inferred. One option to reveal this difference is to reparameterize the LMM such model parameters estimate the conditional modes for the levels of condition rather than the contrast-based effects. This is accomplished by replacing the 1 in the random effect term with 0, as shown next.\n\nm1L = let\n  form = @formula rt ~ 1 + CTR + (0 + CTR | Subj)\n  fit(MixedModel, form, dat; contrasts)\nend\n\n\n\n\n\nEst.\nSE\nz\np\nσ_Subj\n\n\n\n\n(Intercept)\n308.2059\n6.4151\n48.04\n<1e-99\n\n\n\nCTR: sod\n23.0720\n2.6420\n8.73\n<1e-17\n60.1802\n\n\nCTR: dos\n13.0855\n1.4585\n8.97\n<1e-18\n62.4787\n\n\nCTR: dod\n2.6859\n2.0616\n1.30\n0.1926\n71.5445\n\n\nCTR: val\n\n\n\n\n47.2886\n\n\nResidual\n65.2245\n\n\n\n\n\n\n\n\n\n\nVarCorr(m1L)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\nSubj\nCTR: val\n2236.2113\n47.2886\n\n\n\n\n\n\nCTR: sod\n3621.6577\n60.1802\n+0.94\n\n\n\n\n\nCTR: dos\n3903.5826\n62.4787\n+0.93\n+0.99\n\n\n\n\nCTR: dod\n5118.6150\n71.5445\n+0.89\n+0.98\n+0.98\n\n\nResidual\n\n4254.2419\n65.2245\n\n\n\n\n\n\n\n\nThe caterpillar plot for levels shows the effect of the number of trials on credibility intervals; they are obviously much shorter for the valid condition. Note that this effect is not visible in a repeated-measure ANOVA with four condition means per subject as input.\n\n\nCode\n@chain m1L begin\n  ranefinfo\n  only\n  caterpillar!(Figure(; resolution=(800, 1000)), _; orderby=1)\nend\n\n\n\n\n\nFigure 11: Prediction intervals of the subject random effects in model m1L"
       },
       {
         "objectID": "kkl15.html#shrinkage-plot",
    @@ -676,14 +676,14 @@
         "href": "kkl15.html#generate-a-bootstrap-sample",
         "title": "RePsychLing Kliegl, Kuschela, & Laubrock (2015)",
         "section": "7.1 Generate a bootstrap sample",
    -    "text": "7.1 Generate a bootstrap sample\nWe generate 2500 samples for the 15 model parameters (4 fixed effect, 4 VCs, 6 CPs, and 1 residual).\n\nsamp = parametricbootstrap(MersenneTwister(1234321), 2500, m1;\n                           optsum_overrides=(; ftol_rel=1e-8));\n\n\ntbl = samp.tbl\n\nTable with 26 columns and 2500 rows:\n      obj       β1       β2         β3         β4            σ         ⋯\n    ┌───────────────────────────────────────────────────────────────────\n 1  │ -21723.9  5.65297  0.0776126  0.039106   -0.0013708    0.196176  ⋯\n 2  │ -21108.3  5.71733  0.0804429  0.0386068  0.00575313    0.197357  ⋯\n 3  │ -21063.8  5.66428  0.0725792  0.0383587  0.00958592    0.197487  ⋯\n 4  │ -21121.5  5.69924  0.075978   0.039032   0.00779778    0.197325  ⋯\n 5  │ -21739.9  5.70391  0.0739256  0.034784   0.00040087    0.196179  ⋯\n 6  │ -21359.0  5.69776  0.0827999  0.0440931  0.00786666    0.196906  ⋯\n 7  │ -21120.2  5.67658  0.0620062  0.0415177  -0.00420678   0.197326  ⋯\n 8  │ -21478.8  5.6702   0.0662573  0.0438442  -0.00331906   0.196696  ⋯\n 9  │ -20886.6  5.68164  0.0719098  0.0368378  0.0043128     0.19782   ⋯\n 10 │ -21400.4  5.68848  0.0707709  0.0410581  0.00626677    0.196777  ⋯\n 11 │ -21565.8  5.65823  0.0626937  0.0449801  -0.0129838    0.196502  ⋯\n 12 │ -20959.8  5.68811  0.086935   0.0405281  -0.00620311   0.197551  ⋯\n 13 │ -21515.6  5.6556   0.0688038  0.0412677  -0.00227728   0.196591  ⋯\n 14 │ -21351.5  5.70541  0.0844503  0.0393561  0.00206449    0.196936  ⋯\n 15 │ -21505.6  5.69288  0.0686169  0.0373182  0.000780283   0.196691  ⋯\n 16 │ -21152.2  5.71185  0.0785621  0.0443818  0.00196888    0.197318  ⋯\n 17 │ -20954.6  5.67956  0.0560955  0.0441204  0.00616687    0.197625  ⋯\n 18 │ -21297.9  5.69953  0.0819562  0.0482077  -0.000747306  0.196944  ⋯\n 19 │ -21636.6  5.68097  0.0631924  0.0416913  -0.00420336   0.196289  ⋯\n 20 │ -20761.5  5.72306  0.0850321  0.0390101  0.0114425     0.197969  ⋯\n 21 │ -21433.2  5.67599  0.0722524  0.0458681  -0.000569138  0.196698  ⋯\n 22 │ -20850.3  5.69293  0.0653955  0.0383436  -0.00174954   0.197888  ⋯\n 23 │ -21412.2  5.70064  0.0761079  0.0439189  0.00447735    0.196759  ⋯\n ⋮  │    ⋮         ⋮         ⋮          ⋮           ⋮           ⋮      ⋱"
    +    "text": "7.1 Generate a bootstrap sample\nWe generate 2500 samples for the 15 model parameters (4 fixed effect, 4 VCs, 6 CPs, and 1 residual).\n\nsamp = parametricbootstrap(MersenneTwister(1234321), 2500, m1;\n                           optsum_overrides=(; ftol_rel=1e-8));\n\n\ntbl = samp.tbl\n\nTable with 26 columns and 2500 rows:\n      obj       β1       β2         β3         β4            σ         ⋯\n    ┌───────────────────────────────────────────────────────────────────\n 1  │ -21726.3  5.65296  0.0776098  0.0390983  -0.00192407   0.196175  ⋯\n 2  │ -21112.6  5.71733  0.0804452  0.0386008  0.00441928    0.197359  ⋯\n 3  │ -21065.0  5.66428  0.0725807  0.0383616  0.00977017    0.197492  ⋯\n 4  │ -21116.6  5.69924  0.0759795  0.0390337  0.00725382    0.197324  ⋯\n 5  │ -21650.5  5.7039   0.0739011  0.0348058  -0.000164276  0.196069  ⋯\n 6  │ -21356.6  5.69776  0.0828046  0.0440864  0.00807038    0.196912  ⋯\n 7  │ -21118.0  5.67658  0.0620127  0.0415122  -0.00470687   0.197323  ⋯\n 8  │ -21482.2  5.6702   0.0662555  0.0438526  -0.00243733   0.196701  ⋯\n 9  │ -20882.6  5.68163  0.071917   0.0368263  0.00451148    0.197831  ⋯\n 10 │ -21400.8  5.68848  0.0707767  0.0410532  0.00644842    0.196796  ⋯\n 11 │ -21566.3  5.65823  0.0626926  0.0449806  -0.0126605    0.196514  ⋯\n 12 │ -20958.1  5.68811  0.0869311  0.0405299  -0.00495313   0.197559  ⋯\n 13 │ -21516.6  5.6556   0.0688022  0.0412704  -0.00261289   0.196596  ⋯\n 14 │ -21354.8  5.70541  0.0844484  0.0393567  0.00274489    0.196936  ⋯\n 15 │ -21503.1  5.69287  0.0686162  0.0373194  0.00145341    0.196692  ⋯\n 16 │ -21155.5  5.71186  0.0785595  0.0443829  0.00210673    0.197311  ⋯\n 17 │ -20954.3  5.67956  0.0560935  0.0441269  0.0065956     0.197633  ⋯\n 18 │ -21296.4  5.69953  0.0819501  0.048204   -0.00110287   0.196946  ⋯\n 19 │ -21638.0  5.68097  0.0631934  0.041689   -0.00418874   0.196291  ⋯\n 20 │ -20760.8  5.72306  0.0850344  0.0390064  0.0113318     0.197966  ⋯\n 21 │ -21432.3  5.676    0.0722568  0.0458649  0.000163016   0.196699  ⋯\n 22 │ -20850.9  5.69293  0.0654037  0.0383358  -0.00130412   0.197842  ⋯\n 23 │ -21406.8  5.70064  0.0761065  0.0439254  0.00542814    0.196757  ⋯\n ⋮  │    ⋮         ⋮         ⋮          ⋮           ⋮           ⋮      ⋱"
       },
       {
         "objectID": "kkl15.html#shortest-coverage-interval",
         "href": "kkl15.html#shortest-coverage-interval",
         "title": "RePsychLing Kliegl, Kuschela, & Laubrock (2015)",
         "section": "7.2 Shortest coverage interval",
    -    "text": "7.2 Shortest coverage interval\n\nconfint(samp)\n\nDictTable with 2 columns and 15 rows:\n par   lower        upper\n ────┬───────────────────────\n β1  │ 5.65481      5.73071\n β2  │ 0.058961     0.0895368\n β3  │ 0.033392     0.0485977\n β4  │ -0.00904061  0.0126064\n ρ1  │ 0.396079     0.723871\n ρ2  │ -0.999971    0.915557\n ρ3  │ -0.881343    0.999992\n ρ4  │ 0.379009     0.807484\n ρ5  │ 0.460748     0.910983\n ρ6  │ -0.880744    0.800718\n σ   │ 0.195885     0.198254\n σ1  │ 0.154888     0.20986\n σ2  │ 0.0567064    0.080392\n σ3  │ 0.000848579  0.0176647\n σ4  │ 0.0283153    0.0492107\n\n\nWe can also visualize the shortest coverage intervals for fixed effects with the ridgeplot() command:\n\n\nCode\nridgeplot(samp; show_intercept=false)\n\n\n\n\n\nFigure 14: Ridge plot of fixed-effects bootstrap samples from model m1L"
    +    "text": "7.2 Shortest coverage interval\n\nconfint(samp)\n\nDictTable with 2 columns and 15 rows:\n par   lower        upper\n ────┬───────────────────────\n β1  │ 5.65481      5.7307\n β2  │ 0.059008     0.0895876\n β3  │ 0.0333901    0.0485983\n β4  │ -0.00892629  0.0127809\n ρ1  │ 0.388808     0.718646\n ρ2  │ -0.999908    0.925436\n ρ3  │ -0.890365    0.999997\n ρ4  │ 0.383311     0.813969\n ρ5  │ 0.433522     0.886426\n ρ6  │ -0.840803    0.830724\n σ   │ 0.195886     0.198245\n σ1  │ 0.154673     0.210314\n σ2  │ 0.0564024    0.0801978\n σ3  │ 0.000653202  0.0175227\n σ4  │ 0.0283408    0.0493863\n\n\nWe can also visualize the shortest coverage intervals for fixed effects with the ridgeplot() command:\n\n\nCode\nridgeplot(samp; show_intercept=false)\n\n\n\n\n\nFigure 14: Ridge plot of fixed-effects bootstrap samples from model m1L"
       },
       {
         "objectID": "kkl15.html#comparative-density-plots-of-bootstrapped-parameter-estimates",
    @@ -718,7 +718,7 @@
         "href": "largescaledesigned.html#sec-ldtinitialmodel",
         "title": "A large-scale designed experiment",
         "section": "1.3 Models with scalar random effects",
    -    "text": "1.3 Models with scalar random effects\nA major purpose of the English Lexicon Project is to characterize the items (words or nonwords) according to the observed accuracy of identification and to response latency, taking into account subject-to-subject variability, and to relate these to lexical characteristics of the items.\nIn Balota et al. (2007) the item response latency is characterized by the average response latency from the correct trials after outlier removal.\nMixed-effects models allow us greater flexibility and, we hope, precision in characterizing the items by controlling for subject-to-subject variability and for item characteristics such as word/nonword and item length.\nWe begin with a model that has scalar random effects for item and for subject and incorporates fixed-effects for word/nonword and for item length and for the interaction of these terms.\n\n1.3.1 Establish the contrasts\nBecause there are a large number of items in the data set it is important to assign a Grouping() contrast to item (and, less importantly, to subj). For the isword factor we will use an EffectsCoding contrast with the base level as false. The non-words are assigned -1 in this contrast and the words are assigned +1. The wrdlen covariate is on its original scale but centered at 8 characters.\nThus the (Intercept) coefficient is the predicted speed of response for a typical subject and typical item (without regard to word/non-word status) of 8 characters.\nSet these contrasts\n\ncontrasts = Dict(\n  :subj => Grouping(),\n  :item => Grouping(),\n  :isword => EffectsCoding(; base=false),\n  :wrdlen => Center(8),\n)\n\nDict{Symbol, Any} with 4 entries:\n  :item   => Grouping()\n  :wrdlen => Center(8)\n  :isword => EffectsCoding(false, nothing)\n  :subj   => Grouping()\n\n\nand fit a first model with simple, scalar, random effects for subj and item.\n\nelm01 = let\n  form = @formula(\n    1000 / rt ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)\n  )\n  fit(MixedModel, form, pruned; contrasts)\nend\n\nMinimizing 53    Time: 0:00:06 ( 0.13  s/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n1.3758\n0.0090\n153.69\n<1e-99\n0.1185\n0.2550\n\n\nisword: true\n0.0625\n0.0005\n131.35\n<1e-99\n\n\n\n\nwrdlen(centered: 8)\n-0.0436\n0.0002\n-225.38\n<1e-99\n\n\n\n\nisword: true & wrdlen(centered: 8)\n-0.0056\n0.0002\n-28.83\n<1e-99\n\n\n\n\nResidual\n0.3781\n\n\n\n\n\n\n\n\n\n\nThe predicted response speed by word length and word/nonword status can be summarized as\n\neffects(Dict(:isword => [false, true], :wrdlen => 4:2:12), elm01)\n\n10×6 DataFrame\n\n\n\nRow\nwrdlen\nisword\n1000 / rt\nerr\nlower\nupper\n\n\n\nInt64\nBool\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\n4\nfalse\n1.46555\n0.00903111\n1.45652\n1.47458\n\n\n2\n6\nfalse\n1.38947\n0.00898124\n1.38049\n1.39845\n\n\n3\n8\nfalse\n1.31338\n0.00896459\n1.30442\n1.32235\n\n\n4\n10\nfalse\n1.2373\n0.00898134\n1.22832\n1.24628\n\n\n5\n12\nfalse\n1.16121\n0.00903129\n1.15218\n1.17025\n\n\n6\n4\ntrue\n1.6351\n0.0090311\n1.62607\n1.64413\n\n\n7\n6\ntrue\n1.5367\n0.00898124\n1.52772\n1.54569\n\n\n8\n8\ntrue\n1.43831\n0.00896459\n1.42934\n1.44727\n\n\n9\n10\ntrue\n1.33991\n0.00898133\n1.33092\n1.34889\n\n\n10\n12\ntrue\n1.24151\n0.00903128\n1.23248\n1.25054\n\n\n\n\n\n\nIf we restrict to only those subjects with 80% accuracy or greater the model becomes\n\nelm02 = let\n  form = @formula(\n    1000 / rt ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)\n  )\n  dat = @subset(pruned, :spropacc > 0.8)\n  fit(MixedModel, form, dat; contrasts)\nend\n\nMinimizing 53    Time: 0:00:04 (83.11 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n1.3611\n0.0088\n153.98\n<1e-99\n0.1247\n0.2318\n\n\nisword: true\n0.0656\n0.0005\n133.72\n<1e-99\n\n\n\n\nwrdlen(centered: 8)\n-0.0444\n0.0002\n-222.65\n<1e-99\n\n\n\n\nisword: true & wrdlen(centered: 8)\n-0.0057\n0.0002\n-28.73\n<1e-99\n\n\n\n\nResidual\n0.3342\n\n\n\n\n\n\n\n\n\n\n\neffects(Dict(:isword => [false, true], :wrdlen => 4:2:12), elm02)\n\n10×6 DataFrame\n\n\n\nRow\nwrdlen\nisword\n1000 / rt\nerr\nlower\nupper\n\n\n\nInt64\nBool\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\n4\nfalse\n1.45036\n0.00892467\n1.44144\n1.45929\n\n\n2\n6\nfalse\n1.37297\n0.00887101\n1.3641\n1.38184\n\n\n3\n8\nfalse\n1.29557\n0.00885309\n1.28672\n1.30443\n\n\n4\n10\nfalse\n1.21818\n0.00887111\n1.20931\n1.22705\n\n\n5\n12\nfalse\n1.14078\n0.00892487\n1.13186\n1.14971\n\n\n6\n4\ntrue\n1.62735\n0.00892466\n1.61842\n1.63627\n\n\n7\n6\ntrue\n1.52702\n0.00887101\n1.51815\n1.53589\n\n\n8\n8\ntrue\n1.4267\n0.00885308\n1.41784\n1.43555\n\n\n9\n10\ntrue\n1.32637\n0.0088711\n1.3175\n1.33524\n\n\n10\n12\ntrue\n1.22605\n0.00892484\n1.21712\n1.23497\n\n\n\n\n\n\nThe differences in the fixed-effects parameter estimates between a model fit to the full data set and one fit to the data from accurate responders only, are small.\nHowever, the random effects for the item, while highly correlated, are not perfectly correlated.\n\n\nCode\nCairoMakie.activate!(; type=\"png\")\ndisallowmissing!(\n  leftjoin!(\n    byitem,\n    leftjoin!(\n      rename!(DataFrame(raneftables(elm01)[:item]), [:item, :elm01]),\n      rename!(DataFrame(raneftables(elm02)[:item]), [:item, :elm02]);\n      on=:item,\n    ),\n    on=:item,\n  ),\n)\ndisallowmissing!(\n  leftjoin!(\n    bysubj,\n    leftjoin!(\n      rename!(DataFrame(raneftables(elm01)[:subj]), [:subj, :elm01]),\n      rename!(DataFrame(raneftables(elm02)[:subj]), [:subj, :elm02]);\n      on=:subj,\n    ),\n    on=:subj,\n  ); error=false,\n)\ndraw(\n  data(byitem) * mapping(\n    :elm01 => \"Conditional means of item random effects for model elm01\",\n    :elm02 => \"Conditional means of item random effects for model elm02\";\n    color=:isword,\n  ) * visual(Scatter; alpha=0.2);\n  axis=(; width=600, height=600),\n)\n\n\n\n\n\nFigure 9: Conditional means of scalar random effects for item in model elm01, fit to the pruned data, versus those for model elm02, fit to the pruned data with inaccurate subjects removed.\n\n\n\n\n\n\n\n\n\n\nNote\n\n\n\nAdjust the alpha on Figure 9.\n\n\nFigure 9 is exactly of the form that would be expected in a sample from a correlated multivariate Gaussian distribution. The correlation of the two sets of conditional means is about 96%.\n\ncor(Matrix(select(byitem, :elm01, :elm02)))\n\n2×2 Matrix{Float64}:\n 1.0       0.958655\n 0.958655  1.0\n\n\nThese models take only a few seconds to fit on a modern laptop computer, which is quite remarkable given the size of the data set and the number of random effects.\nThe amount of time to fit more complex models will be much greater so we may want to move those fits to more powerful server computers. We can split the tasks of fitting and analyzing a model between computers by saving the optimization summary after the model fit and later creating the MixedModel object followed by restoring the optsum object.\n\nsaveoptsum(\"./fits/elm01.json\", elm01);\n\n\nelm01a = restoreoptsum!(\n  let\n    form = @formula(\n      1000 / rt ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)\n    )\n    MixedModel(form, pruned; contrasts)\n  end,\n  \"./fits/elm01.json\",\n)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n1.3758\n0.0090\n153.69\n<1e-99\n0.1185\n0.2550\n\n\nisword: true\n0.0625\n0.0005\n131.35\n<1e-99\n\n\n\n\nwrdlen(centered: 8)\n-0.0436\n0.0002\n-225.38\n<1e-99\n\n\n\n\nisword: true & wrdlen(centered: 8)\n-0.0056\n0.0002\n-28.83\n<1e-99\n\n\n\n\nResidual\n0.3781\n\n\n\n\n\n\n\n\n\n\nOther covariates associated with the item are available as\n\nelpldtitem = DataFrame(dataset(\"ELP_ldt_item\"))\ndescribe(elpldtitem)\n\n9×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nType\n\n\n\n\n1\nitem\n\nAarod\n\nzuss\n0\nString\n\n\n2\nOrtho_N\n1.53309\n0\n1.0\n25\n0\nInt8\n\n\n3\nBG_Sum\n13938.4\n11\n13026.0\n59803\n177\nUnion{Missing, Int32}\n\n\n4\nBG_Mean\n1921.25\n5.5\n1907.0\n6910.0\n177\nUnion{Missing, Float32}\n\n\n5\nBG_Freq_By_Pos\n2043.08\n0\n1928.0\n6985\n4\nUnion{Missing, Int16}\n\n\n6\nitemno\n40481.5\n1\n40481.5\n80962\n0\nInt32\n\n\n7\nisword\n0.5\nfalse\n0.5\ntrue\n0\nBool\n\n\n8\nwrdlen\n7.9988\n1\n8.0\n21\n0\nInt8\n\n\n9\npairno\n20241.0\n1\n20241.0\n40481\n0\nInt32\n\n\n\n\n\n\nand those associated with the subject are\n\nelpldtsubj = DataFrame(dataset(\"ELP_ldt_subj\"))\ndescribe(elpldtsubj)\n\n20×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nAny\nAny\nInt64\nType\n\n\n\n\n1\nsubj\n409.311\n1\n409.5\n816\n0\nInt16\n\n\n2\nuniv\n\nKansas\n\nWayne State\n0\nString\n\n\n3\nsex\n\nf\n\nm\n8\nUnion{Missing, String}\n\n\n4\nDOB\n\n1938-06-07\n\n1984-11-14\n0\nDate\n\n\n5\nMEQ\n44.4932\n19.0\n44.0\n75.0\n8\nUnion{Missing, Float32}\n\n\n6\nvision\n5.51169\n0\n6.0\n7\n1\nUnion{Missing, Int8}\n\n\n7\nhearing\n5.86101\n0\n6.0\n7\n1\nUnion{Missing, Int8}\n\n\n8\neducatn\n8.89681\n1\n12.0\n28\n0\nInt8\n\n\n9\nncorrct\n29.8505\n5\n30.0\n40\n18\nUnion{Missing, Int8}\n\n\n10\nrawscor\n31.9925\n13\n32.0\n40\n18\nUnion{Missing, Int8}\n\n\n11\nvocabAge\n17.8123\n10.3\n17.8\n21.0\n19\nUnion{Missing, Float32}\n\n\n12\nshipTime\n3.0861\n0\n3.0\n9\n1\nUnion{Missing, Int8}\n\n\n13\nreadTime\n2.50215\n0.0\n2.0\n15.0\n1\nUnion{Missing, Float32}\n\n\n14\npreshlth\n5.48708\n0\n6.0\n7\n1\nUnion{Missing, Int8}\n\n\n15\npasthlth\n4.92989\n0\n5.0\n7\n1\nUnion{Missing, Int8}\n\n\n16\nS1start\n\n2001-03-16T13:49:27\n2001-10-16T11:38:28.500\n2003-07-29T18:48:44\n0\nDateTime\n\n\n17\nS2start\n\n2001-03-19T10:00:35\n2001-10-19T14:24:19.500\n2003-07-30T13:07:45\n0\nDateTime\n\n\n18\nMEQstrt\n\n2001-03-22T18:32:00\n2001-10-23T11:26:13\n2003-07-30T14:30:49\n7\nUnion{Missing, DateTime}\n\n\n19\nfilename\n\n101DATA.LDT\n\nData998.LDT\n0\nString\n\n\n20\nfrstLang\n\nEnglish\n\nother\n8\nUnion{Missing, String}\n\n\n\n\n\n\nFor the simple model elm01 the estimated standard deviation of the random effects for subject is greater than that of the random effects for item, a common occurrence. A caterpillar plot, Figure 10,\n\n\nCode\nqqcaterpillar!(\n  Figure(resolution=(800, 650)),\n  ranefinfo(elm01, :subj),\n)\n\n\n\n\n\nFigure 10: Conditional means and 95% prediction intervals for subject random effects in elm01.\n\n\n\n\nshows definite distinctions between subjects because the widths of the prediction intervals are small compared to the range of the conditional modes. Also, there is at least one outlier with a conditional mode over 1.0.\nFigure 11 is the corresponding caterpillar plot for model elm02 fit to the data with inaccurate responders eliminated.\n\n\nCode\nqqcaterpillar!(\n  Figure(resolution=(800, 650)),\n  ranefinfo(elm02, :subj),\n)\n\n\n\n\n\nFigure 11: Conditional means and 95% prediction intervals for subject random effects in elm02."
    +    "text": "1.3 Models with scalar random effects\nA major purpose of the English Lexicon Project is to characterize the items (words or nonwords) according to the observed accuracy of identification and to response latency, taking into account subject-to-subject variability, and to relate these to lexical characteristics of the items.\nIn Balota et al. (2007) the item response latency is characterized by the average response latency from the correct trials after outlier removal.\nMixed-effects models allow us greater flexibility and, we hope, precision in characterizing the items by controlling for subject-to-subject variability and for item characteristics such as word/nonword and item length.\nWe begin with a model that has scalar random effects for item and for subject and incorporates fixed-effects for word/nonword and for item length and for the interaction of these terms.\n\n1.3.1 Establish the contrasts\nBecause there are a large number of items in the data set it is important to assign a Grouping() contrast to item (and, less importantly, to subj). For the isword factor we will use an EffectsCoding contrast with the base level as false. The non-words are assigned -1 in this contrast and the words are assigned +1. The wrdlen covariate is on its original scale but centered at 8 characters.\nThus the (Intercept) coefficient is the predicted speed of response for a typical subject and typical item (without regard to word/non-word status) of 8 characters.\nSet these contrasts\n\ncontrasts = Dict(\n  :subj => Grouping(),\n  :item => Grouping(),\n  :isword => EffectsCoding(; base=false),\n  :wrdlen => Center(8),\n)\n\nDict{Symbol, Any} with 4 entries:\n  :item   => Grouping()\n  :wrdlen => Center(8)\n  :isword => EffectsCoding(false, nothing)\n  :subj   => Grouping()\n\n\nand fit a first model with simple, scalar, random effects for subj and item.\n\nelm01 = let\n  form = @formula(\n    1000 / rt ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)\n  )\n  fit(MixedModel, form, pruned; contrasts)\nend\n\nMinimizing 53    Time: 0:00:03 (68.13 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n1.3758\n0.0090\n153.69\n<1e-99\n0.1185\n0.2550\n\n\nisword: true\n0.0625\n0.0005\n131.35\n<1e-99\n\n\n\n\nwrdlen(centered: 8)\n-0.0436\n0.0002\n-225.38\n<1e-99\n\n\n\n\nisword: true & wrdlen(centered: 8)\n-0.0056\n0.0002\n-28.83\n<1e-99\n\n\n\n\nResidual\n0.3781\n\n\n\n\n\n\n\n\n\n\nThe predicted response speed by word length and word/nonword status can be summarized as\n\neffects(Dict(:isword => [false, true], :wrdlen => 4:2:12), elm01)\n\n10×6 DataFrame\n\n\n\nRow\nwrdlen\nisword\n1000 / rt\nerr\nlower\nupper\n\n\n\nInt64\nBool\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\n4\nfalse\n1.46555\n0.00903111\n1.45652\n1.47458\n\n\n2\n6\nfalse\n1.38947\n0.00898124\n1.38049\n1.39845\n\n\n3\n8\nfalse\n1.31338\n0.00896459\n1.30442\n1.32235\n\n\n4\n10\nfalse\n1.2373\n0.00898134\n1.22832\n1.24628\n\n\n5\n12\nfalse\n1.16121\n0.00903129\n1.15218\n1.17025\n\n\n6\n4\ntrue\n1.6351\n0.0090311\n1.62607\n1.64413\n\n\n7\n6\ntrue\n1.5367\n0.00898124\n1.52772\n1.54569\n\n\n8\n8\ntrue\n1.43831\n0.00896459\n1.42934\n1.44727\n\n\n9\n10\ntrue\n1.33991\n0.00898133\n1.33092\n1.34889\n\n\n10\n12\ntrue\n1.24151\n0.00903128\n1.23248\n1.25054\n\n\n\n\n\n\nIf we restrict to only those subjects with 80% accuracy or greater the model becomes\n\nelm02 = let\n  form = @formula(\n    1000 / rt ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)\n  )\n  dat = @subset(pruned, :spropacc > 0.8)\n  fit(MixedModel, form, dat; contrasts)\nend\n\nMinimizing 72    Time: 0:00:03 (45.03 ms/it)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n1.3611\n0.0088\n153.98\n<1e-99\n0.1247\n0.2318\n\n\nisword: true\n0.0656\n0.0005\n133.72\n<1e-99\n\n\n\n\nwrdlen(centered: 8)\n-0.0444\n0.0002\n-222.65\n<1e-99\n\n\n\n\nisword: true & wrdlen(centered: 8)\n-0.0057\n0.0002\n-28.73\n<1e-99\n\n\n\n\nResidual\n0.3342\n\n\n\n\n\n\n\n\n\n\n\neffects(Dict(:isword => [false, true], :wrdlen => 4:2:12), elm02)\n\n10×6 DataFrame\n\n\n\nRow\nwrdlen\nisword\n1000 / rt\nerr\nlower\nupper\n\n\n\nInt64\nBool\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\n4\nfalse\n1.45036\n0.00892458\n1.44144\n1.45929\n\n\n2\n6\nfalse\n1.37297\n0.00887092\n1.3641\n1.38184\n\n\n3\n8\nfalse\n1.29557\n0.00885299\n1.28672\n1.30443\n\n\n4\n10\nfalse\n1.21818\n0.00887102\n1.20931\n1.22705\n\n\n5\n12\nfalse\n1.14078\n0.00892477\n1.13186\n1.14971\n\n\n6\n4\ntrue\n1.62735\n0.00892457\n1.61842\n1.63627\n\n\n7\n6\ntrue\n1.52702\n0.00887092\n1.51815\n1.53589\n\n\n8\n8\ntrue\n1.4267\n0.00885299\n1.41784\n1.43555\n\n\n9\n10\ntrue\n1.32637\n0.00887101\n1.3175\n1.33524\n\n\n10\n12\ntrue\n1.22605\n0.00892475\n1.21712\n1.23497\n\n\n\n\n\n\nThe differences in the fixed-effects parameter estimates between a model fit to the full data set and one fit to the data from accurate responders only, are small.\nHowever, the random effects for the item, while highly correlated, are not perfectly correlated.\n\n\nCode\nCairoMakie.activate!(; type=\"png\")\ndisallowmissing!(\n  leftjoin!(\n    byitem,\n    leftjoin!(\n      rename!(DataFrame(raneftables(elm01)[:item]), [:item, :elm01]),\n      rename!(DataFrame(raneftables(elm02)[:item]), [:item, :elm02]);\n      on=:item,\n    ),\n    on=:item,\n  ),\n)\ndisallowmissing!(\n  leftjoin!(\n    bysubj,\n    leftjoin!(\n      rename!(DataFrame(raneftables(elm01)[:subj]), [:subj, :elm01]),\n      rename!(DataFrame(raneftables(elm02)[:subj]), [:subj, :elm02]);\n      on=:subj,\n    ),\n    on=:subj,\n  ); error=false,\n)\ndraw(\n  data(byitem) * mapping(\n    :elm01 => \"Conditional means of item random effects for model elm01\",\n    :elm02 => \"Conditional means of item random effects for model elm02\";\n    color=:isword,\n  ) * visual(Scatter; alpha=0.2);\n  axis=(; width=600, height=600),\n)\n\n\n\n\n\nFigure 9: Conditional means of scalar random effects for item in model elm01, fit to the pruned data, versus those for model elm02, fit to the pruned data with inaccurate subjects removed.\n\n\n\n\n\n\n\n\n\n\nNote\n\n\n\nAdjust the alpha on Figure 9.\n\n\nFigure 9 is exactly of the form that would be expected in a sample from a correlated multivariate Gaussian distribution. The correlation of the two sets of conditional means is about 96%.\n\ncor(Matrix(select(byitem, :elm01, :elm02)))\n\n2×2 Matrix{Float64}:\n 1.0       0.958655\n 0.958655  1.0\n\n\nThese models take only a few seconds to fit on a modern laptop computer, which is quite remarkable given the size of the data set and the number of random effects.\nThe amount of time to fit more complex models will be much greater so we may want to move those fits to more powerful server computers. We can split the tasks of fitting and analyzing a model between computers by saving the optimization summary after the model fit and later creating the MixedModel object followed by restoring the optsum object.\n\nsaveoptsum(\"./fits/elm01.json\", elm01);\n\n\nelm01a = restoreoptsum!(\n  let\n    form = @formula(\n      1000 / rt ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)\n    )\n    MixedModel(form, pruned; contrasts)\n  end,\n  \"./fits/elm01.json\",\n)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n1.3758\n0.0090\n153.69\n<1e-99\n0.1185\n0.2550\n\n\nisword: true\n0.0625\n0.0005\n131.35\n<1e-99\n\n\n\n\nwrdlen(centered: 8)\n-0.0436\n0.0002\n-225.38\n<1e-99\n\n\n\n\nisword: true & wrdlen(centered: 8)\n-0.0056\n0.0002\n-28.83\n<1e-99\n\n\n\n\nResidual\n0.3781\n\n\n\n\n\n\n\n\n\n\nOther covariates associated with the item are available as\n\nelpldtitem = DataFrame(dataset(\"ELP_ldt_item\"))\ndescribe(elpldtitem)\n\n9×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nUnion…\nAny\nInt64\nType\n\n\n\n\n1\nitem\n\nAarod\n\nzuss\n0\nString\n\n\n2\nOrtho_N\n1.53309\n0\n1.0\n25\n0\nInt8\n\n\n3\nBG_Sum\n13938.4\n11\n13026.0\n59803\n177\nUnion{Missing, Int32}\n\n\n4\nBG_Mean\n1921.25\n5.5\n1907.0\n6910.0\n177\nUnion{Missing, Float32}\n\n\n5\nBG_Freq_By_Pos\n2043.08\n0\n1928.0\n6985\n4\nUnion{Missing, Int16}\n\n\n6\nitemno\n40481.5\n1\n40481.5\n80962\n0\nInt32\n\n\n7\nisword\n0.5\nfalse\n0.5\ntrue\n0\nBool\n\n\n8\nwrdlen\n7.9988\n1\n8.0\n21\n0\nInt8\n\n\n9\npairno\n20241.0\n1\n20241.0\n40481\n0\nInt32\n\n\n\n\n\n\nand those associated with the subject are\n\nelpldtsubj = DataFrame(dataset(\"ELP_ldt_subj\"))\ndescribe(elpldtsubj)\n\n20×7 DataFrame\n\n\n\nRow\nvariable\nmean\nmin\nmedian\nmax\nnmissing\neltype\n\n\n\nSymbol\nUnion…\nAny\nAny\nAny\nInt64\nType\n\n\n\n\n1\nsubj\n409.311\n1\n409.5\n816\n0\nInt16\n\n\n2\nuniv\n\nKansas\n\nWayne State\n0\nString\n\n\n3\nsex\n\nf\n\nm\n8\nUnion{Missing, String}\n\n\n4\nDOB\n\n1938-06-07\n\n1984-11-14\n0\nDate\n\n\n5\nMEQ\n44.4932\n19.0\n44.0\n75.0\n8\nUnion{Missing, Float32}\n\n\n6\nvision\n5.51169\n0\n6.0\n7\n1\nUnion{Missing, Int8}\n\n\n7\nhearing\n5.86101\n0\n6.0\n7\n1\nUnion{Missing, Int8}\n\n\n8\neducatn\n8.89681\n1\n12.0\n28\n0\nInt8\n\n\n9\nncorrct\n29.8505\n5\n30.0\n40\n18\nUnion{Missing, Int8}\n\n\n10\nrawscor\n31.9925\n13\n32.0\n40\n18\nUnion{Missing, Int8}\n\n\n11\nvocabAge\n17.8123\n10.3\n17.8\n21.0\n19\nUnion{Missing, Float32}\n\n\n12\nshipTime\n3.0861\n0\n3.0\n9\n1\nUnion{Missing, Int8}\n\n\n13\nreadTime\n2.50215\n0.0\n2.0\n15.0\n1\nUnion{Missing, Float32}\n\n\n14\npreshlth\n5.48708\n0\n6.0\n7\n1\nUnion{Missing, Int8}\n\n\n15\npasthlth\n4.92989\n0\n5.0\n7\n1\nUnion{Missing, Int8}\n\n\n16\nS1start\n\n2001-03-16T13:49:27\n2001-10-16T11:38:28.500\n2003-07-29T18:48:44\n0\nDateTime\n\n\n17\nS2start\n\n2001-03-19T10:00:35\n2001-10-19T14:24:19.500\n2003-07-30T13:07:45\n0\nDateTime\n\n\n18\nMEQstrt\n\n2001-03-22T18:32:00\n2001-10-23T11:26:13\n2003-07-30T14:30:49\n7\nUnion{Missing, DateTime}\n\n\n19\nfilename\n\n101DATA.LDT\n\nData998.LDT\n0\nString\n\n\n20\nfrstLang\n\nEnglish\n\nother\n8\nUnion{Missing, String}\n\n\n\n\n\n\nFor the simple model elm01 the estimated standard deviation of the random effects for subject is greater than that of the random effects for item, a common occurrence. A caterpillar plot, Figure 10,\n\n\nCode\nqqcaterpillar!(\n  Figure(resolution=(800, 650)),\n  ranefinfo(elm01, :subj),\n)\n\n\n\n\n\nFigure 10: Conditional means and 95% prediction intervals for subject random effects in elm01.\n\n\n\n\nshows definite distinctions between subjects because the widths of the prediction intervals are small compared to the range of the conditional modes. Also, there is at least one outlier with a conditional mode over 1.0.\nFigure 11 is the corresponding caterpillar plot for model elm02 fit to the data with inaccurate responders eliminated.\n\n\nCode\nqqcaterpillar!(\n  Figure(resolution=(800, 650)),\n  ranefinfo(elm02, :subj),\n)\n\n\n\n\n\nFigure 11: Conditional means and 95% prediction intervals for subject random effects in elm02."
       },
       {
         "objectID": "largescaledesigned.html#random-effects-from-the-simple-model-related-to-covariates",
    @@ -732,42 +732,42 @@
         "href": "profiling.html",
         "title": "Confidence intervals from profiled objective",
         "section": "",
    -    "text": "Statistical methods that are based on probability models can be used to provide us with a “best guess” of the value of parameters, such as the effect of a particular experimental treatment, in the form of a parameter estimate. In addition, the probability model can be used to assess the uncertainty in the estimate.\nOften the information about the uncertainty is reduced to a single number, a p-value for a test of a null hypothesis, such as the effect being zero, versus the alternative of a non-zero effect. But quoting a single number from a model fit to experimental data, which may have required considerable effort and expense to obtain, will often mean discarding a considerable amount of the information in the data. In the days when computing was expensive and labor-intensive this may have been unavoidable. However, modern computing hardware and software systems provide us with the opportunity of much more intensive evaluation of the uncertainty. At a minimum, instead of focussing solely on the question of whether a coefficient could reasonably be zero, we can formulate confidence intervals on individual parameter estimates or confidence regions on groups of parameters.\nWe have seen the used of a parametric bootstrap to create a sample from the distribution of the estimators of the parameters, and how such samples can be used to create coverage intervals. The bootstrap is based on simulating response vectors from the model that has been fit to the observed data and refitting the same model to these simulated responses.\nIn this section we explore another approach based on refitting the model, keeping the same responses but holding one of the parameters fixed at a specified value.\n\n\nLoad the packages to be used\n\n\nCode\nusing AlgebraOfGraphics\nusing CairoMakie\nusing MixedModels\nusing MixedModelsMakie\nusing Random\nusing SMLP2023: dataset\n\nCairoMakie.activate!(; type=\"svg\")\nimport ProgressMeter\nProgressMeter.ijulia_behavior(:clear)\n\n\nLoad the data and define the contrasts so that the coefficients for each of the experimental variables, load, spkr and prec, are positive.\n\ncontrasts = Dict( # base levels so estimates for speed are positive\n  :load => EffectsCoding(; base=\"yes\"),\n  :prec => EffectsCoding(; base=\"break\"),\n  :spkr => EffectsCoding(; base=\"old\"),\n)\nkb07 = Table(dataset(:kb07))\n\nTable with 7 columns and 1789 rows:\n      subj  item  spkr  prec      load  rt_trunc  rt_raw\n    ┌───────────────────────────────────────────────────\n 1  │ S030  I01   new   break     yes   2267      2267\n 2  │ S030  I02   old   maintain  no    3856      3856\n 3  │ S030  I03   old   break     no    1567      1567\n 4  │ S030  I04   new   maintain  no    1732      1732\n 5  │ S030  I05   new   break     no    2660      2660\n 6  │ S030  I06   old   maintain  yes   2763      2763\n 7  │ S030  I07   old   break     yes   3528      3528\n 8  │ S030  I08   new   maintain  yes   1741      1741\n 9  │ S030  I09   new   break     yes   3692      3692\n 10 │ S030  I10   old   maintain  no    1949      1949\n 11 │ S030  I11   old   break     no    2189      2189\n 12 │ S030  I12   new   maintain  no    2207      2207\n 13 │ S030  I13   new   break     no    2078      2078\n 14 │ S030  I14   old   maintain  yes   1901      1901\n 15 │ S030  I15   old   break     yes   4015      4015\n 16 │ S030  I16   new   maintain  yes   1880      1880\n 17 │ S030  I17   new   break     yes   1444      1444\n 18 │ S030  I18   old   maintain  no    1683      1683\n 19 │ S030  I19   old   break     no    2037      2037\n 20 │ S030  I20   new   maintain  no    1168      1168\n 21 │ S030  I21   new   break     no    1930      1930\n 22 │ S030  I22   old   maintain  yes   1843      1843\n 23 │ S030  I23   old   break     yes   4969      4969\n ⋮  │  ⋮     ⋮     ⋮       ⋮       ⋮       ⋮        ⋮\n\n\nNow we fit and profile a model. The response is defined as 1000 / rt_raw where rt_raw is measured in milliseconds. Thus the response being modeled is the speed measured in responses per second.\n\npr01 = let f = @formula 1000 / rt_raw ~\n    1 + load + spkr + prec + (1 + prec | item) + (1 | subj)\n  profile(fit(MixedModel, f, kb07; contrasts))\nend\nprintln(pr01.m) # model is a property of the profile object\n\nMinimizing 67    Time: 0:00:00 ( 9.68 ms/it)\n\n\nLinear mixed model fit by maximum likelihood\n :(1000 / rt_raw) ~ 1 + load + spkr + prec + (1 + prec | item) + (1 | subj)\n   logLik   -2 logLik     AIC       AICc        BIC    \n   846.2869 -1692.5738 -1674.5738 -1674.4726 -1625.1691\n\nVariance components:\n             Column      Variance  Std.Dev.   Corr.\nitem     (Intercept)     0.0061053 0.0781364\n         prec: maintain  0.0020476 0.0452502 -0.21\nsubj     (Intercept)     0.0054186 0.0736113\nResidual                 0.0194484 0.1394577\n Number of obs: 1789; levels of grouping factors: 32, 56\n\n  Fixed-effects parameters:\n──────────────────────────────────────────────────────\n                    Coef.  Std. Error      z  Pr(>|z|)\n──────────────────────────────────────────────────────\n(Intercept)     0.531523   0.0172749   30.77    <1e-99\nload: no        0.0212959  0.00329731   6.46    <1e-09\nspkr: new       0.011218   0.00329732   3.40    0.0007\nprec: maintain  0.0698293  0.00865212   8.07    <1e-15\n──────────────────────────────────────────────────────\n\n\nEvaluation of pr01 is similar to other model fits in these notes except that the call to fit is wrapped in a call to profile. Because the object returned from profile includes the original model fit as its m property, it is not necessary to save the original model fit separately.\n\n\n\nThe information from the profile is encapsulated in a table.\n\npr01.tbl\n\nTable with 15 columns and 249 rows:\n      p   ζ          β1        β2         β3         β4         σ         ⋯\n    ┌──────────────────────────────────────────────────────────────────────\n 1  │ σ   -4.11624   0.531525  0.021298   0.0112154  0.0698319  0.130088  ⋯\n 2  │ σ   -3.59106   0.531525  0.0212977  0.0112157  0.0698316  0.131224  ⋯\n 3  │ σ   -3.06898   0.531524  0.0212975  0.011216   0.0698313  0.13237   ⋯\n 4  │ σ   -2.54996   0.531524  0.0212972  0.0112164  0.069831   0.133526  ⋯\n 5  │ σ   -2.03399   0.531524  0.021297   0.0112167  0.0698307  0.134692  ⋯\n 6  │ σ   -1.52104   0.531524  0.0212967  0.011217   0.0698303  0.135868  ⋯\n 7  │ σ   -1.01107   0.531523  0.0212964  0.0112173  0.06983    0.137054  ⋯\n 8  │ σ   -0.504067  0.531523  0.0212961  0.0112177  0.0698297  0.138251  ⋯\n 9  │ σ   0.0        0.531523  0.0212959  0.011218   0.0698293  0.139458  ⋯\n 10 │ σ   0.501151   0.531523  0.0212956  0.0112184  0.069829   0.140675  ⋯\n 11 │ σ   0.999416   0.531522  0.0212953  0.0112187  0.0698286  0.141904  ⋯\n 12 │ σ   1.49482    0.531522  0.021295   0.0112191  0.0698282  0.143143  ⋯\n 13 │ σ   1.98739    0.531522  0.0212947  0.0112195  0.0698279  0.144392  ⋯\n 14 │ σ   2.47714    0.531521  0.0212944  0.0112199  0.0698275  0.145653  ⋯\n 15 │ σ   2.9641     0.531521  0.021294   0.0112202  0.0698271  0.146925  ⋯\n 16 │ σ   3.4483     0.531521  0.0212937  0.0112206  0.0698267  0.148208  ⋯\n 17 │ σ   3.92976    0.53152   0.0212934  0.011221   0.0698263  0.149502  ⋯\n 18 │ σ   4.4085     0.53152   0.0212931  0.0112214  0.0698259  0.150807  ⋯\n 19 │ β1  -4.15491   0.453786  0.0212914  0.0112175  0.0763344  0.139442  ⋯\n 20 │ β1  -3.75285   0.462423  0.0212917  0.0112177  0.0755073  0.139444  ⋯\n 21 │ β1  -3.33142   0.471061  0.0212921  0.0112179  0.074719   0.139446  ⋯\n 22 │ β1  -2.89208   0.479698  0.0212926  0.0112181  0.0739651  0.139448  ⋯\n 23 │ β1  -2.43663   0.488335  0.0212931  0.0112182  0.0732384  0.13945   ⋯\n ⋮  │ ⋮       ⋮         ⋮          ⋮          ⋮          ⋮         ⋮      ⋱\n\n\nEach row of the table summarizes a fit of the original model to the original data but with one of the parameters held fixed. For the first 18 rows of the table, the parameter being held fixed is \\(\\sigma\\), as shown in the p column. In the next set of rows the parameter being held fixed will be \\(\\beta_1\\), the intercept.\nThere are blocks of rows for the fixed-effects (\\(\\boldsymbol{\\beta}\\)) parameters, the variance components (on the scale of a standard deviation), and the \\(\\boldsymbol{\\theta}\\) parameters that generate the covariance factor \\(\\boldsymbol{\\Lambda}_{\\boldsymbol{\\theta}}\\). (At present the correlation parameters are not profiled - we may add them later but that computation is rather awkward.)\n\nshow(unique(pr01.tbl.p))\n\n[:σ, :β1, :β2, :β3, :β4, :θ1, :θ2, :θ3, :θ4, :σ1, :σ2, :σ3]\n\n\nTo reiterate, the first row contains the parameter estimates for this model fit to the original response values with the constraint that \\(\\sigma=0.130088\\), instead of the global estimate \\(\\hat{\\sigma}=0.139458\\) in the row for which \\(\\zeta=0.0\\).\nThe global estimates are included in every block at the row for which \\(\\zeta=0.0\\).\n\nfilter(r -> iszero(r.ζ), pr01.tbl)\n\nTable with 15 columns and 12 rows:\n      p   ζ    β1        β2         β3        β4         σ         σ1         ⋯\n    ┌──────────────────────────────────────────────────────────────────────────\n 1  │ σ   0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 2  │ β1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 3  │ β2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 4  │ β3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 5  │ β4  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 6  │ θ1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 7  │ θ2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 8  │ θ3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 9  │ θ4  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 10 │ σ1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 11 │ σ2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 12 │ σ3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n\n\nThe \\(\\zeta\\) column in this table is a measure of the quality of the fit from the parameters in each row, relative to the global parameter estimates, as measured by the change in the objective (negative twice the log-likelihood).\nThe minimum value for the objective is that at the global parameter estimates. The change in the objective when we constrain one parameter to a particular value has approximately a \\(\\chi^2\\) distribution on 1 degree of freedom, which is the square of a standard normal distribution, \\(\\mathcal{Z}^2\\). We can convert this change in the quality of the fit to the scale of the standard normal distribution by taking the signed square root, which is the square root of the change in the objective with the sign of \\(\\psi-\\hat{\\psi}\\) where \\(\\psi\\) represents the parameter being profiled. This is the value labelled \\(\\zeta\\) in the table.\nTo review:\n\nEach row in the table is the result of re-fitting the original model with the parameter in the p column held fixed at a particular value, as shown in the column for that parameter.\nThe \\(\\zeta\\) column is the signed square root of the change in the objective from the global parameter estimates.\nThus in the block of rows where \\(\\sigma\\) is held fixed, the \\(\\zeta\\) values in rows for which \\(\\sigma<\\hat\\sigma\\) are negative and those for which \\(\\sigma > \\hat\\sigma\\) have positive values of \\(\\zeta\\).\nRows in which \\(\\zeta=0.0\\) are the global parameter estimates.\n\n\n\n\nFigure 1 shows, for each of the fixed effects parameters, \\(\\zeta\\) versus the parameter value.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 350)), pr01; ptyp='β')\n\n\n\n\n\nFigure 1: ζ versus the value of the coefficient for the fixed-effects parameters in a model of response speed for the kb07 data.\n\n\n\n\nThe lines on these panels are read like normal probability plots, i.e. QQ plots against a standard normal distribution. Those on the \\(\\beta_2\\) and \\(\\beta_3\\) panels are, to the resolution of the plot, straight lines which indicates that the estimators of those parameters are normally distributed over the region of interest.\nThe points in the \\(\\beta_1\\) and \\(\\beta_4\\) panels are slightly over-dispersed relative to the straight line, which means that the estimators of these parameters are distributed like a T-distribution with a moderate number of degrees of freedom.\nThe profile-\\(\\zeta\\) function can be used to generate confidence intervals on the parameters\n\nconfint(pr01)\n\nDictTable with 3 columns and 8 rows:\n par   estimate   lower       upper\n ────┬─────────────────────────────────\n β1  │ 0.531523   0.497103    0.565942\n β2  │ 0.0212959  0.0148295   0.0277621\n β3  │ 0.011218   0.00475175  0.0176844\n β4  │ 0.0698293  0.0523046   0.0873562\n σ   │ 0.139458   0.13486     0.144322\n σ1  │ 0.0781364  0.0612443   0.103257\n σ2  │ 0.0452502  0.0338521   0.0618819\n σ3  │ 0.0736113  0.0600844   0.0916852\n\n\nas shown in Figure 2, which shows the absolute value of \\(\\zeta\\), which is simply the square root of the difference in the objective, versus the parameter being profiled.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='β', absv=true)\n\n\n\n\n\nFigure 2: Absolute value of ζ versus value of the coefficient for the fixed-effects parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence.\n\n\n\n\nThe 95% confidence intervals are the second horizontal lines from the top in each panel, at 1.96 on the vertical scale.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='σ', absv=true)\n\n\n\n\n\nFigure 3: Absolute value of ζ versus value of the coefficient for the variance component parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence.\n\n\n\n\nFigure 3 shows similar confidence intervals on the parameters representing standard deviations as does Figure 4 for the \\(\\theta\\) parameters.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='θ', absv=true)\n\n\n\n\n\nFigure 4: Absolute value of ζ versus parameter value for the θ parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence."
    +    "text": "Statistical methods that are based on probability models can be used to provide us with a “best guess” of the value of parameters, such as the effect of a particular experimental treatment, in the form of a parameter estimate. In addition, the probability model can be used to assess the uncertainty in the estimate.\nOften the information about the uncertainty is reduced to a single number, a p-value for a test of a null hypothesis, such as the effect being zero, versus the alternative of a non-zero effect. But quoting a single number from a model fit to experimental data, which may have required considerable effort and expense to obtain, will often mean discarding a considerable amount of the information in the data. In the days when computing was expensive and labor-intensive this may have been unavoidable. However, modern computing hardware and software systems provide us with the opportunity of much more intensive evaluation of the uncertainty. At a minimum, instead of focussing solely on the question of whether a coefficient could reasonably be zero, we can formulate confidence intervals on individual parameter estimates or confidence regions on groups of parameters.\nWe have seen the used of a parametric bootstrap to create a sample from the distribution of the estimators of the parameters, and how such samples can be used to create coverage intervals. The bootstrap is based on simulating response vectors from the model that has been fit to the observed data and refitting the same model to these simulated responses.\nIn this section we explore another approach based on refitting the model, keeping the same responses but holding one of the parameters fixed at a specified value.\n\n\nLoad the packages to be used\n\n\nCode\nusing AlgebraOfGraphics\nusing CairoMakie\nusing MixedModels\nusing MixedModelsMakie\nusing Random\nusing SMLP2023: dataset\n\nCairoMakie.activate!(; type=\"svg\")\nimport ProgressMeter\nProgressMeter.ijulia_behavior(:clear)\n\n\nLoad the data and define the contrasts so that the coefficients for each of the experimental variables, load, spkr and prec, are positive.\n\ncontrasts = Dict( # base levels so estimates for speed are positive\n  :load => EffectsCoding(; base=\"yes\"),\n  :prec => EffectsCoding(; base=\"break\"),\n  :spkr => EffectsCoding(; base=\"old\"),\n)\nkb07 = Table(dataset(:kb07))\n\nTable with 7 columns and 1789 rows:\n      subj  item  spkr  prec      load  rt_trunc  rt_raw\n    ┌───────────────────────────────────────────────────\n 1  │ S030  I01   new   break     yes   2267      2267\n 2  │ S030  I02   old   maintain  no    3856      3856\n 3  │ S030  I03   old   break     no    1567      1567\n 4  │ S030  I04   new   maintain  no    1732      1732\n 5  │ S030  I05   new   break     no    2660      2660\n 6  │ S030  I06   old   maintain  yes   2763      2763\n 7  │ S030  I07   old   break     yes   3528      3528\n 8  │ S030  I08   new   maintain  yes   1741      1741\n 9  │ S030  I09   new   break     yes   3692      3692\n 10 │ S030  I10   old   maintain  no    1949      1949\n 11 │ S030  I11   old   break     no    2189      2189\n 12 │ S030  I12   new   maintain  no    2207      2207\n 13 │ S030  I13   new   break     no    2078      2078\n 14 │ S030  I14   old   maintain  yes   1901      1901\n 15 │ S030  I15   old   break     yes   4015      4015\n 16 │ S030  I16   new   maintain  yes   1880      1880\n 17 │ S030  I17   new   break     yes   1444      1444\n 18 │ S030  I18   old   maintain  no    1683      1683\n 19 │ S030  I19   old   break     no    2037      2037\n 20 │ S030  I20   new   maintain  no    1168      1168\n 21 │ S030  I21   new   break     no    1930      1930\n 22 │ S030  I22   old   maintain  yes   1843      1843\n 23 │ S030  I23   old   break     yes   4969      4969\n ⋮  │  ⋮     ⋮     ⋮       ⋮       ⋮       ⋮        ⋮\n\n\nNow we fit and profile a model. The response is defined as 1000 / rt_raw where rt_raw is measured in milliseconds. Thus the response being modeled is the speed measured in responses per second.\n\npr01 = let f = @formula 1000 / rt_raw ~\n    1 + load + spkr + prec + (1 + prec | item) + (1 | subj)\n  profile(fit(MixedModel, f, kb07; contrasts))\nend\nprintln(pr01.m) # model is a property of the profile object\n\nMinimizing 67    Time: 0:00:00 ( 5.92 ms/it)\n\n\nLinear mixed model fit by maximum likelihood\n :(1000 / rt_raw) ~ 1 + load + spkr + prec + (1 + prec | item) + (1 | subj)\n   logLik   -2 logLik     AIC       AICc        BIC    \n   846.2869 -1692.5738 -1674.5738 -1674.4726 -1625.1691\n\nVariance components:\n             Column      Variance  Std.Dev.   Corr.\nitem     (Intercept)     0.0061053 0.0781364\n         prec: maintain  0.0020476 0.0452502 -0.21\nsubj     (Intercept)     0.0054186 0.0736113\nResidual                 0.0194484 0.1394577\n Number of obs: 1789; levels of grouping factors: 32, 56\n\n  Fixed-effects parameters:\n──────────────────────────────────────────────────────\n                    Coef.  Std. Error      z  Pr(>|z|)\n──────────────────────────────────────────────────────\n(Intercept)     0.531523   0.0172749   30.77    <1e-99\nload: no        0.0212959  0.00329731   6.46    <1e-09\nspkr: new       0.011218   0.00329732   3.40    0.0007\nprec: maintain  0.0698293  0.00865212   8.07    <1e-15\n──────────────────────────────────────────────────────\n\n\nEvaluation of pr01 is similar to other model fits in these notes except that the call to fit is wrapped in a call to profile. Because the object returned from profile includes the original model fit as its m property, it is not necessary to save the original model fit separately.\n\n\n\nThe information from the profile is encapsulated in a table.\n\npr01.tbl\n\nTable with 15 columns and 249 rows:\n      p   ζ          β1        β2         β3         β4         σ         ⋯\n    ┌──────────────────────────────────────────────────────────────────────\n 1  │ σ   -4.11624   0.531525  0.021298   0.0112154  0.0698319  0.130088  ⋯\n 2  │ σ   -3.59106   0.531525  0.0212977  0.0112157  0.0698316  0.131224  ⋯\n 3  │ σ   -3.06898   0.531524  0.0212975  0.011216   0.0698313  0.13237   ⋯\n 4  │ σ   -2.54996   0.531524  0.0212972  0.0112164  0.069831   0.133526  ⋯\n 5  │ σ   -2.03399   0.531524  0.021297   0.0112167  0.0698307  0.134692  ⋯\n 6  │ σ   -1.52104   0.531524  0.0212967  0.011217   0.0698303  0.135868  ⋯\n 7  │ σ   -1.01107   0.531523  0.0212964  0.0112173  0.06983    0.137054  ⋯\n 8  │ σ   -0.504067  0.531523  0.0212961  0.0112177  0.0698297  0.138251  ⋯\n 9  │ σ   0.0        0.531523  0.0212959  0.011218   0.0698293  0.139458  ⋯\n 10 │ σ   0.501151   0.531523  0.0212956  0.0112184  0.069829   0.140675  ⋯\n 11 │ σ   0.999416   0.531522  0.0212953  0.0112187  0.0698286  0.141904  ⋯\n 12 │ σ   1.49482    0.531522  0.021295   0.0112191  0.0698282  0.143143  ⋯\n 13 │ σ   1.98739    0.531522  0.0212947  0.0112195  0.0698279  0.144392  ⋯\n 14 │ σ   2.47714    0.531521  0.0212944  0.0112199  0.0698275  0.145653  ⋯\n 15 │ σ   2.9641     0.531521  0.021294   0.0112202  0.0698271  0.146925  ⋯\n 16 │ σ   3.4483     0.531521  0.0212937  0.0112206  0.0698267  0.148208  ⋯\n 17 │ σ   3.92976    0.53152   0.0212934  0.011221   0.0698263  0.149502  ⋯\n 18 │ σ   4.4085     0.53152   0.0212931  0.0112214  0.0698259  0.150807  ⋯\n 19 │ β1  -4.15491   0.453786  0.0212914  0.0112175  0.0763336  0.139442  ⋯\n 20 │ β1  -3.75285   0.462423  0.0212917  0.0112177  0.0755066  0.139444  ⋯\n 21 │ β1  -3.33142   0.471061  0.0212921  0.0112179  0.0747193  0.139446  ⋯\n 22 │ β1  -2.89208   0.479698  0.0212926  0.0112181  0.0739649  0.139448  ⋯\n 23 │ β1  -2.43663   0.488335  0.0212931  0.0112182  0.0732389  0.13945   ⋯\n ⋮  │ ⋮       ⋮         ⋮          ⋮          ⋮          ⋮         ⋮      ⋱\n\n\nEach row of the table summarizes a fit of the original model to the original data but with one of the parameters held fixed. For the first 18 rows of the table, the parameter being held fixed is \\(\\sigma\\), as shown in the p column. In the next set of rows the parameter being held fixed will be \\(\\beta_1\\), the intercept.\nThere are blocks of rows for the fixed-effects (\\(\\boldsymbol{\\beta}\\)) parameters, the variance components (on the scale of a standard deviation), and the \\(\\boldsymbol{\\theta}\\) parameters that generate the covariance factor \\(\\boldsymbol{\\Lambda}_{\\boldsymbol{\\theta}}\\). (At present the correlation parameters are not profiled - we may add them later but that computation is rather awkward.)\n\nshow(unique(pr01.tbl.p))\n\n[:σ, :β1, :β2, :β3, :β4, :θ1, :θ2, :θ3, :θ4, :σ1, :σ2, :σ3]\n\n\nTo reiterate, the first row contains the parameter estimates for this model fit to the original response values with the constraint that \\(\\sigma=0.130088\\), instead of the global estimate \\(\\hat{\\sigma}=0.139458\\) in the row for which \\(\\zeta=0.0\\).\nThe global estimates are included in every block at the row for which \\(\\zeta=0.0\\).\n\nfilter(r -> iszero(r.ζ), pr01.tbl)\n\nTable with 15 columns and 12 rows:\n      p   ζ    β1        β2         β3        β4         σ         σ1         ⋯\n    ┌──────────────────────────────────────────────────────────────────────────\n 1  │ σ   0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 2  │ β1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 3  │ β2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 4  │ β3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 5  │ β4  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 6  │ θ1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 7  │ θ2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 8  │ θ3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 9  │ θ4  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 10 │ σ1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 11 │ σ2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 12 │ σ3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n\n\nThe \\(\\zeta\\) column in this table is a measure of the quality of the fit from the parameters in each row, relative to the global parameter estimates, as measured by the change in the objective (negative twice the log-likelihood).\nThe minimum value for the objective is that at the global parameter estimates. The change in the objective when we constrain one parameter to a particular value has approximately a \\(\\chi^2\\) distribution on 1 degree of freedom, which is the square of a standard normal distribution, \\(\\mathcal{Z}^2\\). We can convert this change in the quality of the fit to the scale of the standard normal distribution by taking the signed square root, which is the square root of the change in the objective with the sign of \\(\\psi-\\hat{\\psi}\\) where \\(\\psi\\) represents the parameter being profiled. This is the value labelled \\(\\zeta\\) in the table.\nTo review:\n\nEach row in the table is the result of re-fitting the original model with the parameter in the p column held fixed at a particular value, as shown in the column for that parameter.\nThe \\(\\zeta\\) column is the signed square root of the change in the objective from the global parameter estimates.\nThus in the block of rows where \\(\\sigma\\) is held fixed, the \\(\\zeta\\) values in rows for which \\(\\sigma<\\hat\\sigma\\) are negative and those for which \\(\\sigma > \\hat\\sigma\\) have positive values of \\(\\zeta\\).\nRows in which \\(\\zeta=0.0\\) are the global parameter estimates.\n\n\n\n\nFigure 1 shows, for each of the fixed effects parameters, \\(\\zeta\\) versus the parameter value.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 350)), pr01; ptyp='β')\n\n\n\n\n\nFigure 1: ζ versus the value of the coefficient for the fixed-effects parameters in a model of response speed for the kb07 data.\n\n\n\n\nThe lines on these panels are read like normal probability plots, i.e. QQ plots against a standard normal distribution. Those on the \\(\\beta_2\\) and \\(\\beta_3\\) panels are, to the resolution of the plot, straight lines which indicates that the estimators of those parameters are normally distributed over the region of interest.\nThe points in the \\(\\beta_1\\) and \\(\\beta_4\\) panels are slightly over-dispersed relative to the straight line, which means that the estimators of these parameters are distributed like a T-distribution with a moderate number of degrees of freedom.\nThe profile-\\(\\zeta\\) function can be used to generate confidence intervals on the parameters\n\nconfint(pr01)\n\nDictTable with 3 columns and 8 rows:\n par   estimate   lower       upper\n ────┬─────────────────────────────────\n β1  │ 0.531523   0.497103    0.565942\n β2  │ 0.0212959  0.0148295   0.0277621\n β3  │ 0.011218   0.00475174  0.0176844\n β4  │ 0.0698293  0.0523046   0.0873562\n σ   │ 0.139458   0.13486     0.144322\n σ1  │ 0.0781364  0.0612443   0.103257\n σ2  │ 0.0452502  0.0338521   0.0618819\n σ3  │ 0.0736113  0.0600844   0.0916852\n\n\nas shown in Figure 2, which shows the absolute value of \\(\\zeta\\), which is simply the square root of the difference in the objective, versus the parameter being profiled.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='β', absv=true)\n\n\n\n\n\nFigure 2: Absolute value of ζ versus value of the coefficient for the fixed-effects parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence.\n\n\n\n\nThe 95% confidence intervals are the second horizontal lines from the top in each panel, at 1.96 on the vertical scale.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='σ', absv=true)\n\n\n\n\n\nFigure 3: Absolute value of ζ versus value of the coefficient for the variance component parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence.\n\n\n\n\nFigure 3 shows similar confidence intervals on the parameters representing standard deviations as does Figure 4 for the \\(\\theta\\) parameters.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='θ', absv=true)\n\n\n\n\n\nFigure 4: Absolute value of ζ versus parameter value for the θ parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence."
       },
       {
         "objectID": "profiling.html#profiling-a-model-for-the-kb07-data",
         "href": "profiling.html#profiling-a-model-for-the-kb07-data",
         "title": "Confidence intervals from profiled objective",
         "section": "",
    -    "text": "Load the packages to be used\n\n\nCode\nusing AlgebraOfGraphics\nusing CairoMakie\nusing MixedModels\nusing MixedModelsMakie\nusing Random\nusing SMLP2023: dataset\n\nCairoMakie.activate!(; type=\"svg\")\nimport ProgressMeter\nProgressMeter.ijulia_behavior(:clear)\n\n\nLoad the data and define the contrasts so that the coefficients for each of the experimental variables, load, spkr and prec, are positive.\n\ncontrasts = Dict( # base levels so estimates for speed are positive\n  :load => EffectsCoding(; base=\"yes\"),\n  :prec => EffectsCoding(; base=\"break\"),\n  :spkr => EffectsCoding(; base=\"old\"),\n)\nkb07 = Table(dataset(:kb07))\n\nTable with 7 columns and 1789 rows:\n      subj  item  spkr  prec      load  rt_trunc  rt_raw\n    ┌───────────────────────────────────────────────────\n 1  │ S030  I01   new   break     yes   2267      2267\n 2  │ S030  I02   old   maintain  no    3856      3856\n 3  │ S030  I03   old   break     no    1567      1567\n 4  │ S030  I04   new   maintain  no    1732      1732\n 5  │ S030  I05   new   break     no    2660      2660\n 6  │ S030  I06   old   maintain  yes   2763      2763\n 7  │ S030  I07   old   break     yes   3528      3528\n 8  │ S030  I08   new   maintain  yes   1741      1741\n 9  │ S030  I09   new   break     yes   3692      3692\n 10 │ S030  I10   old   maintain  no    1949      1949\n 11 │ S030  I11   old   break     no    2189      2189\n 12 │ S030  I12   new   maintain  no    2207      2207\n 13 │ S030  I13   new   break     no    2078      2078\n 14 │ S030  I14   old   maintain  yes   1901      1901\n 15 │ S030  I15   old   break     yes   4015      4015\n 16 │ S030  I16   new   maintain  yes   1880      1880\n 17 │ S030  I17   new   break     yes   1444      1444\n 18 │ S030  I18   old   maintain  no    1683      1683\n 19 │ S030  I19   old   break     no    2037      2037\n 20 │ S030  I20   new   maintain  no    1168      1168\n 21 │ S030  I21   new   break     no    1930      1930\n 22 │ S030  I22   old   maintain  yes   1843      1843\n 23 │ S030  I23   old   break     yes   4969      4969\n ⋮  │  ⋮     ⋮     ⋮       ⋮       ⋮       ⋮        ⋮\n\n\nNow we fit and profile a model. The response is defined as 1000 / rt_raw where rt_raw is measured in milliseconds. Thus the response being modeled is the speed measured in responses per second.\n\npr01 = let f = @formula 1000 / rt_raw ~\n    1 + load + spkr + prec + (1 + prec | item) + (1 | subj)\n  profile(fit(MixedModel, f, kb07; contrasts))\nend\nprintln(pr01.m) # model is a property of the profile object\n\nMinimizing 67    Time: 0:00:00 ( 9.68 ms/it)\n\n\nLinear mixed model fit by maximum likelihood\n :(1000 / rt_raw) ~ 1 + load + spkr + prec + (1 + prec | item) + (1 | subj)\n   logLik   -2 logLik     AIC       AICc        BIC    \n   846.2869 -1692.5738 -1674.5738 -1674.4726 -1625.1691\n\nVariance components:\n             Column      Variance  Std.Dev.   Corr.\nitem     (Intercept)     0.0061053 0.0781364\n         prec: maintain  0.0020476 0.0452502 -0.21\nsubj     (Intercept)     0.0054186 0.0736113\nResidual                 0.0194484 0.1394577\n Number of obs: 1789; levels of grouping factors: 32, 56\n\n  Fixed-effects parameters:\n──────────────────────────────────────────────────────\n                    Coef.  Std. Error      z  Pr(>|z|)\n──────────────────────────────────────────────────────\n(Intercept)     0.531523   0.0172749   30.77    <1e-99\nload: no        0.0212959  0.00329731   6.46    <1e-09\nspkr: new       0.011218   0.00329732   3.40    0.0007\nprec: maintain  0.0698293  0.00865212   8.07    <1e-15\n──────────────────────────────────────────────────────\n\n\nEvaluation of pr01 is similar to other model fits in these notes except that the call to fit is wrapped in a call to profile. Because the object returned from profile includes the original model fit as its m property, it is not necessary to save the original model fit separately."
    +    "text": "Load the packages to be used\n\n\nCode\nusing AlgebraOfGraphics\nusing CairoMakie\nusing MixedModels\nusing MixedModelsMakie\nusing Random\nusing SMLP2023: dataset\n\nCairoMakie.activate!(; type=\"svg\")\nimport ProgressMeter\nProgressMeter.ijulia_behavior(:clear)\n\n\nLoad the data and define the contrasts so that the coefficients for each of the experimental variables, load, spkr and prec, are positive.\n\ncontrasts = Dict( # base levels so estimates for speed are positive\n  :load => EffectsCoding(; base=\"yes\"),\n  :prec => EffectsCoding(; base=\"break\"),\n  :spkr => EffectsCoding(; base=\"old\"),\n)\nkb07 = Table(dataset(:kb07))\n\nTable with 7 columns and 1789 rows:\n      subj  item  spkr  prec      load  rt_trunc  rt_raw\n    ┌───────────────────────────────────────────────────\n 1  │ S030  I01   new   break     yes   2267      2267\n 2  │ S030  I02   old   maintain  no    3856      3856\n 3  │ S030  I03   old   break     no    1567      1567\n 4  │ S030  I04   new   maintain  no    1732      1732\n 5  │ S030  I05   new   break     no    2660      2660\n 6  │ S030  I06   old   maintain  yes   2763      2763\n 7  │ S030  I07   old   break     yes   3528      3528\n 8  │ S030  I08   new   maintain  yes   1741      1741\n 9  │ S030  I09   new   break     yes   3692      3692\n 10 │ S030  I10   old   maintain  no    1949      1949\n 11 │ S030  I11   old   break     no    2189      2189\n 12 │ S030  I12   new   maintain  no    2207      2207\n 13 │ S030  I13   new   break     no    2078      2078\n 14 │ S030  I14   old   maintain  yes   1901      1901\n 15 │ S030  I15   old   break     yes   4015      4015\n 16 │ S030  I16   new   maintain  yes   1880      1880\n 17 │ S030  I17   new   break     yes   1444      1444\n 18 │ S030  I18   old   maintain  no    1683      1683\n 19 │ S030  I19   old   break     no    2037      2037\n 20 │ S030  I20   new   maintain  no    1168      1168\n 21 │ S030  I21   new   break     no    1930      1930\n 22 │ S030  I22   old   maintain  yes   1843      1843\n 23 │ S030  I23   old   break     yes   4969      4969\n ⋮  │  ⋮     ⋮     ⋮       ⋮       ⋮       ⋮        ⋮\n\n\nNow we fit and profile a model. The response is defined as 1000 / rt_raw where rt_raw is measured in milliseconds. Thus the response being modeled is the speed measured in responses per second.\n\npr01 = let f = @formula 1000 / rt_raw ~\n    1 + load + spkr + prec + (1 + prec | item) + (1 | subj)\n  profile(fit(MixedModel, f, kb07; contrasts))\nend\nprintln(pr01.m) # model is a property of the profile object\n\nMinimizing 67    Time: 0:00:00 ( 5.92 ms/it)\n\n\nLinear mixed model fit by maximum likelihood\n :(1000 / rt_raw) ~ 1 + load + spkr + prec + (1 + prec | item) + (1 | subj)\n   logLik   -2 logLik     AIC       AICc        BIC    \n   846.2869 -1692.5738 -1674.5738 -1674.4726 -1625.1691\n\nVariance components:\n             Column      Variance  Std.Dev.   Corr.\nitem     (Intercept)     0.0061053 0.0781364\n         prec: maintain  0.0020476 0.0452502 -0.21\nsubj     (Intercept)     0.0054186 0.0736113\nResidual                 0.0194484 0.1394577\n Number of obs: 1789; levels of grouping factors: 32, 56\n\n  Fixed-effects parameters:\n──────────────────────────────────────────────────────\n                    Coef.  Std. Error      z  Pr(>|z|)\n──────────────────────────────────────────────────────\n(Intercept)     0.531523   0.0172749   30.77    <1e-99\nload: no        0.0212959  0.00329731   6.46    <1e-09\nspkr: new       0.011218   0.00329732   3.40    0.0007\nprec: maintain  0.0698293  0.00865212   8.07    <1e-15\n──────────────────────────────────────────────────────\n\n\nEvaluation of pr01 is similar to other model fits in these notes except that the call to fit is wrapped in a call to profile. Because the object returned from profile includes the original model fit as its m property, it is not necessary to save the original model fit separately."
       },
       {
         "objectID": "profiling.html#fixing-values-of-parameters",
         "href": "profiling.html#fixing-values-of-parameters",
         "title": "Confidence intervals from profiled objective",
         "section": "",
    -    "text": "The information from the profile is encapsulated in a table.\n\npr01.tbl\n\nTable with 15 columns and 249 rows:\n      p   ζ          β1        β2         β3         β4         σ         ⋯\n    ┌──────────────────────────────────────────────────────────────────────\n 1  │ σ   -4.11624   0.531525  0.021298   0.0112154  0.0698319  0.130088  ⋯\n 2  │ σ   -3.59106   0.531525  0.0212977  0.0112157  0.0698316  0.131224  ⋯\n 3  │ σ   -3.06898   0.531524  0.0212975  0.011216   0.0698313  0.13237   ⋯\n 4  │ σ   -2.54996   0.531524  0.0212972  0.0112164  0.069831   0.133526  ⋯\n 5  │ σ   -2.03399   0.531524  0.021297   0.0112167  0.0698307  0.134692  ⋯\n 6  │ σ   -1.52104   0.531524  0.0212967  0.011217   0.0698303  0.135868  ⋯\n 7  │ σ   -1.01107   0.531523  0.0212964  0.0112173  0.06983    0.137054  ⋯\n 8  │ σ   -0.504067  0.531523  0.0212961  0.0112177  0.0698297  0.138251  ⋯\n 9  │ σ   0.0        0.531523  0.0212959  0.011218   0.0698293  0.139458  ⋯\n 10 │ σ   0.501151   0.531523  0.0212956  0.0112184  0.069829   0.140675  ⋯\n 11 │ σ   0.999416   0.531522  0.0212953  0.0112187  0.0698286  0.141904  ⋯\n 12 │ σ   1.49482    0.531522  0.021295   0.0112191  0.0698282  0.143143  ⋯\n 13 │ σ   1.98739    0.531522  0.0212947  0.0112195  0.0698279  0.144392  ⋯\n 14 │ σ   2.47714    0.531521  0.0212944  0.0112199  0.0698275  0.145653  ⋯\n 15 │ σ   2.9641     0.531521  0.021294   0.0112202  0.0698271  0.146925  ⋯\n 16 │ σ   3.4483     0.531521  0.0212937  0.0112206  0.0698267  0.148208  ⋯\n 17 │ σ   3.92976    0.53152   0.0212934  0.011221   0.0698263  0.149502  ⋯\n 18 │ σ   4.4085     0.53152   0.0212931  0.0112214  0.0698259  0.150807  ⋯\n 19 │ β1  -4.15491   0.453786  0.0212914  0.0112175  0.0763344  0.139442  ⋯\n 20 │ β1  -3.75285   0.462423  0.0212917  0.0112177  0.0755073  0.139444  ⋯\n 21 │ β1  -3.33142   0.471061  0.0212921  0.0112179  0.074719   0.139446  ⋯\n 22 │ β1  -2.89208   0.479698  0.0212926  0.0112181  0.0739651  0.139448  ⋯\n 23 │ β1  -2.43663   0.488335  0.0212931  0.0112182  0.0732384  0.13945   ⋯\n ⋮  │ ⋮       ⋮         ⋮          ⋮          ⋮          ⋮         ⋮      ⋱\n\n\nEach row of the table summarizes a fit of the original model to the original data but with one of the parameters held fixed. For the first 18 rows of the table, the parameter being held fixed is \\(\\sigma\\), as shown in the p column. In the next set of rows the parameter being held fixed will be \\(\\beta_1\\), the intercept.\nThere are blocks of rows for the fixed-effects (\\(\\boldsymbol{\\beta}\\)) parameters, the variance components (on the scale of a standard deviation), and the \\(\\boldsymbol{\\theta}\\) parameters that generate the covariance factor \\(\\boldsymbol{\\Lambda}_{\\boldsymbol{\\theta}}\\). (At present the correlation parameters are not profiled - we may add them later but that computation is rather awkward.)\n\nshow(unique(pr01.tbl.p))\n\n[:σ, :β1, :β2, :β3, :β4, :θ1, :θ2, :θ3, :θ4, :σ1, :σ2, :σ3]\n\n\nTo reiterate, the first row contains the parameter estimates for this model fit to the original response values with the constraint that \\(\\sigma=0.130088\\), instead of the global estimate \\(\\hat{\\sigma}=0.139458\\) in the row for which \\(\\zeta=0.0\\).\nThe global estimates are included in every block at the row for which \\(\\zeta=0.0\\).\n\nfilter(r -> iszero(r.ζ), pr01.tbl)\n\nTable with 15 columns and 12 rows:\n      p   ζ    β1        β2         β3        β4         σ         σ1         ⋯\n    ┌──────────────────────────────────────────────────────────────────────────\n 1  │ σ   0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 2  │ β1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 3  │ β2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 4  │ β3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 5  │ β4  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 6  │ θ1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 7  │ θ2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 8  │ θ3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 9  │ θ4  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 10 │ σ1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 11 │ σ2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 12 │ σ3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n\n\nThe \\(\\zeta\\) column in this table is a measure of the quality of the fit from the parameters in each row, relative to the global parameter estimates, as measured by the change in the objective (negative twice the log-likelihood).\nThe minimum value for the objective is that at the global parameter estimates. The change in the objective when we constrain one parameter to a particular value has approximately a \\(\\chi^2\\) distribution on 1 degree of freedom, which is the square of a standard normal distribution, \\(\\mathcal{Z}^2\\). We can convert this change in the quality of the fit to the scale of the standard normal distribution by taking the signed square root, which is the square root of the change in the objective with the sign of \\(\\psi-\\hat{\\psi}\\) where \\(\\psi\\) represents the parameter being profiled. This is the value labelled \\(\\zeta\\) in the table.\nTo review:\n\nEach row in the table is the result of re-fitting the original model with the parameter in the p column held fixed at a particular value, as shown in the column for that parameter.\nThe \\(\\zeta\\) column is the signed square root of the change in the objective from the global parameter estimates.\nThus in the block of rows where \\(\\sigma\\) is held fixed, the \\(\\zeta\\) values in rows for which \\(\\sigma<\\hat\\sigma\\) are negative and those for which \\(\\sigma > \\hat\\sigma\\) have positive values of \\(\\zeta\\).\nRows in which \\(\\zeta=0.0\\) are the global parameter estimates."
    +    "text": "The information from the profile is encapsulated in a table.\n\npr01.tbl\n\nTable with 15 columns and 249 rows:\n      p   ζ          β1        β2         β3         β4         σ         ⋯\n    ┌──────────────────────────────────────────────────────────────────────\n 1  │ σ   -4.11624   0.531525  0.021298   0.0112154  0.0698319  0.130088  ⋯\n 2  │ σ   -3.59106   0.531525  0.0212977  0.0112157  0.0698316  0.131224  ⋯\n 3  │ σ   -3.06898   0.531524  0.0212975  0.011216   0.0698313  0.13237   ⋯\n 4  │ σ   -2.54996   0.531524  0.0212972  0.0112164  0.069831   0.133526  ⋯\n 5  │ σ   -2.03399   0.531524  0.021297   0.0112167  0.0698307  0.134692  ⋯\n 6  │ σ   -1.52104   0.531524  0.0212967  0.011217   0.0698303  0.135868  ⋯\n 7  │ σ   -1.01107   0.531523  0.0212964  0.0112173  0.06983    0.137054  ⋯\n 8  │ σ   -0.504067  0.531523  0.0212961  0.0112177  0.0698297  0.138251  ⋯\n 9  │ σ   0.0        0.531523  0.0212959  0.011218   0.0698293  0.139458  ⋯\n 10 │ σ   0.501151   0.531523  0.0212956  0.0112184  0.069829   0.140675  ⋯\n 11 │ σ   0.999416   0.531522  0.0212953  0.0112187  0.0698286  0.141904  ⋯\n 12 │ σ   1.49482    0.531522  0.021295   0.0112191  0.0698282  0.143143  ⋯\n 13 │ σ   1.98739    0.531522  0.0212947  0.0112195  0.0698279  0.144392  ⋯\n 14 │ σ   2.47714    0.531521  0.0212944  0.0112199  0.0698275  0.145653  ⋯\n 15 │ σ   2.9641     0.531521  0.021294   0.0112202  0.0698271  0.146925  ⋯\n 16 │ σ   3.4483     0.531521  0.0212937  0.0112206  0.0698267  0.148208  ⋯\n 17 │ σ   3.92976    0.53152   0.0212934  0.011221   0.0698263  0.149502  ⋯\n 18 │ σ   4.4085     0.53152   0.0212931  0.0112214  0.0698259  0.150807  ⋯\n 19 │ β1  -4.15491   0.453786  0.0212914  0.0112175  0.0763336  0.139442  ⋯\n 20 │ β1  -3.75285   0.462423  0.0212917  0.0112177  0.0755066  0.139444  ⋯\n 21 │ β1  -3.33142   0.471061  0.0212921  0.0112179  0.0747193  0.139446  ⋯\n 22 │ β1  -2.89208   0.479698  0.0212926  0.0112181  0.0739649  0.139448  ⋯\n 23 │ β1  -2.43663   0.488335  0.0212931  0.0112182  0.0732389  0.13945   ⋯\n ⋮  │ ⋮       ⋮         ⋮          ⋮          ⋮          ⋮         ⋮      ⋱\n\n\nEach row of the table summarizes a fit of the original model to the original data but with one of the parameters held fixed. For the first 18 rows of the table, the parameter being held fixed is \\(\\sigma\\), as shown in the p column. In the next set of rows the parameter being held fixed will be \\(\\beta_1\\), the intercept.\nThere are blocks of rows for the fixed-effects (\\(\\boldsymbol{\\beta}\\)) parameters, the variance components (on the scale of a standard deviation), and the \\(\\boldsymbol{\\theta}\\) parameters that generate the covariance factor \\(\\boldsymbol{\\Lambda}_{\\boldsymbol{\\theta}}\\). (At present the correlation parameters are not profiled - we may add them later but that computation is rather awkward.)\n\nshow(unique(pr01.tbl.p))\n\n[:σ, :β1, :β2, :β3, :β4, :θ1, :θ2, :θ3, :θ4, :σ1, :σ2, :σ3]\n\n\nTo reiterate, the first row contains the parameter estimates for this model fit to the original response values with the constraint that \\(\\sigma=0.130088\\), instead of the global estimate \\(\\hat{\\sigma}=0.139458\\) in the row for which \\(\\zeta=0.0\\).\nThe global estimates are included in every block at the row for which \\(\\zeta=0.0\\).\n\nfilter(r -> iszero(r.ζ), pr01.tbl)\n\nTable with 15 columns and 12 rows:\n      p   ζ    β1        β2         β3        β4         σ         σ1         ⋯\n    ┌──────────────────────────────────────────────────────────────────────────\n 1  │ σ   0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 2  │ β1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 3  │ β2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 4  │ β3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 5  │ β4  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 6  │ θ1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 7  │ θ2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 8  │ θ3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 9  │ θ4  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 10 │ σ1  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 11 │ σ2  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n 12 │ σ3  0.0  0.531523  0.0212959  0.011218  0.0698293  0.139458  0.0781364  ⋯\n\n\nThe \\(\\zeta\\) column in this table is a measure of the quality of the fit from the parameters in each row, relative to the global parameter estimates, as measured by the change in the objective (negative twice the log-likelihood).\nThe minimum value for the objective is that at the global parameter estimates. The change in the objective when we constrain one parameter to a particular value has approximately a \\(\\chi^2\\) distribution on 1 degree of freedom, which is the square of a standard normal distribution, \\(\\mathcal{Z}^2\\). We can convert this change in the quality of the fit to the scale of the standard normal distribution by taking the signed square root, which is the square root of the change in the objective with the sign of \\(\\psi-\\hat{\\psi}\\) where \\(\\psi\\) represents the parameter being profiled. This is the value labelled \\(\\zeta\\) in the table.\nTo review:\n\nEach row in the table is the result of re-fitting the original model with the parameter in the p column held fixed at a particular value, as shown in the column for that parameter.\nThe \\(\\zeta\\) column is the signed square root of the change in the objective from the global parameter estimates.\nThus in the block of rows where \\(\\sigma\\) is held fixed, the \\(\\zeta\\) values in rows for which \\(\\sigma<\\hat\\sigma\\) are negative and those for which \\(\\sigma > \\hat\\sigma\\) have positive values of \\(\\zeta\\).\nRows in which \\(\\zeta=0.0\\) are the global parameter estimates."
       },
       {
         "objectID": "profiling.html#profile-zeta-plots",
         "href": "profiling.html#profile-zeta-plots",
         "title": "Confidence intervals from profiled objective",
         "section": "",
    -    "text": "Figure 1 shows, for each of the fixed effects parameters, \\(\\zeta\\) versus the parameter value.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 350)), pr01; ptyp='β')\n\n\n\n\n\nFigure 1: ζ versus the value of the coefficient for the fixed-effects parameters in a model of response speed for the kb07 data.\n\n\n\n\nThe lines on these panels are read like normal probability plots, i.e. QQ plots against a standard normal distribution. Those on the \\(\\beta_2\\) and \\(\\beta_3\\) panels are, to the resolution of the plot, straight lines which indicates that the estimators of those parameters are normally distributed over the region of interest.\nThe points in the \\(\\beta_1\\) and \\(\\beta_4\\) panels are slightly over-dispersed relative to the straight line, which means that the estimators of these parameters are distributed like a T-distribution with a moderate number of degrees of freedom.\nThe profile-\\(\\zeta\\) function can be used to generate confidence intervals on the parameters\n\nconfint(pr01)\n\nDictTable with 3 columns and 8 rows:\n par   estimate   lower       upper\n ────┬─────────────────────────────────\n β1  │ 0.531523   0.497103    0.565942\n β2  │ 0.0212959  0.0148295   0.0277621\n β3  │ 0.011218   0.00475175  0.0176844\n β4  │ 0.0698293  0.0523046   0.0873562\n σ   │ 0.139458   0.13486     0.144322\n σ1  │ 0.0781364  0.0612443   0.103257\n σ2  │ 0.0452502  0.0338521   0.0618819\n σ3  │ 0.0736113  0.0600844   0.0916852\n\n\nas shown in Figure 2, which shows the absolute value of \\(\\zeta\\), which is simply the square root of the difference in the objective, versus the parameter being profiled.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='β', absv=true)\n\n\n\n\n\nFigure 2: Absolute value of ζ versus value of the coefficient for the fixed-effects parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence.\n\n\n\n\nThe 95% confidence intervals are the second horizontal lines from the top in each panel, at 1.96 on the vertical scale.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='σ', absv=true)\n\n\n\n\n\nFigure 3: Absolute value of ζ versus value of the coefficient for the variance component parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence.\n\n\n\n\nFigure 3 shows similar confidence intervals on the parameters representing standard deviations as does Figure 4 for the \\(\\theta\\) parameters.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='θ', absv=true)\n\n\n\n\n\nFigure 4: Absolute value of ζ versus parameter value for the θ parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence."
    +    "text": "Figure 1 shows, for each of the fixed effects parameters, \\(\\zeta\\) versus the parameter value.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 350)), pr01; ptyp='β')\n\n\n\n\n\nFigure 1: ζ versus the value of the coefficient for the fixed-effects parameters in a model of response speed for the kb07 data.\n\n\n\n\nThe lines on these panels are read like normal probability plots, i.e. QQ plots against a standard normal distribution. Those on the \\(\\beta_2\\) and \\(\\beta_3\\) panels are, to the resolution of the plot, straight lines which indicates that the estimators of those parameters are normally distributed over the region of interest.\nThe points in the \\(\\beta_1\\) and \\(\\beta_4\\) panels are slightly over-dispersed relative to the straight line, which means that the estimators of these parameters are distributed like a T-distribution with a moderate number of degrees of freedom.\nThe profile-\\(\\zeta\\) function can be used to generate confidence intervals on the parameters\n\nconfint(pr01)\n\nDictTable with 3 columns and 8 rows:\n par   estimate   lower       upper\n ────┬─────────────────────────────────\n β1  │ 0.531523   0.497103    0.565942\n β2  │ 0.0212959  0.0148295   0.0277621\n β3  │ 0.011218   0.00475174  0.0176844\n β4  │ 0.0698293  0.0523046   0.0873562\n σ   │ 0.139458   0.13486     0.144322\n σ1  │ 0.0781364  0.0612443   0.103257\n σ2  │ 0.0452502  0.0338521   0.0618819\n σ3  │ 0.0736113  0.0600844   0.0916852\n\n\nas shown in Figure 2, which shows the absolute value of \\(\\zeta\\), which is simply the square root of the difference in the objective, versus the parameter being profiled.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='β', absv=true)\n\n\n\n\n\nFigure 2: Absolute value of ζ versus value of the coefficient for the fixed-effects parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence.\n\n\n\n\nThe 95% confidence intervals are the second horizontal lines from the top in each panel, at 1.96 on the vertical scale.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='σ', absv=true)\n\n\n\n\n\nFigure 3: Absolute value of ζ versus value of the coefficient for the variance component parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence.\n\n\n\n\nFigure 3 shows similar confidence intervals on the parameters representing standard deviations as does Figure 4 for the \\(\\theta\\) parameters.\n\n\nCode\nzetaplot!(Figure(; resolution=(1200, 330)), pr01; ptyp='θ', absv=true)\n\n\n\n\n\nFigure 4: Absolute value of ζ versus parameter value for the θ parameters in a model of response speed for the kb07 data. The horizontal lines are confidence intervals with nominal 50%, 80%, 90%, 95% and 99% confidence."
       },
       {
         "objectID": "shrinkageplot.html",
         "href": "shrinkageplot.html",
         "title": "More on shrinkage plots",
         "section": "",
    -    "text": "I have stated that the likelihood criterion used to fit linear mixed-effects can be considered as balancing fidelity to the data (i.e. fits the observed data well) versus model complexity.\nThis is similar to some of the criterion used in Machine Learning (ML), except that the criterion for LMMs has a rigorous mathematical basis.\nIn the shrinkage plot we consider the values of the random-effects coefficients for the fitted values of the model versus those from a model in which there is no penalty for model complexity.\nIf there is strong subject-to-subject variation then the model fit will tend to values of the random effects similar to those without a penalty on complexity.\nIf the random effects term is not contributing much (i.e. it is “inert”) then the random effects will be shrunk considerably towards zero in some directions.\nCode\nusing CairoMakie\nusing DataFrames\nusing LinearAlgebra\nusing MixedModels\nusing MixedModelsMakie\nusing Random\nusing ProgressMeter\n\nProgressMeter.ijulia_behavior(:clear);\nLoad the kb07 data set (don’t tell Reinhold that I used these data).\nkb07 = MixedModels.dataset(:kb07)\n\nArrow.Table with 1789 rows, 7 columns, and schema:\n :subj      String\n :item      String\n :spkr      String\n :prec      String\n :load      String\n :rt_trunc  Int16\n :rt_raw    Int16\ncontrasts = Dict(\n  :subj => Grouping(),\n  :item => Grouping(),\n  :spkr => HelmertCoding(),\n  :prec => HelmertCoding(),\n  :load => HelmertCoding(),\n)\nm1 = let\n  form = @formula(\n    rt_trunc ~\n      1 +\n      spkr * prec * load +\n      (1 + spkr + prec + load | subj) +\n      (1 + spkr + prec + load | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\nMinimizing 799   Time: 0:00:01 ( 1.60 ms/it)\n  objective:  28637.123623229592\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\nσ_item\n\n\n\n\n(Intercept)\n2181.6729\n77.3136\n28.22\n<1e-99\n301.8062\n362.2579\n\n\nspkr: old\n67.7491\n18.2664\n3.71\n0.0002\n42.3795\n40.6807\n\n\nprec: maintain\n-333.9205\n47.1558\n-7.08\n<1e-11\n61.9630\n246.9158\n\n\nload: yes\n78.7702\n19.5298\n4.03\n<1e-04\n64.9751\n42.3890\n\n\nspkr: old & prec: maintain\n-21.9655\n15.8074\n-1.39\n0.1647\n\n\n\n\nspkr: old & load: yes\n18.3837\n15.8074\n1.16\n0.2448\n\n\n\n\nprec: maintain & load: yes\n4.5333\n15.8074\n0.29\n0.7743\n\n\n\n\nspkr: old & prec: maintain & load: yes\n23.6073\n15.8074\n1.49\n0.1353\n\n\n\n\nResidual\n668.5542\nVarCorr(m1)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\nsubj\n(Intercept)\n91087.0055\n301.8062\n\n\n\n\n\n\nspkr: old\n1796.0221\n42.3795\n+0.79\n\n\n\n\n\nprec: maintain\n3839.4126\n61.9630\n-0.59\n+0.02\n\n\n\n\nload: yes\n4221.7638\n64.9751\n+0.36\n+0.85\n+0.54\n\n\nitem\n(Intercept)\n131230.7914\n362.2579\n\n\n\n\n\n\nspkr: old\n1654.9232\n40.6807\n+0.44\n\n\n\n\n\nprec: maintain\n60967.4037\n246.9158\n-0.69\n+0.35\n\n\n\n\nload: yes\n1796.8284\n42.3890\n+0.32\n+0.16\n-0.14\n\n\nResidual\n\n446964.7062\n668.5542\nissingular(m1)\n\ntrue\nprint(m1)\n\nLinear mixed model fit by maximum likelihood\n rt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item)\n    logLik   -2 logLik      AIC         AICc        BIC     \n -14318.5618  28637.1236  28695.1236  28696.1128  28854.3166\n\nVariance components:\n             Column       Variance  Std.Dev.   Corr.\nsubj     (Intercept)      91087.0055 301.8062\n         spkr: old         1796.0221  42.3795 +0.79\n         prec: maintain    3839.4126  61.9630 -0.59 +0.02\n         load: yes         4221.7638  64.9751 +0.36 +0.85 +0.54\nitem     (Intercept)     131230.7914 362.2579\n         spkr: old         1654.9232  40.6807 +0.44\n         prec: maintain   60967.4037 246.9158 -0.69 +0.35\n         load: yes         1796.8284  42.3890 +0.32 +0.16 -0.14\nResidual                 446964.7062 668.5542\n Number of obs: 1789; levels of grouping factors: 56, 32\n\n  Fixed-effects parameters:\n───────────────────────────────────────────────────────────────────────────────\n                                             Coef.  Std. Error      z  Pr(>|z|)\n───────────────────────────────────────────────────────────────────────────────\n(Intercept)                             2181.67        77.3136  28.22    <1e-99\nspkr: old                                 67.7491      18.2664   3.71    0.0002\nprec: maintain                          -333.921       47.1558  -7.08    <1e-11\nload: yes                                 78.7702      19.5298   4.03    <1e-04\nspkr: old & prec: maintain               -21.9655      15.8074  -1.39    0.1647\nspkr: old & load: yes                     18.3837      15.8074   1.16    0.2448\nprec: maintain & load: yes                 4.53327     15.8074   0.29    0.7743\nspkr: old & prec: maintain & load: yes    23.6073      15.8074   1.49    0.1353\n───────────────────────────────────────────────────────────────────────────────"
    +    "text": "I have stated that the likelihood criterion used to fit linear mixed-effects can be considered as balancing fidelity to the data (i.e. fits the observed data well) versus model complexity.\nThis is similar to some of the criterion used in Machine Learning (ML), except that the criterion for LMMs has a rigorous mathematical basis.\nIn the shrinkage plot we consider the values of the random-effects coefficients for the fitted values of the model versus those from a model in which there is no penalty for model complexity.\nIf there is strong subject-to-subject variation then the model fit will tend to values of the random effects similar to those without a penalty on complexity.\nIf the random effects term is not contributing much (i.e. it is “inert”) then the random effects will be shrunk considerably towards zero in some directions.\nCode\nusing CairoMakie\nusing DataFrames\nusing LinearAlgebra\nusing MixedModels\nusing MixedModelsMakie\nusing Random\nusing ProgressMeter\n\nProgressMeter.ijulia_behavior(:clear);\nLoad the kb07 data set (don’t tell Reinhold that I used these data).\nkb07 = MixedModels.dataset(:kb07)\n\nArrow.Table with 1789 rows, 7 columns, and schema:\n :subj      String\n :item      String\n :spkr      String\n :prec      String\n :load      String\n :rt_trunc  Int16\n :rt_raw    Int16\ncontrasts = Dict(\n  :subj => Grouping(),\n  :item => Grouping(),\n  :spkr => HelmertCoding(),\n  :prec => HelmertCoding(),\n  :load => HelmertCoding(),\n)\nm1 = let\n  form = @formula(\n    rt_trunc ~\n      1 +\n      spkr * prec * load +\n      (1 + spkr + prec + load | subj) +\n      (1 + spkr + prec + load | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\nMinimizing 894   Time: 0:00:00 ( 0.15 ms/it)\n  objective:  28637.97101084821\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_subj\nσ_item\n\n\n\n\n(Intercept)\n2181.6424\n77.3505\n28.20\n<1e-99\n301.8688\n362.4643\n\n\nspkr: old\n67.7496\n17.9604\n3.77\n0.0002\n33.0582\n41.1114\n\n\nprec: maintain\n-333.9200\n47.1534\n-7.08\n<1e-11\n58.8506\n247.3123\n\n\nload: yes\n78.8006\n19.7270\n3.99\n<1e-04\n66.9612\n43.3929\n\n\nspkr: old & prec: maintain\n-21.9960\n15.8191\n-1.39\n0.1644\n\n\n\n\nspkr: old & load: yes\n18.3832\n15.8191\n1.16\n0.2452\n\n\n\n\nprec: maintain & load: yes\n4.5327\n15.8191\n0.29\n0.7745\n\n\n\n\nspkr: old & prec: maintain & load: yes\n23.6377\n15.8191\n1.49\n0.1351\n\n\n\n\nResidual\n669.0519\nVarCorr(m1)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\n\n\nsubj\n(Intercept)\n91124.7853\n301.8688\n\n\n\n\n\n\nspkr: old\n1092.8468\n33.0582\n+1.00\n\n\n\n\n\nprec: maintain\n3463.3971\n58.8506\n-0.62\n-0.62\n\n\n\n\nload: yes\n4483.7997\n66.9612\n+0.36\n+0.36\n+0.51\n\n\nitem\n(Intercept)\n131380.3392\n362.4643\n\n\n\n\n\n\nspkr: old\n1690.1464\n41.1114\n+0.42\n\n\n\n\n\nprec: maintain\n61163.3893\n247.3123\n-0.69\n+0.37\n\n\n\n\nload: yes\n1882.9463\n43.3929\n+0.29\n+0.14\n-0.13\n\n\nResidual\n\n447630.5113\n669.0519\nissingular(m1)\n\ntrue\nprint(m1)\n\nLinear mixed model fit by maximum likelihood\n rt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item)\n    logLik   -2 logLik      AIC         AICc        BIC     \n -14318.9855  28637.9710  28695.9710  28696.9602  28855.1640\n\nVariance components:\n             Column       Variance  Std.Dev.   Corr.\nsubj     (Intercept)      91124.7853 301.8688\n         spkr: old         1092.8468  33.0582 +1.00\n         prec: maintain    3463.3971  58.8506 -0.62 -0.62\n         load: yes         4483.7997  66.9612 +0.36 +0.36 +0.51\nitem     (Intercept)     131380.3392 362.4643\n         spkr: old         1690.1464  41.1114 +0.42\n         prec: maintain   61163.3893 247.3123 -0.69 +0.37\n         load: yes         1882.9463  43.3929 +0.29 +0.14 -0.13\nResidual                 447630.5113 669.0519\n Number of obs: 1789; levels of grouping factors: 56, 32\n\n  Fixed-effects parameters:\n───────────────────────────────────────────────────────────────────────────────\n                                             Coef.  Std. Error      z  Pr(>|z|)\n───────────────────────────────────────────────────────────────────────────────\n(Intercept)                             2181.64        77.3505  28.20    <1e-99\nspkr: old                                 67.7496      17.9604   3.77    0.0002\nprec: maintain                          -333.92        47.1534  -7.08    <1e-11\nload: yes                                 78.8006      19.727    3.99    <1e-04\nspkr: old & prec: maintain               -21.996       15.8191  -1.39    0.1644\nspkr: old & load: yes                     18.3832      15.8191   1.16    0.2452\nprec: maintain & load: yes                 4.53273     15.8191   0.29    0.7745\nspkr: old & prec: maintain & load: yes    23.6377      15.8191   1.49    0.1351\n───────────────────────────────────────────────────────────────────────────────"
       },
       {
         "objectID": "shrinkageplot.html#expressing-the-covariance-of-random-effects",
         "href": "shrinkageplot.html#expressing-the-covariance-of-random-effects",
         "title": "More on shrinkage plots",
         "section": "1 Expressing the covariance of random effects",
    -    "text": "1 Expressing the covariance of random effects\nEarlier today we mentioned that the parameters being optimized are from a “matrix square root” of the covariance matrix for the random effects. There is one such lower triangular matrix for each grouping factor.\n\nl1 = first(m1.λ)   # Cholesky factor of relative covariance for subj\n\n4×4 LowerTriangular{Float64, Matrix{Float64}}:\n  0.451431    ⋅           ⋅            ⋅ \n  0.0502903  0.0385895    ⋅            ⋅ \n -0.0550269  0.0745788   0.0           ⋅ \n  0.035189   0.090593   -0.000214038  0.0\n\n\nNotice the zero on the diagonal. A triangular matrix with zeros on the diagonal is singular.\n\nl2 = last(m1.λ)    # this one is also singular\n\n4×4 LowerTriangular{Float64, Matrix{Float64}}:\n  0.541853    ⋅           ⋅          ⋅ \n  0.0268744  0.0545925    ⋅          ⋅ \n -0.253091   0.268002    0.0228756   ⋅ \n  0.0199967  0.00128943  0.0601543  0.0\n\n\nTo regenerate the covariance matrix we need to know that the covariance is not the square of l1, it is l1 * l1' (so that the result is symmetric) and multiplied by σ̂²\n\nΣ₁ = varest(m1) .* (l1 * l1')\n\n4×4 Matrix{Float64}:\n  91087.0   10147.3     -11103.0     7100.22\n  10147.3    1796.02        49.4502  2353.54\n -11103.0      49.4502    3839.41    2154.36\n   7100.22   2353.54      2154.36    4221.76\n\n\n\ndiag(Σ₁)  # compare to the variance column in the VarCorr output\n\n4-element Vector{Float64}:\n 91087.0054784778\n  1796.0221392123499\n  3839.4125796885137\n  4221.763756192171\n\n\n\nsqrt.(diag(Σ₁))\n\n4-element Vector{Float64}:\n 301.8062383027856\n  42.37950140353647\n  61.96299363078348\n  64.9751010479566"
    +    "text": "1 Expressing the covariance of random effects\nEarlier today we mentioned that the parameters being optimized are from a “matrix square root” of the covariance matrix for the random effects. There is one such lower triangular matrix for each grouping factor.\n\nl1 = first(m1.λ)   # Cholesky factor of relative covariance for subj\n\n4×4 LowerTriangular{Float64, Matrix{Float64}}:\n  0.451189     ⋅          ⋅          ⋅ \n  0.0494106   0.0         ⋅          ⋅ \n -0.0547469  -0.0513393  0.0458719   ⋅ \n  0.0359041  -0.0696631  0.0622471  0.0\n\n\nNotice the zero on the diagonal. A triangular matrix with zeros on the diagonal is singular.\n\nl2 = last(m1.λ)    # this one is also singular\n\n4×4 LowerTriangular{Float64, Matrix{Float64}}:\n  0.541758    ⋅            ⋅          ⋅ \n  0.0259285  0.0557088     ⋅          ⋅ \n -0.253763   0.267835     0.0225072   ⋅ \n  0.0189267  0.000899324  0.0620278  0.0\n\n\nTo regenerate the covariance matrix we need to know that the covariance is not the square of l1, it is l1 * l1' (so that the result is symmetric) and multiplied by σ̂²\n\nΣ₁ = varest(m1) .* (l1 * l1')\n\n4×4 Matrix{Float64}:\n  91124.8    9979.25   -11057.0   7251.4\n   9979.25   1092.85    -1210.87   794.114\n -11057.0   -1210.87     3463.4   1999.21\n   7251.4     794.114    1999.21  4483.8\n\n\n\ndiag(Σ₁)  # compare to the variance column in the VarCorr output\n\n4-element Vector{Float64}:\n 91124.78532128147\n  1092.8467662686182\n  3463.397109629657\n  4483.799720678472\n\n\n\nsqrt.(diag(Σ₁))\n\n4-element Vector{Float64}:\n 301.8688213798859\n  33.05823295744372\n  58.85063389318468\n  66.96118069955511"
       },
       {
         "objectID": "shrinkageplot.html#shrinkage-plots",
    @@ -788,7 +788,7 @@
         "href": "shrinkageplot.html#conclusions-from-these-plots",
         "title": "More on shrinkage plots",
         "section": "4 Conclusions from these plots",
    -    "text": "4 Conclusions from these plots\n\nOnly the intercept for the subj appears to be contributing explanatory power\nFor the item both the intercept and the spkr appear to be contributing\n\n\nm2 = let\n  form = @formula(\n    rt_trunc ~\n      1 + prec * spkr * load + (1 | subj) + (1 + prec | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.7582\n77.4709\n28.16\n<1e-99\n364.7286\n298.1109\n\n\nprec: maintain\n-333.8582\n47.4629\n-7.03\n<1e-11\n252.6687\n\n\n\nspkr: old\n67.8114\n16.0526\n4.22\n<1e-04\n\n\n\n\nload: yes\n78.6849\n16.0525\n4.90\n<1e-06\n\n\n\n\nprec: maintain & spkr: old\n-21.8802\n16.0525\n-1.36\n0.1729\n\n\n\n\nprec: maintain & load: yes\n4.4710\n16.0526\n0.28\n0.7806\n\n\n\n\nspkr: old & load: yes\n18.3214\n16.0526\n1.14\n0.2537\n\n\n\n\nprec: maintain & spkr: old & load: yes\n23.5219\n16.0525\n1.47\n0.1428\n\n\n\n\nResidual\n678.9318\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m2)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133026.918\n364.729\n\n\n\n\nprec: maintain\n63841.496\n252.669\n-0.70\n\n\nsubj\n(Intercept)\n88870.080\n298.111\n\n\n\nResidual\n\n460948.432\n678.932\n\n\n\n\n\n\n\n\nCode\nshrinkageplot(m2)\n\n\n\n\n\nFigure 2: Shrinkage plot of model m2\n\n\n\n\n\nm3 = let\n  form = @formula(\n    rt_trunc ~\n      1 + prec + spkr + load + (1 | subj) + (1 + prec | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.8526\n77.4681\n28.16\n<1e-99\n364.7125\n298.0259\n\n\nprec: maintain\n-333.7906\n47.4472\n-7.03\n<1e-11\n252.5212\n\n\n\nspkr: old\n67.8790\n16.0785\n4.22\n<1e-04\n\n\n\n\nload: yes\n78.5904\n16.0785\n4.89\n<1e-05\n\n\n\n\nResidual\n680.0319\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m3)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133015.242\n364.713\n\n\n\n\nprec: maintain\n63766.935\n252.521\n-0.70\n\n\nsubj\n(Intercept)\n88819.438\n298.026\n\n\n\nResidual\n\n462443.388\n680.032\n\n\n\n\n\n\n\nrng = Random.seed!(1234321);\n\n\nm3btstrp = parametricbootstrap(rng, 2000, m3);\n\n\nDataFrame(shortestcovint(m3btstrp))\n\n9×5 DataFrame\n\n\n\nRow\ntype\ngroup\nnames\nlower\nupper\n\n\n\nString\nString?\nString?\nFloat64\nFloat64\n\n\n\n\n1\nβ\nmissing\n(Intercept)\n2013.95\n2319.53\n\n\n2\nβ\nmissing\nprec: maintain\n-429.807\n-241.429\n\n\n3\nβ\nmissing\nspkr: old\n35.3339\n95.7272\n\n\n4\nβ\nmissing\nload: yes\n47.067\n111.04\n\n\n5\nσ\nitem\n(Intercept)\n267.788\n452.9\n\n\n6\nσ\nitem\nprec: maintain\n171.547\n314.702\n\n\n7\nρ\nitem\n(Intercept), prec: maintain\n-0.89308\n-0.457084\n\n\n8\nσ\nsubj\n(Intercept)\n235.922\n364.717\n\n\n9\nσ\nresidual\nmissing\n657.736\n703.054\n\n\n\n\n\n\n\nridgeplot(m3btstrp)\n\n\n\n\nFigure 3: Ridge plot of the fixed-effects coefficients from the bootstrap sample\n\n\n\n\n\nridgeplot(m3btstrp; show_intercept=false)\n\n\n\n\nFigure 4: Ridge plot of the fixed-effects coefficients from the bootstrap sample (with the intercept)\n\n\n\n\n\nm4 = let\n  form = @formula(\n    rt_trunc ~\n      1 + prec + spkr + load + (1 + prec | item) + (1 | subj)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.8526\n77.4681\n28.16\n<1e-99\n364.7125\n298.0259\n\n\nprec: maintain\n-333.7906\n47.4472\n-7.03\n<1e-11\n252.5212\n\n\n\nspkr: old\n67.8790\n16.0785\n4.22\n<1e-04\n\n\n\n\nload: yes\n78.5904\n16.0785\n4.89\n<1e-05\n\n\n\n\nResidual\n680.0319\n\n\n\n\n\n\n\n\n\n\n\nm4bstrp = parametricbootstrap(rng, 2000, m4);\n\n\nridgeplot(m4bstrp; show_intercept=false)\n\n\n\n\n\nDataFrame(shortestcovint(m4bstrp))\n\n9×5 DataFrame\n\n\n\nRow\ntype\ngroup\nnames\nlower\nupper\n\n\n\nString\nString?\nString?\nFloat64\nFloat64\n\n\n\n\n1\nβ\nmissing\n(Intercept)\n2030.75\n2342.66\n\n\n2\nβ\nmissing\nprec: maintain\n-432.619\n-249.063\n\n\n3\nβ\nmissing\nspkr: old\n35.4729\n97.9576\n\n\n4\nβ\nmissing\nload: yes\n47.0469\n108.272\n\n\n5\nσ\nitem\n(Intercept)\n261.52\n444.426\n\n\n6\nσ\nitem\nprec: maintain\n177.803\n318.379\n\n\n7\nρ\nitem\n(Intercept), prec: maintain\n-0.904904\n-0.477346\n\n\n8\nσ\nsubj\n(Intercept)\n234.299\n361.964\n\n\n9\nσ\nresidual\nmissing\n657.11\n701.879\n\n\n\n\n\n\n\nVarCorr(m4)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133015.242\n364.713\n\n\n\n\nprec: maintain\n63766.935\n252.521\n-0.70\n\n\nsubj\n(Intercept)\n88819.438\n298.026\n\n\n\nResidual\n\n462443.388\n680.032\n\n\n\n\n\n\n\n\nCode\nlet mods = [m1, m2, m4]\n  DataFrame(;\n    geomdof=(sum ∘ leverage).(mods),\n    npar=dof.(mods),\n    deviance=deviance.(mods),\n    AIC=aic.(mods),\n    BIC=bic.(mods),\n    AICc=aicc.(mods),\n  )\nend\n\n\n3×6 DataFrame\n\n\n\nRow\ngeomdof\nnpar\ndeviance\nAIC\nBIC\nAICc\n\n\n\nFloat64\nInt64\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\n131.284\n29\n28637.1\n28695.1\n28854.3\n28696.1\n\n\n2\n107.543\n13\n28658.5\n28684.5\n28755.8\n28684.7\n\n\n3\n103.478\n9\n28663.9\n28681.9\n28731.3\n28682.0\n\n\n\n\n\n\n\nscatter(fitted(m4), residuals(m4))\n\n\n\n\nFigure 5: Residuals versus fitted values for model m4"
    +    "text": "4 Conclusions from these plots\n\nOnly the intercept for the subj appears to be contributing explanatory power\nFor the item both the intercept and the spkr appear to be contributing\n\n\nm2 = let\n  form = @formula(\n    rt_trunc ~\n      1 + prec * spkr * load + (1 | subj) + (1 + prec | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.7582\n77.4709\n28.16\n<1e-99\n364.7286\n298.1109\n\n\nprec: maintain\n-333.8582\n47.4629\n-7.03\n<1e-11\n252.6687\n\n\n\nspkr: old\n67.8114\n16.0526\n4.22\n<1e-04\n\n\n\n\nload: yes\n78.6849\n16.0525\n4.90\n<1e-06\n\n\n\n\nprec: maintain & spkr: old\n-21.8802\n16.0525\n-1.36\n0.1729\n\n\n\n\nprec: maintain & load: yes\n4.4710\n16.0526\n0.28\n0.7806\n\n\n\n\nspkr: old & load: yes\n18.3214\n16.0526\n1.14\n0.2537\n\n\n\n\nprec: maintain & spkr: old & load: yes\n23.5219\n16.0525\n1.47\n0.1428\n\n\n\n\nResidual\n678.9318\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m2)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133026.918\n364.729\n\n\n\n\nprec: maintain\n63841.496\n252.669\n-0.70\n\n\nsubj\n(Intercept)\n88870.081\n298.111\n\n\n\nResidual\n\n460948.432\n678.932\n\n\n\n\n\n\n\n\nCode\nshrinkageplot(m2)\n\n\n\n\n\nFigure 2: Shrinkage plot of model m2\n\n\n\n\n\nm3 = let\n  form = @formula(\n    rt_trunc ~\n      1 + prec + spkr + load + (1 | subj) + (1 + prec | item)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.8526\n77.4681\n28.16\n<1e-99\n364.7125\n298.0259\n\n\nprec: maintain\n-333.7906\n47.4472\n-7.03\n<1e-11\n252.5212\n\n\n\nspkr: old\n67.8790\n16.0785\n4.22\n<1e-04\n\n\n\n\nload: yes\n78.5904\n16.0785\n4.89\n<1e-05\n\n\n\n\nResidual\n680.0319\n\n\n\n\n\n\n\n\n\n\n\nVarCorr(m3)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133015.243\n364.713\n\n\n\n\nprec: maintain\n63766.936\n252.521\n-0.70\n\n\nsubj\n(Intercept)\n88819.436\n298.026\n\n\n\nResidual\n\n462443.388\n680.032\n\n\n\n\n\n\n\nrng = Random.seed!(1234321);\n\n\nm3btstrp = parametricbootstrap(rng, 2000, m3);\n\n\nDataFrame(shortestcovint(m3btstrp))\n\n9×5 DataFrame\n\n\n\nRow\ntype\ngroup\nnames\nlower\nupper\n\n\n\nString\nString?\nString?\nFloat64\nFloat64\n\n\n\n\n1\nβ\nmissing\n(Intercept)\n2013.95\n2319.53\n\n\n2\nβ\nmissing\nprec: maintain\n-429.807\n-241.429\n\n\n3\nβ\nmissing\nspkr: old\n35.3339\n95.7272\n\n\n4\nβ\nmissing\nload: yes\n47.067\n111.04\n\n\n5\nσ\nitem\n(Intercept)\n267.788\n452.9\n\n\n6\nσ\nitem\nprec: maintain\n171.547\n314.704\n\n\n7\nρ\nitem\n(Intercept), prec: maintain\n-0.893081\n-0.457084\n\n\n8\nσ\nsubj\n(Intercept)\n235.921\n364.717\n\n\n9\nσ\nresidual\nmissing\n657.736\n703.06\n\n\n\n\n\n\n\nridgeplot(m3btstrp)\n\n\n\n\nFigure 3: Ridge plot of the fixed-effects coefficients from the bootstrap sample\n\n\n\n\n\nridgeplot(m3btstrp; show_intercept=false)\n\n\n\n\nFigure 4: Ridge plot of the fixed-effects coefficients from the bootstrap sample (with the intercept)\n\n\n\n\n\nm4 = let\n  form = @formula(\n    rt_trunc ~\n      1 + prec + spkr + load + (1 + prec | item) + (1 | subj)\n  )\n  fit(MixedModel, form, kb07; contrasts)\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEst.\nSE\nz\np\nσ_item\nσ_subj\n\n\n\n\n(Intercept)\n2181.8526\n77.4681\n28.16\n<1e-99\n364.7125\n298.0259\n\n\nprec: maintain\n-333.7906\n47.4472\n-7.03\n<1e-11\n252.5212\n\n\n\nspkr: old\n67.8790\n16.0785\n4.22\n<1e-04\n\n\n\n\nload: yes\n78.5904\n16.0785\n4.89\n<1e-05\n\n\n\n\nResidual\n680.0319\n\n\n\n\n\n\n\n\n\n\n\nm4bstrp = parametricbootstrap(rng, 2000, m4);\n\n\nridgeplot(m4bstrp; show_intercept=false)\n\n\n\n\n\nDataFrame(shortestcovint(m4bstrp))\n\n9×5 DataFrame\n\n\n\nRow\ntype\ngroup\nnames\nlower\nupper\n\n\n\nString\nString?\nString?\nFloat64\nFloat64\n\n\n\n\n1\nβ\nmissing\n(Intercept)\n2030.75\n2342.66\n\n\n2\nβ\nmissing\nprec: maintain\n-432.619\n-249.063\n\n\n3\nβ\nmissing\nspkr: old\n35.4729\n97.9576\n\n\n4\nβ\nmissing\nload: yes\n47.0469\n108.272\n\n\n5\nσ\nitem\n(Intercept)\n261.52\n444.426\n\n\n6\nσ\nitem\nprec: maintain\n177.803\n318.382\n\n\n7\nρ\nitem\n(Intercept), prec: maintain\n-0.904909\n-0.477346\n\n\n8\nσ\nsubj\n(Intercept)\n234.301\n361.964\n\n\n9\nσ\nresidual\nmissing\n657.11\n701.879\n\n\n\n\n\n\n\nVarCorr(m4)\n\n\n\n\n\nColumn\nVariance\nStd.Dev\nCorr.\n\n\n\n\nitem\n(Intercept)\n133015.243\n364.713\n\n\n\n\nprec: maintain\n63766.936\n252.521\n-0.70\n\n\nsubj\n(Intercept)\n88819.436\n298.026\n\n\n\nResidual\n\n462443.388\n680.032\n\n\n\n\n\n\n\n\nCode\nlet mods = [m1, m2, m4]\n  DataFrame(;\n    geomdof=(sum ∘ leverage).(mods),\n    npar=dof.(mods),\n    deviance=deviance.(mods),\n    AIC=aic.(mods),\n    BIC=bic.(mods),\n    AICc=aicc.(mods),\n  )\nend\n\n\n3×6 DataFrame\n\n\n\nRow\ngeomdof\nnpar\ndeviance\nAIC\nBIC\nAICc\n\n\n\nFloat64\nInt64\nFloat64\nFloat64\nFloat64\nFloat64\n\n\n\n\n1\n130.126\n29\n28638.0\n28696.0\n28855.2\n28697.0\n\n\n2\n107.543\n13\n28658.5\n28684.5\n28755.8\n28684.7\n\n\n3\n103.478\n9\n28663.9\n28681.9\n28731.3\n28682.0\n\n\n\n\n\n\n\nscatter(fitted(m4), residuals(m4))\n\n\n\n\nFigure 5: Residuals versus fitted values for model m4"
       },
       {
         "objectID": "sleepstudy_speed.html",
    diff --git a/shrinkageplot.html b/shrinkageplot.html
    index 1b174d0..4208773 100644
    --- a/shrinkageplot.html
    +++ b/shrinkageplot.html
    @@ -370,7 +370,7 @@ 

    More on shrinkage plots

  • If there is strong subject-to-subject variation then the model fit will tend to values of the random effects similar to those without a penalty on complexity.
  • If the random effects term is not contributing much (i.e. it is “inert”) then the random effects will be shrunk considerably towards zero in some directions.
  • -
    +
    Code
    using CairoMakie
    @@ -385,9 +385,9 @@ 

    More on shrinkage plots

    Load the kb07 data set (don’t tell Reinhold that I used these data).

    -
    +
    kb07 = MixedModels.dataset(:kb07)
    -
    +
    Arrow.Table with 1789 rows, 7 columns, and schema:
      :subj      String
      :item      String
    @@ -398,7 +398,7 @@ 

    More on shrinkage plots

    :rt_raw Int16
    -
    +
    contrasts = Dict(
       :subj => Grouping(),
       :item => Grouping(),
    @@ -417,10 +417,10 @@ 

    More on shrinkage plots

    fit(MixedModel, form, kb07; contrasts) end
    -
    Minimizing 799   Time: 0:00:01 ( 1.60 ms/it)
    -  objective:  28637.123623229592
    +
    Minimizing 894   Time: 0:00:00 ( 0.15 ms/it)
    +  objective:  28637.97101084821
    -
    +

    false 1.450360.008924670.00892458 1.44144 1.45929
    false 1.372970.008871010.00887092 1.3641 1.38184
    false 1.295570.008853090.00885299 1.28672 1.30443
    false 1.218180.008871110.00887102 1.20931 1.22705
    false 1.140780.008924870.00892477 1.13186 1.14971
    true 1.627350.008924660.00892457 1.61842 1.63627
    true 1.527020.008871010.00887092 1.51815 1.53589
    true 1.42670.008853080.00885299 1.41784 1.43555
    true 1.326370.00887110.00887101 1.3175 1.33524
    true 1.226050.008924840.00892475 1.21712 1.23497
    @@ -445,79 +445,79 @@

    More on shrinkage plots

    - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - + - - + + - + - - + + - + - - + + - + - + @@ -528,9 +528,9 @@

    More on shrinkage plots

    (Intercept)2181.672977.313628.222181.642477.350528.20 <1e-99301.8062362.2579301.8688362.4643
    spkr: old67.749118.26643.7167.749617.96043.77 0.000242.379540.680733.058241.1114
    prec: maintain-333.920547.1558-333.920047.1534 -7.08 <1e-1161.9630246.915858.8506247.3123
    load: yes78.770219.52984.0378.800619.72703.99 <1e-0464.975142.389066.961243.3929
    spkr: old & prec: maintain-21.965515.8074-21.996015.8191 -1.390.16470.1644
    spkr: old & load: yes18.383715.807418.383215.8191 1.160.24480.2452
    prec: maintain & load: yes4.533315.80744.532715.8191 0.290.77430.7745
    spkr: old & prec: maintain & load: yes23.607315.807423.637715.8191 1.490.13530.1351
    Residual668.5542669.0519
    -
    +
    VarCorr(m1)
    -
    +
    @@ -556,8 +556,8 @@

    More on shrinkage plots

    - - + + @@ -565,35 +565,35 @@

    More on shrinkage plots

    - - - + + + - - - - + + + + - - + + + - - + - - + + @@ -601,35 +601,35 @@

    More on shrinkage plots

    - - - + + + - - + + - + - - - - - + + + + + - - + + @@ -638,112 +638,112 @@

    More on shrinkage plots

    subj (Intercept)91087.0055301.806291124.7853301.8688
    spkr: old1796.022142.3795+0.791092.846833.0582+1.00
    prec: maintain3839.412661.9630-0.59+0.023463.397158.8506-0.62-0.62
    load: yes4221.763864.97514483.799766.9612+0.36 +0.36+0.85+0.54+0.51
    item (Intercept)131230.7914362.2579131380.3392362.4643
    spkr: old1654.923240.6807+0.441690.146441.1114+0.42
    prec: maintain60967.4037246.915861163.3893247.3123 -0.69+0.35+0.37
    load: yes1796.828442.3890+0.32+0.16-0.141882.946343.3929+0.29+0.14-0.13
    Residual 446964.7062668.5542447630.5113669.0519
    -
    +
    issingular(m1)
    -
    +
    true
    -
    +
    print(m1)
    Linear mixed model fit by maximum likelihood
      rt_trunc ~ 1 + spkr + prec + load + spkr & prec + spkr & load + prec & load + spkr & prec & load + (1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item)
         logLik   -2 logLik      AIC         AICc        BIC     
    - -14318.5618  28637.1236  28695.1236  28696.1128  28854.3166
    + -14318.9855  28637.9710  28695.9710  28696.9602  28855.1640
     
     Variance components:
                  Column       Variance  Std.Dev.   Corr.
    -subj     (Intercept)      91087.0055 301.8062
    -         spkr: old         1796.0221  42.3795 +0.79
    -         prec: maintain    3839.4126  61.9630 -0.59 +0.02
    -         load: yes         4221.7638  64.9751 +0.36 +0.85 +0.54
    -item     (Intercept)     131230.7914 362.2579
    -         spkr: old         1654.9232  40.6807 +0.44
    -         prec: maintain   60967.4037 246.9158 -0.69 +0.35
    -         load: yes         1796.8284  42.3890 +0.32 +0.16 -0.14
    -Residual                 446964.7062 668.5542
    +subj     (Intercept)      91124.7853 301.8688
    +         spkr: old         1092.8468  33.0582 +1.00
    +         prec: maintain    3463.3971  58.8506 -0.62 -0.62
    +         load: yes         4483.7997  66.9612 +0.36 +0.36 +0.51
    +item     (Intercept)     131380.3392 362.4643
    +         spkr: old         1690.1464  41.1114 +0.42
    +         prec: maintain   61163.3893 247.3123 -0.69 +0.37
    +         load: yes         1882.9463  43.3929 +0.29 +0.14 -0.13
    +Residual                 447630.5113 669.0519
      Number of obs: 1789; levels of grouping factors: 56, 32
     
       Fixed-effects parameters:
     ───────────────────────────────────────────────────────────────────────────────
                                                  Coef.  Std. Error      z  Pr(>|z|)
     ───────────────────────────────────────────────────────────────────────────────
    -(Intercept)                             2181.67        77.3136  28.22    <1e-99
    -spkr: old                                 67.7491      18.2664   3.71    0.0002
    -prec: maintain                          -333.921       47.1558  -7.08    <1e-11
    -load: yes                                 78.7702      19.5298   4.03    <1e-04
    -spkr: old & prec: maintain               -21.9655      15.8074  -1.39    0.1647
    -spkr: old & load: yes                     18.3837      15.8074   1.16    0.2448
    -prec: maintain & load: yes                 4.53327     15.8074   0.29    0.7743
    -spkr: old & prec: maintain & load: yes    23.6073      15.8074   1.49    0.1353
    +(Intercept)                             2181.64        77.3505  28.20    <1e-99
    +spkr: old                                 67.7496      17.9604   3.77    0.0002
    +prec: maintain                          -333.92        47.1534  -7.08    <1e-11
    +load: yes                                 78.8006      19.727    3.99    <1e-04
    +spkr: old & prec: maintain               -21.996       15.8191  -1.39    0.1644
    +spkr: old & load: yes                     18.3832      15.8191   1.16    0.2452
    +prec: maintain & load: yes                 4.53273     15.8191   0.29    0.7745
    +spkr: old & prec: maintain & load: yes    23.6377      15.8191   1.49    0.1351
     ───────────────────────────────────────────────────────────────────────────────

    1 Expressing the covariance of random effects

    Earlier today we mentioned that the parameters being optimized are from a “matrix square root” of the covariance matrix for the random effects. There is one such lower triangular matrix for each grouping factor.

    -
    +
    l1 = first(m1.λ)   # Cholesky factor of relative covariance for subj
    -
    +
    4×4 LowerTriangular{Float64, Matrix{Float64}}:
    -  0.451431    ⋅           ⋅            ⋅ 
    -  0.0502903  0.0385895    ⋅            ⋅ 
    - -0.0550269  0.0745788   0.0           ⋅ 
    -  0.035189   0.090593   -0.000214038  0.0
    + 0.451189 ⋅ ⋅ ⋅ + 0.0494106 0.0 ⋅ ⋅ + -0.0547469 -0.0513393 0.0458719 ⋅ + 0.0359041 -0.0696631 0.0622471 0.0

    Notice the zero on the diagonal. A triangular matrix with zeros on the diagonal is singular.

    -
    +
    l2 = last(m1.λ)    # this one is also singular
    -
    +
    4×4 LowerTriangular{Float64, Matrix{Float64}}:
    -  0.541853    ⋅           ⋅          ⋅ 
    -  0.0268744  0.0545925    ⋅          ⋅ 
    - -0.253091   0.268002    0.0228756   ⋅ 
    -  0.0199967  0.00128943  0.0601543  0.0
    + 0.541758 ⋅ ⋅ ⋅ + 0.0259285 0.0557088 ⋅ ⋅ + -0.253763 0.267835 0.0225072 ⋅ + 0.0189267 0.000899324 0.0620278 0.0

    To regenerate the covariance matrix we need to know that the covariance is not the square of l1, it is l1 * l1' (so that the result is symmetric) and multiplied by σ̂²

    -
    +
    Σ₁ = varest(m1) .* (l1 * l1')
    -
    +
    4×4 Matrix{Float64}:
    -  91087.0   10147.3     -11103.0     7100.22
    -  10147.3    1796.02        49.4502  2353.54
    - -11103.0      49.4502    3839.41    2154.36
    -   7100.22   2353.54      2154.36    4221.76
    + 91124.8 9979.25 -11057.0 7251.4 + 9979.25 1092.85 -1210.87 794.114 + -11057.0 -1210.87 3463.4 1999.21 + 7251.4 794.114 1999.21 4483.8

    -
    +
    diag(Σ₁)  # compare to the variance column in the VarCorr output
    -
    +
    4-element Vector{Float64}:
    - 91087.0054784778
    -  1796.0221392123499
    -  3839.4125796885137
    -  4221.763756192171
    + 91124.78532128147 + 1092.8467662686182 + 3463.397109629657 + 4483.799720678472

    -
    +
    sqrt.(diag(Σ₁))
    -
    +
    4-element Vector{Float64}:
    - 301.8062383027856
    -  42.37950140353647
    -  61.96299363078348
    -  64.9751010479566
    + 301.8688213798859 + 33.05823295744372 + 58.85063389318468 + 66.96118069955511

    2 Shrinkage plots

    -
    +
    Code
    shrinkageplot(m1)
    -
    +

    @@ -753,15 +753,15 @@

    The upper left panel shows the perfect negative correlation for those two components of the random effects.

    -
    +
    shrinkageplot(m1, :item)
    -
    +

    -
    +
    X1 = Int.(m1.X')
    -
    +
    8×1789 Matrix{Int64}:
       1   1   1   1   1  1   1   1   1   1  …   1   1   1   1   1   1   1  1   1
      -1   1   1  -1  -1  1   1  -1  -1   1      1  -1  -1   1   1  -1  -1  1   1
    @@ -773,9 +773,9 @@ 

    -
    +
    X1 * X1'
    -
    +
    8×8 Matrix{Int64}:
      1789    -1    -1     3    -3     1     1     3
        -1  1789    -3     1    -1     3     3     1
    @@ -803,7 +803,7 @@ 

    +
    m2 = let
       form = @formula(
         rt_trunc ~
    @@ -811,7 +811,7 @@ 

    ) fit(MixedModel, form, kb07; contrasts) end

    -
    +
    @@ -919,9 +919,9 @@

    +
    VarCorr(m2)
    -
    +

    @@ -950,7 +950,7 @@

    - + @@ -965,12 +965,12 @@

    +
    Code
    shrinkageplot(m2)
    -
    +

    @@ -979,7 +979,7 @@

    +
    m3 = let
       form = @formula(
         rt_trunc ~
    @@ -987,7 +987,7 @@ 

    ) fit(MixedModel, form, kb07; contrasts) end

    -
    +

    subj (Intercept)88870.08088870.081 298.111
    @@ -1059,9 +1059,9 @@

    +
    VarCorr(m3)
    -
    +

    @@ -1076,21 +1076,21 @@

    - + - + - + @@ -1105,15 +1105,15 @@

    +
    rng = Random.seed!(1234321);
    -
    +
    m3btstrp = parametricbootstrap(rng, 2000, m3);
    -
    +
    DataFrame(shortestcovint(m3btstrp))
    -
    +
    9×5 DataFrame

    item (Intercept)133015.242133015.243 364.713
    prec: maintain63766.93563766.936 252.521 -0.70
    subj (Intercept)88819.43888819.436 298.026
    @@ -1181,14 +1181,14 @@

    item

    - + - + @@ -1196,7 +1196,7 @@

    σ

    - + @@ -1205,16 +1205,16 @@

    residual

    - +
    prec: maintain 171.547314.702314.704
    7 ρ item (Intercept), prec: maintain-0.89308-0.893081 -0.457084
    subj (Intercept)235.922235.921 364.717
    missing 657.736703.054703.06
    -
    +
    ridgeplot(m3btstrp)
    -
    +

    @@ -1223,9 +1223,9 @@

    +
    ridgeplot(m3btstrp; show_intercept=false)
    -
    +

    @@ -1234,7 +1234,7 @@

    +
    m4 = let
       form = @formula(
         rt_trunc ~
    @@ -1242,7 +1242,7 @@ 

    ) fit(MixedModel, form, kb07; contrasts) end

    -
    +
    @@ -1314,18 +1314,18 @@

    +
    m4bstrp = parametricbootstrap(rng, 2000, m4);
    -
    +
    ridgeplot(m4bstrp; show_intercept=false)
    -
    +

    -
    +
    DataFrame(shortestcovint(m4bstrp))
    -
    +
    9×5 DataFrame

    @@ -1393,14 +1393,14 @@

    item

    - + - + @@ -1408,7 +1408,7 @@

    σ

    - + @@ -1424,9 +1424,9 @@

    +
    VarCorr(m4)
    -
    +

    prec: maintain 177.803318.379318.382
    7 ρ item (Intercept), prec: maintain-0.904904-0.904909 -0.477346
    subj (Intercept)234.299234.301 361.964
    @@ -1441,21 +1441,21 @@

    - + - + - + @@ -1470,7 +1470,7 @@

    +
    Code
    let mods = [m1, m2, m4]
    @@ -1484,7 +1484,7 @@ 

    ) end

    -
    +
    3×6 DataFrame

    item (Intercept)133015.242133015.243 364.713
    prec: maintain63766.93563766.936 252.521 -0.70
    subj (Intercept)88819.43888819.436 298.026
    @@ -1510,12 +1510,12 @@

    - + - - - - + + + + @@ -1540,9 +1540,9 @@

    +
    scatter(fitted(m4), residuals(m4))
    -
    +

    diff --git a/shrinkageplot_files/figure-html/cell-14-output-1.svg b/shrinkageplot_files/figure-html/cell-14-output-1.svg index c99720a..ee05d86 100644 --- a/shrinkageplot_files/figure-html/cell-14-output-1.svg +++ b/shrinkageplot_files/figure-html/cell-14-output-1.svg @@ -2,402 +2,405 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -460,76 +463,76 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -563,197 +566,197 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -781,107 +784,107 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -909,230 +912,230 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1166,173 +1169,173 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1366,191 +1369,191 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1584,102 +1587,102 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shrinkageplot_files/figure-html/cell-29-output-1.svg b/shrinkageplot_files/figure-html/cell-29-output-1.svg index d1582ed..de8449a 100644 --- a/shrinkageplot_files/figure-html/cell-29-output-1.svg +++ b/shrinkageplot_files/figure-html/cell-29-output-1.svg @@ -2,282 +2,273 @@ - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -288,304 +279,304 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -599,16 +590,16 @@ - + - - - - - - - + + + + + + + diff --git a/shrinkageplot_files/figure-html/fig-m1shrinkage-output-1.svg b/shrinkageplot_files/figure-html/fig-m1shrinkage-output-1.svg index 6bf88c1..f21ee48 100644 --- a/shrinkageplot_files/figure-html/fig-m1shrinkage-output-1.svg +++ b/shrinkageplot_files/figure-html/fig-m1shrinkage-output-1.svg @@ -2,381 +2,396 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + - + - + - + - + - + - + - + - + @@ -384,17 +399,17 @@ - - - + + + - - - + + + @@ -406,9 +421,9 @@ - - - + + + @@ -430,601 +445,601 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -1071,590 +1086,590 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1708,239 +1723,239 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1996,176 +2011,176 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2174,9 +2189,9 @@ - - - + + + diff --git a/shrinkageplot_files/figure-html/fig-m2shrinkage-output-1.svg b/shrinkageplot_files/figure-html/fig-m2shrinkage-output-1.svg index 365840d..dcc1396 100644 --- a/shrinkageplot_files/figure-html/fig-m2shrinkage-output-1.svg +++ b/shrinkageplot_files/figure-html/fig-m2shrinkage-output-1.svg @@ -2,171 +2,171 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -178,151 +178,151 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -332,7 +332,7 @@ - + diff --git a/shrinkageplot_files/figure-html/fig-ridgeplot-output-1.svg b/shrinkageplot_files/figure-html/fig-ridgeplot-output-1.svg index 836572a..f3724f7 100644 --- a/shrinkageplot_files/figure-html/fig-ridgeplot-output-1.svg +++ b/shrinkageplot_files/figure-html/fig-ridgeplot-output-1.svg @@ -2,318 +2,318 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -324,328 +324,328 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -663,17 +663,17 @@ - + - - - - + + + + - + diff --git a/site_libs/bootstrap/bootstrap-dark.min.css b/site_libs/bootstrap/bootstrap-dark.min.css index adec28b..880d1b1 100644 --- a/site_libs/bootstrap/bootstrap-dark.min.css +++ b/site_libs/bootstrap/bootstrap-dark.min.css @@ -7,4 +7,4 @@ * * ansi colors from IPython notebook's * -*/.ansi-black-fg{color:#3e424d}.ansi-black-bg{background-color:#3e424d}.ansi-black-intense-fg{color:#282c36}.ansi-black-intense-bg{background-color:#282c36}.ansi-red-fg{color:#e75c58}.ansi-red-bg{background-color:#e75c58}.ansi-red-intense-fg{color:#b22b31}.ansi-red-intense-bg{background-color:#b22b31}.ansi-green-fg{color:#00a250}.ansi-green-bg{background-color:#00a250}.ansi-green-intense-fg{color:#007427}.ansi-green-intense-bg{background-color:#007427}.ansi-yellow-fg{color:#ddb62b}.ansi-yellow-bg{background-color:#ddb62b}.ansi-yellow-intense-fg{color:#b27d12}.ansi-yellow-intense-bg{background-color:#b27d12}.ansi-blue-fg{color:#208ffb}.ansi-blue-bg{background-color:#208ffb}.ansi-blue-intense-fg{color:#0065ca}.ansi-blue-intense-bg{background-color:#0065ca}.ansi-magenta-fg{color:#d160c4}.ansi-magenta-bg{background-color:#d160c4}.ansi-magenta-intense-fg{color:#a03196}.ansi-magenta-intense-bg{background-color:#a03196}.ansi-cyan-fg{color:#60c6c8}.ansi-cyan-bg{background-color:#60c6c8}.ansi-cyan-intense-fg{color:#258f8f}.ansi-cyan-intense-bg{background-color:#258f8f}.ansi-white-fg{color:#c5c1b4}.ansi-white-bg{background-color:#c5c1b4}.ansi-white-intense-fg{color:#a1a6b2}.ansi-white-intense-bg{background-color:#a1a6b2}.ansi-default-inverse-fg{color:#fff}.ansi-default-inverse-bg{background-color:#000}.ansi-bold{font-weight:bold}.ansi-underline{text-decoration:underline}:root{--quarto-body-bg: #222;--quarto-body-color: #fff;--quarto-text-muted: #6c757d;--quarto-border-color: #434343;--quarto-border-width: 1px;--quarto-border-radius: 0.25rem}table.gt_table{color:var(--quarto-body-color);font-size:1em;width:100%;background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_column_spanner_outer{color:var(--quarto-body-color);background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_col_heading{color:var(--quarto-body-color);font-weight:bold;background-color:rgba(0,0,0,0)}table.gt_table thead.gt_col_headings{border-bottom:1px solid currentColor;border-top-width:inherit;border-top-color:var(--quarto-border-color)}table.gt_table thead.gt_col_headings:not(:first-child){border-top-width:1px;border-top-color:var(--quarto-border-color)}table.gt_table td.gt_row{border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-width:0px}table.gt_table tbody.gt_table_body{border-top-width:1px;border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-color:currentColor}div.columns{display:initial;gap:initial}div.column{display:inline-block;overflow-x:initial;vertical-align:top;width:50%}.code-annotation-tip-content{word-wrap:break-word}.code-annotation-container-hidden{display:none !important}dl.code-annotation-container-grid{display:grid;grid-template-columns:min-content auto}dl.code-annotation-container-grid dt{grid-column:1}dl.code-annotation-container-grid dd{grid-column:2}pre.sourceCode.code-annotation-code{padding-right:0}code.sourceCode .code-annotation-anchor{z-index:100;position:absolute;right:.5em;left:inherit;background-color:rgba(0,0,0,0)}:root{--mermaid-bg-color: #222;--mermaid-edge-color: #434343;--mermaid-node-fg-color: #fff;--mermaid-fg-color: #fff;--mermaid-fg-color--lighter: white;--mermaid-fg-color--lightest: white;--mermaid-font-family: Lato, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;--mermaid-label-bg-color: #222;--mermaid-label-fg-color: #375a7f;--mermaid-node-bg-color: rgba(55, 90, 127, 0.1);--mermaid-node-fg-color: #fff}@media print{:root{font-size:11pt}#quarto-sidebar,#TOC,.nav-page{display:none}.page-columns .content{grid-column-start:page-start}.fixed-top{position:relative}.panel-caption,.figure-caption,figcaption{color:#666}}.code-copy-button{position:absolute;top:0;right:0;border:0;margin-top:5px;margin-right:5px;background-color:rgba(0,0,0,0);z-index:3}.code-copy-button:focus{outline:none}.code-copy-button-tooltip{font-size:.75em}pre.sourceCode:hover>.code-copy-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}pre.sourceCode:hover>.code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button-checked:hover>.bi::before{background-image:url('data:image/svg+xml,')}main ol ol,main ul ul,main ol ul,main ul ol{margin-bottom:1em}ul>li:not(:has(>p))>ul,ol>li:not(:has(>p))>ul,ul>li:not(:has(>p))>ol,ol>li:not(:has(>p))>ol{margin-bottom:0}ul>li:not(:has(>p))>ul>li:has(>p),ol>li:not(:has(>p))>ul>li:has(>p),ul>li:not(:has(>p))>ol>li:has(>p),ol>li:not(:has(>p))>ol>li:has(>p){margin-top:1rem}body{margin:0}main.page-columns>header>h1.title,main.page-columns>header>.title.h1{margin-bottom:0}@media(min-width: 992px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] 35px [page-end-inset page-end] 5fr [screen-end-inset] 1.5em}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 3em [body-end] 50px [body-end-outset] minmax(0px, 250px) [page-end-inset] minmax(50px, 100px) [page-end] 1fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 100px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 150px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 991.98px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 1250px - 3em )) [body-content-end body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1.5em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 767.98px){body .page-columns,body.fullcontent:not(.floating):not(.docked) .page-columns,body.slimcontent:not(.floating):not(.docked) .page-columns,body.docked .page-columns,body.docked.slimcontent .page-columns,body.docked.fullcontent .page-columns,body.floating .page-columns,body.floating.slimcontent .page-columns,body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}nav[role=doc-toc]{display:none}}body,.page-row-navigation{grid-template-rows:[page-top] max-content [contents-top] max-content [contents-bottom] max-content [page-bottom]}.page-rows-contents{grid-template-rows:[content-top] minmax(max-content, 1fr) [content-bottom] minmax(60px, max-content) [page-bottom]}.page-full{grid-column:screen-start/screen-end !important}.page-columns>*{grid-column:body-content-start/body-content-end}.page-columns.column-page>*{grid-column:page-start/page-end}.page-columns.column-page-left>*{grid-column:page-start/body-content-end}.page-columns.column-page-right>*{grid-column:body-content-start/page-end}.page-rows{grid-auto-rows:auto}.header{grid-column:screen-start/screen-end;grid-row:page-top/contents-top}#quarto-content{padding:0;grid-column:screen-start/screen-end;grid-row:contents-top/contents-bottom}body.floating .sidebar.sidebar-navigation{grid-column:page-start/body-start;grid-row:content-top/page-bottom}body.docked .sidebar.sidebar-navigation{grid-column:screen-start/body-start;grid-row:content-top/page-bottom}.sidebar.toc-left{grid-column:page-start/body-start;grid-row:content-top/page-bottom}.sidebar.margin-sidebar{grid-column:body-end/page-end;grid-row:content-top/page-bottom}.page-columns .content{grid-column:body-content-start/body-content-end;grid-row:content-top/content-bottom;align-content:flex-start}.page-columns .page-navigation{grid-column:body-content-start/body-content-end;grid-row:content-bottom/page-bottom}.page-columns .footer{grid-column:screen-start/screen-end;grid-row:contents-bottom/page-bottom}.page-columns .column-body{grid-column:body-content-start/body-content-end}.page-columns .column-body-fullbleed{grid-column:body-start/body-end}.page-columns .column-body-outset{grid-column:body-start-outset/body-end-outset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset table{background:#222}.page-columns .column-body-outset-left{grid-column:body-start-outset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset-left table{background:#222}.page-columns .column-body-outset-right{grid-column:body-content-start/body-end-outset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset-right table{background:#222}.page-columns .column-page{grid-column:page-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page table{background:#222}.page-columns .column-page-inset{grid-column:page-start-inset/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset table{background:#222}.page-columns .column-page-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset-left table{background:#222}.page-columns .column-page-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset-right figcaption table{background:#222}.page-columns .column-page-left{grid-column:page-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-left table{background:#222}.page-columns .column-page-right{grid-column:body-content-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-right figcaption table{background:#222}#quarto-content.page-columns #quarto-margin-sidebar,#quarto-content.page-columns #quarto-sidebar{z-index:1}@media(max-width: 991.98px){#quarto-content.page-columns #quarto-margin-sidebar.collapse,#quarto-content.page-columns #quarto-sidebar.collapse,#quarto-content.page-columns #quarto-margin-sidebar.collapsing,#quarto-content.page-columns #quarto-sidebar.collapsing{z-index:1055}}#quarto-content.page-columns main.column-page,#quarto-content.page-columns main.column-page-right,#quarto-content.page-columns main.column-page-left{z-index:0}.page-columns .column-screen-inset{grid-column:screen-start-inset/screen-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset table{background:#222}.page-columns .column-screen-inset-left{grid-column:screen-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-left table{background:#222}.page-columns .column-screen-inset-right{grid-column:body-content-start/screen-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-right table{background:#222}.page-columns .column-screen{grid-column:screen-start/screen-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen table{background:#222}.page-columns .column-screen-left{grid-column:screen-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-left table{background:#222}.page-columns .column-screen-right{grid-column:body-content-start/screen-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-right table{background:#222}.page-columns .column-screen-inset-shaded{grid-column:screen-start/screen-end;padding:1em;background:#6f6f6f;z-index:998;transform:translate3d(0, 0, 0);margin-bottom:1em}.zindex-content{z-index:998;transform:translate3d(0, 0, 0)}.zindex-modal{z-index:1055;transform:translate3d(0, 0, 0)}.zindex-over-content{z-index:999;transform:translate3d(0, 0, 0)}img.img-fluid.column-screen,img.img-fluid.column-screen-inset-shaded,img.img-fluid.column-screen-inset,img.img-fluid.column-screen-inset-left,img.img-fluid.column-screen-inset-right,img.img-fluid.column-screen-left,img.img-fluid.column-screen-right{width:100%}@media(min-width: 992px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-end/page-end !important;z-index:998}.column-sidebar{grid-column:page-start/body-start !important;z-index:998}.column-leftmargin{grid-column:screen-start-inset/body-start !important;z-index:998}.no-row-height{height:1em;overflow:visible}}@media(max-width: 991.98px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-end/page-end !important;z-index:998}.no-row-height{height:1em;overflow:visible}.page-columns.page-full{overflow:visible}.page-columns.toc-left .margin-caption,.page-columns.toc-left div.aside,.page-columns.toc-left aside,.page-columns.toc-left .column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;transform:translate3d(0, 0, 0)}.page-columns.toc-left .no-row-height{height:initial;overflow:initial}}@media(max-width: 767.98px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;transform:translate3d(0, 0, 0)}.no-row-height{height:initial;overflow:initial}#quarto-margin-sidebar{display:none}#quarto-sidebar-toc-left{display:none}.hidden-sm{display:none}}.panel-grid{display:grid;grid-template-rows:repeat(1, 1fr);grid-template-columns:repeat(24, 1fr);gap:1em}.panel-grid .g-col-1{grid-column:auto/span 1}.panel-grid .g-col-2{grid-column:auto/span 2}.panel-grid .g-col-3{grid-column:auto/span 3}.panel-grid .g-col-4{grid-column:auto/span 4}.panel-grid .g-col-5{grid-column:auto/span 5}.panel-grid .g-col-6{grid-column:auto/span 6}.panel-grid .g-col-7{grid-column:auto/span 7}.panel-grid .g-col-8{grid-column:auto/span 8}.panel-grid .g-col-9{grid-column:auto/span 9}.panel-grid .g-col-10{grid-column:auto/span 10}.panel-grid .g-col-11{grid-column:auto/span 11}.panel-grid .g-col-12{grid-column:auto/span 12}.panel-grid .g-col-13{grid-column:auto/span 13}.panel-grid .g-col-14{grid-column:auto/span 14}.panel-grid .g-col-15{grid-column:auto/span 15}.panel-grid .g-col-16{grid-column:auto/span 16}.panel-grid .g-col-17{grid-column:auto/span 17}.panel-grid .g-col-18{grid-column:auto/span 18}.panel-grid .g-col-19{grid-column:auto/span 19}.panel-grid .g-col-20{grid-column:auto/span 20}.panel-grid .g-col-21{grid-column:auto/span 21}.panel-grid .g-col-22{grid-column:auto/span 22}.panel-grid .g-col-23{grid-column:auto/span 23}.panel-grid .g-col-24{grid-column:auto/span 24}.panel-grid .g-start-1{grid-column-start:1}.panel-grid .g-start-2{grid-column-start:2}.panel-grid .g-start-3{grid-column-start:3}.panel-grid .g-start-4{grid-column-start:4}.panel-grid .g-start-5{grid-column-start:5}.panel-grid .g-start-6{grid-column-start:6}.panel-grid .g-start-7{grid-column-start:7}.panel-grid .g-start-8{grid-column-start:8}.panel-grid .g-start-9{grid-column-start:9}.panel-grid .g-start-10{grid-column-start:10}.panel-grid .g-start-11{grid-column-start:11}.panel-grid .g-start-12{grid-column-start:12}.panel-grid .g-start-13{grid-column-start:13}.panel-grid .g-start-14{grid-column-start:14}.panel-grid .g-start-15{grid-column-start:15}.panel-grid .g-start-16{grid-column-start:16}.panel-grid .g-start-17{grid-column-start:17}.panel-grid .g-start-18{grid-column-start:18}.panel-grid .g-start-19{grid-column-start:19}.panel-grid .g-start-20{grid-column-start:20}.panel-grid .g-start-21{grid-column-start:21}.panel-grid .g-start-22{grid-column-start:22}.panel-grid .g-start-23{grid-column-start:23}@media(min-width: 576px){.panel-grid .g-col-sm-1{grid-column:auto/span 1}.panel-grid .g-col-sm-2{grid-column:auto/span 2}.panel-grid .g-col-sm-3{grid-column:auto/span 3}.panel-grid .g-col-sm-4{grid-column:auto/span 4}.panel-grid .g-col-sm-5{grid-column:auto/span 5}.panel-grid .g-col-sm-6{grid-column:auto/span 6}.panel-grid .g-col-sm-7{grid-column:auto/span 7}.panel-grid .g-col-sm-8{grid-column:auto/span 8}.panel-grid .g-col-sm-9{grid-column:auto/span 9}.panel-grid .g-col-sm-10{grid-column:auto/span 10}.panel-grid .g-col-sm-11{grid-column:auto/span 11}.panel-grid .g-col-sm-12{grid-column:auto/span 12}.panel-grid .g-col-sm-13{grid-column:auto/span 13}.panel-grid .g-col-sm-14{grid-column:auto/span 14}.panel-grid .g-col-sm-15{grid-column:auto/span 15}.panel-grid .g-col-sm-16{grid-column:auto/span 16}.panel-grid .g-col-sm-17{grid-column:auto/span 17}.panel-grid .g-col-sm-18{grid-column:auto/span 18}.panel-grid .g-col-sm-19{grid-column:auto/span 19}.panel-grid .g-col-sm-20{grid-column:auto/span 20}.panel-grid .g-col-sm-21{grid-column:auto/span 21}.panel-grid .g-col-sm-22{grid-column:auto/span 22}.panel-grid .g-col-sm-23{grid-column:auto/span 23}.panel-grid .g-col-sm-24{grid-column:auto/span 24}.panel-grid .g-start-sm-1{grid-column-start:1}.panel-grid .g-start-sm-2{grid-column-start:2}.panel-grid .g-start-sm-3{grid-column-start:3}.panel-grid .g-start-sm-4{grid-column-start:4}.panel-grid .g-start-sm-5{grid-column-start:5}.panel-grid .g-start-sm-6{grid-column-start:6}.panel-grid .g-start-sm-7{grid-column-start:7}.panel-grid .g-start-sm-8{grid-column-start:8}.panel-grid .g-start-sm-9{grid-column-start:9}.panel-grid .g-start-sm-10{grid-column-start:10}.panel-grid .g-start-sm-11{grid-column-start:11}.panel-grid .g-start-sm-12{grid-column-start:12}.panel-grid .g-start-sm-13{grid-column-start:13}.panel-grid .g-start-sm-14{grid-column-start:14}.panel-grid .g-start-sm-15{grid-column-start:15}.panel-grid .g-start-sm-16{grid-column-start:16}.panel-grid .g-start-sm-17{grid-column-start:17}.panel-grid .g-start-sm-18{grid-column-start:18}.panel-grid .g-start-sm-19{grid-column-start:19}.panel-grid .g-start-sm-20{grid-column-start:20}.panel-grid .g-start-sm-21{grid-column-start:21}.panel-grid .g-start-sm-22{grid-column-start:22}.panel-grid .g-start-sm-23{grid-column-start:23}}@media(min-width: 768px){.panel-grid .g-col-md-1{grid-column:auto/span 1}.panel-grid .g-col-md-2{grid-column:auto/span 2}.panel-grid .g-col-md-3{grid-column:auto/span 3}.panel-grid .g-col-md-4{grid-column:auto/span 4}.panel-grid .g-col-md-5{grid-column:auto/span 5}.panel-grid .g-col-md-6{grid-column:auto/span 6}.panel-grid .g-col-md-7{grid-column:auto/span 7}.panel-grid .g-col-md-8{grid-column:auto/span 8}.panel-grid .g-col-md-9{grid-column:auto/span 9}.panel-grid .g-col-md-10{grid-column:auto/span 10}.panel-grid .g-col-md-11{grid-column:auto/span 11}.panel-grid .g-col-md-12{grid-column:auto/span 12}.panel-grid .g-col-md-13{grid-column:auto/span 13}.panel-grid .g-col-md-14{grid-column:auto/span 14}.panel-grid .g-col-md-15{grid-column:auto/span 15}.panel-grid .g-col-md-16{grid-column:auto/span 16}.panel-grid .g-col-md-17{grid-column:auto/span 17}.panel-grid .g-col-md-18{grid-column:auto/span 18}.panel-grid .g-col-md-19{grid-column:auto/span 19}.panel-grid .g-col-md-20{grid-column:auto/span 20}.panel-grid .g-col-md-21{grid-column:auto/span 21}.panel-grid .g-col-md-22{grid-column:auto/span 22}.panel-grid .g-col-md-23{grid-column:auto/span 23}.panel-grid .g-col-md-24{grid-column:auto/span 24}.panel-grid .g-start-md-1{grid-column-start:1}.panel-grid .g-start-md-2{grid-column-start:2}.panel-grid .g-start-md-3{grid-column-start:3}.panel-grid .g-start-md-4{grid-column-start:4}.panel-grid .g-start-md-5{grid-column-start:5}.panel-grid .g-start-md-6{grid-column-start:6}.panel-grid .g-start-md-7{grid-column-start:7}.panel-grid .g-start-md-8{grid-column-start:8}.panel-grid .g-start-md-9{grid-column-start:9}.panel-grid .g-start-md-10{grid-column-start:10}.panel-grid .g-start-md-11{grid-column-start:11}.panel-grid .g-start-md-12{grid-column-start:12}.panel-grid .g-start-md-13{grid-column-start:13}.panel-grid .g-start-md-14{grid-column-start:14}.panel-grid .g-start-md-15{grid-column-start:15}.panel-grid .g-start-md-16{grid-column-start:16}.panel-grid .g-start-md-17{grid-column-start:17}.panel-grid .g-start-md-18{grid-column-start:18}.panel-grid .g-start-md-19{grid-column-start:19}.panel-grid .g-start-md-20{grid-column-start:20}.panel-grid .g-start-md-21{grid-column-start:21}.panel-grid .g-start-md-22{grid-column-start:22}.panel-grid .g-start-md-23{grid-column-start:23}}@media(min-width: 992px){.panel-grid .g-col-lg-1{grid-column:auto/span 1}.panel-grid .g-col-lg-2{grid-column:auto/span 2}.panel-grid .g-col-lg-3{grid-column:auto/span 3}.panel-grid .g-col-lg-4{grid-column:auto/span 4}.panel-grid .g-col-lg-5{grid-column:auto/span 5}.panel-grid .g-col-lg-6{grid-column:auto/span 6}.panel-grid .g-col-lg-7{grid-column:auto/span 7}.panel-grid .g-col-lg-8{grid-column:auto/span 8}.panel-grid .g-col-lg-9{grid-column:auto/span 9}.panel-grid .g-col-lg-10{grid-column:auto/span 10}.panel-grid .g-col-lg-11{grid-column:auto/span 11}.panel-grid .g-col-lg-12{grid-column:auto/span 12}.panel-grid .g-col-lg-13{grid-column:auto/span 13}.panel-grid .g-col-lg-14{grid-column:auto/span 14}.panel-grid .g-col-lg-15{grid-column:auto/span 15}.panel-grid .g-col-lg-16{grid-column:auto/span 16}.panel-grid .g-col-lg-17{grid-column:auto/span 17}.panel-grid .g-col-lg-18{grid-column:auto/span 18}.panel-grid .g-col-lg-19{grid-column:auto/span 19}.panel-grid .g-col-lg-20{grid-column:auto/span 20}.panel-grid .g-col-lg-21{grid-column:auto/span 21}.panel-grid .g-col-lg-22{grid-column:auto/span 22}.panel-grid .g-col-lg-23{grid-column:auto/span 23}.panel-grid .g-col-lg-24{grid-column:auto/span 24}.panel-grid .g-start-lg-1{grid-column-start:1}.panel-grid .g-start-lg-2{grid-column-start:2}.panel-grid .g-start-lg-3{grid-column-start:3}.panel-grid .g-start-lg-4{grid-column-start:4}.panel-grid .g-start-lg-5{grid-column-start:5}.panel-grid .g-start-lg-6{grid-column-start:6}.panel-grid .g-start-lg-7{grid-column-start:7}.panel-grid .g-start-lg-8{grid-column-start:8}.panel-grid .g-start-lg-9{grid-column-start:9}.panel-grid .g-start-lg-10{grid-column-start:10}.panel-grid .g-start-lg-11{grid-column-start:11}.panel-grid .g-start-lg-12{grid-column-start:12}.panel-grid .g-start-lg-13{grid-column-start:13}.panel-grid .g-start-lg-14{grid-column-start:14}.panel-grid .g-start-lg-15{grid-column-start:15}.panel-grid .g-start-lg-16{grid-column-start:16}.panel-grid .g-start-lg-17{grid-column-start:17}.panel-grid .g-start-lg-18{grid-column-start:18}.panel-grid .g-start-lg-19{grid-column-start:19}.panel-grid .g-start-lg-20{grid-column-start:20}.panel-grid .g-start-lg-21{grid-column-start:21}.panel-grid .g-start-lg-22{grid-column-start:22}.panel-grid .g-start-lg-23{grid-column-start:23}}@media(min-width: 1200px){.panel-grid .g-col-xl-1{grid-column:auto/span 1}.panel-grid .g-col-xl-2{grid-column:auto/span 2}.panel-grid .g-col-xl-3{grid-column:auto/span 3}.panel-grid .g-col-xl-4{grid-column:auto/span 4}.panel-grid .g-col-xl-5{grid-column:auto/span 5}.panel-grid .g-col-xl-6{grid-column:auto/span 6}.panel-grid .g-col-xl-7{grid-column:auto/span 7}.panel-grid .g-col-xl-8{grid-column:auto/span 8}.panel-grid .g-col-xl-9{grid-column:auto/span 9}.panel-grid .g-col-xl-10{grid-column:auto/span 10}.panel-grid .g-col-xl-11{grid-column:auto/span 11}.panel-grid .g-col-xl-12{grid-column:auto/span 12}.panel-grid .g-col-xl-13{grid-column:auto/span 13}.panel-grid .g-col-xl-14{grid-column:auto/span 14}.panel-grid .g-col-xl-15{grid-column:auto/span 15}.panel-grid .g-col-xl-16{grid-column:auto/span 16}.panel-grid .g-col-xl-17{grid-column:auto/span 17}.panel-grid .g-col-xl-18{grid-column:auto/span 18}.panel-grid .g-col-xl-19{grid-column:auto/span 19}.panel-grid .g-col-xl-20{grid-column:auto/span 20}.panel-grid .g-col-xl-21{grid-column:auto/span 21}.panel-grid .g-col-xl-22{grid-column:auto/span 22}.panel-grid .g-col-xl-23{grid-column:auto/span 23}.panel-grid .g-col-xl-24{grid-column:auto/span 24}.panel-grid .g-start-xl-1{grid-column-start:1}.panel-grid .g-start-xl-2{grid-column-start:2}.panel-grid .g-start-xl-3{grid-column-start:3}.panel-grid .g-start-xl-4{grid-column-start:4}.panel-grid .g-start-xl-5{grid-column-start:5}.panel-grid .g-start-xl-6{grid-column-start:6}.panel-grid .g-start-xl-7{grid-column-start:7}.panel-grid .g-start-xl-8{grid-column-start:8}.panel-grid .g-start-xl-9{grid-column-start:9}.panel-grid .g-start-xl-10{grid-column-start:10}.panel-grid .g-start-xl-11{grid-column-start:11}.panel-grid .g-start-xl-12{grid-column-start:12}.panel-grid .g-start-xl-13{grid-column-start:13}.panel-grid .g-start-xl-14{grid-column-start:14}.panel-grid .g-start-xl-15{grid-column-start:15}.panel-grid .g-start-xl-16{grid-column-start:16}.panel-grid .g-start-xl-17{grid-column-start:17}.panel-grid .g-start-xl-18{grid-column-start:18}.panel-grid .g-start-xl-19{grid-column-start:19}.panel-grid .g-start-xl-20{grid-column-start:20}.panel-grid .g-start-xl-21{grid-column-start:21}.panel-grid .g-start-xl-22{grid-column-start:22}.panel-grid .g-start-xl-23{grid-column-start:23}}@media(min-width: 1400px){.panel-grid .g-col-xxl-1{grid-column:auto/span 1}.panel-grid .g-col-xxl-2{grid-column:auto/span 2}.panel-grid .g-col-xxl-3{grid-column:auto/span 3}.panel-grid .g-col-xxl-4{grid-column:auto/span 4}.panel-grid .g-col-xxl-5{grid-column:auto/span 5}.panel-grid .g-col-xxl-6{grid-column:auto/span 6}.panel-grid .g-col-xxl-7{grid-column:auto/span 7}.panel-grid .g-col-xxl-8{grid-column:auto/span 8}.panel-grid .g-col-xxl-9{grid-column:auto/span 9}.panel-grid .g-col-xxl-10{grid-column:auto/span 10}.panel-grid .g-col-xxl-11{grid-column:auto/span 11}.panel-grid .g-col-xxl-12{grid-column:auto/span 12}.panel-grid .g-col-xxl-13{grid-column:auto/span 13}.panel-grid .g-col-xxl-14{grid-column:auto/span 14}.panel-grid .g-col-xxl-15{grid-column:auto/span 15}.panel-grid .g-col-xxl-16{grid-column:auto/span 16}.panel-grid .g-col-xxl-17{grid-column:auto/span 17}.panel-grid .g-col-xxl-18{grid-column:auto/span 18}.panel-grid .g-col-xxl-19{grid-column:auto/span 19}.panel-grid .g-col-xxl-20{grid-column:auto/span 20}.panel-grid .g-col-xxl-21{grid-column:auto/span 21}.panel-grid .g-col-xxl-22{grid-column:auto/span 22}.panel-grid .g-col-xxl-23{grid-column:auto/span 23}.panel-grid .g-col-xxl-24{grid-column:auto/span 24}.panel-grid .g-start-xxl-1{grid-column-start:1}.panel-grid .g-start-xxl-2{grid-column-start:2}.panel-grid .g-start-xxl-3{grid-column-start:3}.panel-grid .g-start-xxl-4{grid-column-start:4}.panel-grid .g-start-xxl-5{grid-column-start:5}.panel-grid .g-start-xxl-6{grid-column-start:6}.panel-grid .g-start-xxl-7{grid-column-start:7}.panel-grid .g-start-xxl-8{grid-column-start:8}.panel-grid .g-start-xxl-9{grid-column-start:9}.panel-grid .g-start-xxl-10{grid-column-start:10}.panel-grid .g-start-xxl-11{grid-column-start:11}.panel-grid .g-start-xxl-12{grid-column-start:12}.panel-grid .g-start-xxl-13{grid-column-start:13}.panel-grid .g-start-xxl-14{grid-column-start:14}.panel-grid .g-start-xxl-15{grid-column-start:15}.panel-grid .g-start-xxl-16{grid-column-start:16}.panel-grid .g-start-xxl-17{grid-column-start:17}.panel-grid .g-start-xxl-18{grid-column-start:18}.panel-grid .g-start-xxl-19{grid-column-start:19}.panel-grid .g-start-xxl-20{grid-column-start:20}.panel-grid .g-start-xxl-21{grid-column-start:21}.panel-grid .g-start-xxl-22{grid-column-start:22}.panel-grid .g-start-xxl-23{grid-column-start:23}}main{margin-top:1em;margin-bottom:1em}h1,.h1,h2,.h2{opacity:.9;margin-top:2rem;margin-bottom:1rem;font-weight:600}h1.title,.title.h1{margin-top:0}h2,.h2{border-bottom:1px solid #434343;padding-bottom:.5rem}h3,.h3{font-weight:600}h3,.h3,h4,.h4{opacity:.9;margin-top:1.5rem}h5,.h5,h6,.h6{opacity:.9}.header-section-number{color:#bfbfbf}.nav-link.active .header-section-number{color:inherit}mark,.mark{padding:0em}.panel-caption,caption,.figure-caption{font-size:.9rem}.panel-caption,.figure-caption,figcaption{color:#bfbfbf}.table-caption,caption{color:#fff}.quarto-layout-cell[data-ref-parent] caption{color:#bfbfbf}.column-margin figcaption,.margin-caption,div.aside,aside,.column-margin{color:#bfbfbf;font-size:.825rem}.panel-caption.margin-caption{text-align:inherit}.column-margin.column-container p{margin-bottom:0}.column-margin.column-container>*:not(.collapse){padding-top:.5em;padding-bottom:.5em;display:block}.column-margin.column-container>*.collapse:not(.show){display:none}@media(min-width: 768px){.column-margin.column-container .callout-margin-content:first-child{margin-top:4.5em}.column-margin.column-container .callout-margin-content-simple:first-child{margin-top:3.5em}}.margin-caption>*{padding-top:.5em;padding-bottom:.5em}@media(max-width: 767.98px){.quarto-layout-row{flex-direction:column}}.nav-tabs .nav-item{margin-top:1px;cursor:pointer}.tab-content{margin-top:0px;border-left:#434343 1px solid;border-right:#434343 1px solid;border-bottom:#434343 1px solid;margin-left:0;padding:1em;margin-bottom:1em}@media(max-width: 767.98px){.layout-sidebar{margin-left:0;margin-right:0}}.panel-sidebar,.panel-sidebar .form-control,.panel-input,.panel-input .form-control,.selectize-dropdown{font-size:.9rem}.panel-sidebar .form-control,.panel-input .form-control{padding-top:.1rem}.tab-pane div.sourceCode{margin-top:0px}.tab-pane>p{padding-top:1em}.tab-content>.tab-pane:not(.active){display:none !important}div.sourceCode{background-color:#000;border:1px solid #000;border-radius:.25rem}pre.sourceCode{background-color:rgba(0,0,0,0)}pre.sourceCode{border:none;font-size:.875em;overflow:visible !important;padding:.4em}.callout pre.sourceCode{padding-left:0}div.sourceCode{overflow-y:hidden}.callout div.sourceCode{margin-left:initial}.blockquote{font-size:inherit;padding-left:1rem;padding-right:1.5rem;color:#bfbfbf}.blockquote h1:first-child,.blockquote .h1:first-child,.blockquote h2:first-child,.blockquote .h2:first-child,.blockquote h3:first-child,.blockquote .h3:first-child,.blockquote h4:first-child,.blockquote .h4:first-child,.blockquote h5:first-child,.blockquote .h5:first-child{margin-top:0}pre{background-color:initial;padding:initial;border:initial}p code:not(.sourceCode),li code:not(.sourceCode),td code:not(.sourceCode){background-color:#000;padding:.2em}nav p code:not(.sourceCode),nav li code:not(.sourceCode),nav td code:not(.sourceCode){background-color:rgba(0,0,0,0);padding:0}td code:not(.sourceCode){white-space:pre-wrap}#quarto-embedded-source-code-modal>.modal-dialog{max-width:1000px;padding-left:1.75rem;padding-right:1.75rem}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body{padding:0}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body div.sourceCode{margin:0;padding:.2rem .2rem;border-radius:0px;border:none}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-header{padding:.7rem}.code-tools-button{font-size:1rem;padding:.15rem .15rem;margin-left:5px;color:#6c757d;background-color:rgba(0,0,0,0);transition:initial;cursor:pointer}.code-tools-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}.code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}.sidebar{will-change:top;transition:top 200ms linear;position:sticky;overflow-y:auto;padding-top:1.2em;max-height:100vh}.sidebar.toc-left,.sidebar.margin-sidebar{top:0px;padding-top:1em}.sidebar.toc-left>*,.sidebar.margin-sidebar>*{padding-top:.5em}.sidebar.quarto-banner-title-block-sidebar>*{padding-top:1.65em}figure .quarto-notebook-link{margin-top:.5em}.quarto-notebook-link{font-size:.75em;color:#6c757d;margin-bottom:1em;text-decoration:none;display:block}.quarto-notebook-link:hover{text-decoration:underline;color:#00bc8c}.quarto-notebook-link::before{display:inline-block;height:.75rem;width:.75rem;margin-bottom:0em;margin-right:.25em;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:.75rem .75rem}.quarto-alternate-notebooks i.bi,.quarto-alternate-formats i.bi{margin-right:.4em}.quarto-notebook .cell-container{display:flex}.quarto-notebook .cell-container .cell{flex-grow:4}.quarto-notebook .cell-container .cell-decorator{padding-top:1.5em;padding-right:1em;text-align:right}.quarto-notebook h2,.quarto-notebook .h2{border-bottom:none}.sidebar .quarto-alternate-formats a,.sidebar .quarto-alternate-notebooks a{text-decoration:none}.sidebar .quarto-alternate-formats a:hover,.sidebar .quarto-alternate-notebooks a:hover{color:#00bc8c}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2,.sidebar nav[role=doc-toc]>h2,.sidebar nav[role=doc-toc]>.h2{font-size:.875rem;font-weight:400;margin-bottom:.5rem;margin-top:.3rem;font-family:inherit;border-bottom:0;padding-bottom:0;padding-top:0px}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2{margin-top:1rem}.sidebar nav[role=doc-toc]>ul a{border-left:1px solid #ebebeb;padding-left:.6rem}.sidebar .quarto-alternate-notebooks h2>ul a,.sidebar .quarto-alternate-notebooks .h2>ul a,.sidebar .quarto-alternate-formats h2>ul a,.sidebar .quarto-alternate-formats .h2>ul a{border-left:none;padding-left:.6rem}.sidebar .quarto-alternate-notebooks ul a:empty,.sidebar .quarto-alternate-formats ul a:empty,.sidebar nav[role=doc-toc]>ul a:empty{display:none}.sidebar .quarto-alternate-notebooks ul,.sidebar .quarto-alternate-formats ul,.sidebar nav[role=doc-toc] ul{padding-left:0;list-style:none;font-size:.875rem;font-weight:300}.sidebar .quarto-alternate-notebooks ul li a,.sidebar .quarto-alternate-formats ul li a,.sidebar nav[role=doc-toc]>ul li a{line-height:1.1rem;padding-bottom:.2rem;padding-top:.2rem;color:inherit}.sidebar nav[role=doc-toc] ul>li>ul>li>a{padding-left:1.2em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>a{padding-left:2.4em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>a{padding-left:3.6em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:4.8em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:6em}.sidebar nav[role=doc-toc] ul>li>a.active,.sidebar nav[role=doc-toc] ul>li>ul>li>a.active{border-left:1px solid #00bc8c;color:#00bc8c !important}.sidebar nav[role=doc-toc] ul>li>a:hover,.sidebar nav[role=doc-toc] ul>li>ul>li>a:hover{color:#00bc8c !important}kbd,.kbd{color:#fff;background-color:#f8f9fa;border:1px solid;border-radius:5px;border-color:#434343}div.hanging-indent{margin-left:1em;text-indent:-1em}.citation a,.footnote-ref{text-decoration:none}.footnotes ol{padding-left:1em}.tippy-content>*{margin-bottom:.7em}.tippy-content>*:last-child{margin-bottom:0}.table a{word-break:break-word}.table>thead{border-top-width:1px;border-top-color:#434343;border-bottom:1px solid #fff}.callout{margin-top:1.25rem;margin-bottom:1.25rem;border-radius:.25rem;overflow-wrap:break-word}.callout .callout-title-container{overflow-wrap:anywhere}.callout.callout-style-simple{padding:.4em .7em;border-left:5px solid;border-right:1px solid #434343;border-top:1px solid #434343;border-bottom:1px solid #434343}.callout.callout-style-default{border-left:5px solid;border-right:1px solid #434343;border-top:1px solid #434343;border-bottom:1px solid #434343}.callout .callout-body-container{flex-grow:1}.callout.callout-style-simple .callout-body{font-size:.9rem;font-weight:400}.callout.callout-style-default .callout-body{font-size:.9rem;font-weight:400}.callout.callout-titled .callout-body{margin-top:.2em}.callout:not(.no-icon).callout-titled.callout-style-simple .callout-body{padding-left:1.6em}.callout.callout-titled>.callout-header{padding-top:.2em;margin-bottom:-0.2em}.callout.callout-style-simple>div.callout-header{border-bottom:none;font-size:.9rem;font-weight:600;opacity:75%}.callout.callout-style-default>div.callout-header{border-bottom:none;font-weight:600;opacity:85%;font-size:.9rem;padding-left:.5em;padding-right:.5em}.callout.callout-style-default div.callout-body{padding-left:.5em;padding-right:.5em}.callout.callout-style-default div.callout-body>:first-child{margin-top:.5em}.callout>div.callout-header[data-bs-toggle=collapse]{cursor:pointer}.callout.callout-style-default .callout-header[aria-expanded=false],.callout.callout-style-default .callout-header[aria-expanded=true]{padding-top:0px;margin-bottom:0px;align-items:center}.callout.callout-titled .callout-body>:last-child:not(.sourceCode),.callout.callout-titled .callout-body>div>:last-child:not(.sourceCode){margin-bottom:.5rem}.callout:not(.callout-titled) .callout-body>:first-child,.callout:not(.callout-titled) .callout-body>div>:first-child{margin-top:.25rem}.callout:not(.callout-titled) .callout-body>:last-child,.callout:not(.callout-titled) .callout-body>div>:last-child{margin-bottom:.2rem}.callout.callout-style-simple .callout-icon::before,.callout.callout-style-simple .callout-toggle::before{height:1rem;width:1rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.callout.callout-style-default .callout-icon::before,.callout.callout-style-default .callout-toggle::before{height:.9rem;width:.9rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:.9rem .9rem}.callout.callout-style-default .callout-toggle::before{margin-top:5px}.callout .callout-btn-toggle .callout-toggle::before{transition:transform .2s linear}.callout .callout-header[aria-expanded=false] .callout-toggle::before{transform:rotate(-90deg)}.callout .callout-header[aria-expanded=true] .callout-toggle::before{transform:none}.callout.callout-style-simple:not(.no-icon) div.callout-icon-container{padding-top:.2em;padding-right:.55em}.callout.callout-style-default:not(.no-icon) div.callout-icon-container{padding-top:.1em;padding-right:.35em}.callout.callout-style-default:not(.no-icon) div.callout-title-container{margin-top:-1px}.callout.callout-style-default.callout-caution:not(.no-icon) div.callout-icon-container{padding-top:.3em;padding-right:.35em}.callout>.callout-body>.callout-icon-container>.no-icon,.callout>.callout-header>.callout-icon-container>.no-icon{display:none}div.callout.callout{border-left-color:#6c757d}div.callout.callout-style-default>.callout-header{background-color:#6c757d}div.callout-note.callout{border-left-color:#375a7f}div.callout-note.callout-style-default>.callout-header{background-color:#111b26}div.callout-note:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-tip.callout{border-left-color:#00bc8c}div.callout-tip.callout-style-default>.callout-header{background-color:#00382a}div.callout-tip:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-warning.callout{border-left-color:#f39c12}div.callout-warning.callout-style-default>.callout-header{background-color:#492f05}div.callout-warning:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-caution.callout{border-left-color:#fd7e14}div.callout-caution.callout-style-default>.callout-header{background-color:#4c2606}div.callout-caution:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-important.callout{border-left-color:#e74c3c}div.callout-important.callout-style-default>.callout-header{background-color:#451712}div.callout-important:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important .callout-toggle::before{background-image:url('data:image/svg+xml,')}.quarto-toggle-container{display:flex;align-items:center}.quarto-reader-toggle .bi::before,.quarto-color-scheme-toggle .bi::before{display:inline-block;height:1rem;width:1rem;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.sidebar-navigation{padding-left:20px}.navbar .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.navbar .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.quarto-sidebar-toggle{border-color:#dee2e6;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem;border-style:solid;border-width:1px;overflow:hidden;border-top-width:0px;padding-top:0px !important}.quarto-sidebar-toggle-title{cursor:pointer;padding-bottom:2px;margin-left:.25em;text-align:center;font-weight:400;font-size:.775em}#quarto-content .quarto-sidebar-toggle{background:#272727}#quarto-content .quarto-sidebar-toggle-title{color:#fff}.quarto-sidebar-toggle-icon{color:#dee2e6;margin-right:.5em;float:right;transition:transform .2s ease}.quarto-sidebar-toggle-icon::before{padding-top:5px}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-icon{transform:rotate(-180deg)}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-title{border-bottom:solid #dee2e6 1px}.quarto-sidebar-toggle-contents{background-color:#222;padding-right:10px;padding-left:10px;margin-top:0px !important;transition:max-height .5s ease}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-contents{padding-top:1em;padding-bottom:10px}.quarto-sidebar-toggle:not(.expanded) .quarto-sidebar-toggle-contents{padding-top:0px !important;padding-bottom:0px}nav[role=doc-toc]{z-index:1020}#quarto-sidebar>*,nav[role=doc-toc]>*{transition:opacity .1s ease,border .1s ease}#quarto-sidebar.slow>*,nav[role=doc-toc].slow>*{transition:opacity .4s ease,border .4s ease}.quarto-color-scheme-toggle:not(.alternate).top-right .bi::before{background-image:url('data:image/svg+xml,')}.quarto-color-scheme-toggle.alternate.top-right .bi::before{background-image:url('data:image/svg+xml,')}#quarto-appendix.default{border-top:1px solid #dee2e6}#quarto-appendix.default{background-color:#222;padding-top:1.5em;margin-top:2em;z-index:998}#quarto-appendix.default .quarto-appendix-heading{margin-top:0;line-height:1.4em;font-weight:600;opacity:.9;border-bottom:none;margin-bottom:0}#quarto-appendix.default .footnotes ol,#quarto-appendix.default .footnotes ol li>p:last-of-type,#quarto-appendix.default .quarto-appendix-contents>p:last-of-type{margin-bottom:0}#quarto-appendix.default .quarto-appendix-secondary-label{margin-bottom:.4em}#quarto-appendix.default .quarto-appendix-bibtex{font-size:.7em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-bibtex code.sourceCode{white-space:pre-wrap}#quarto-appendix.default .quarto-appendix-citeas{font-size:.9em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-heading{font-size:1em !important}#quarto-appendix.default *[role=doc-endnotes]>ol,#quarto-appendix.default .quarto-appendix-contents>*:not(h2):not(.h2){font-size:.9em}#quarto-appendix.default section{padding-bottom:1.5em}#quarto-appendix.default section *[role=doc-endnotes],#quarto-appendix.default section>*:not(a){opacity:.9;word-wrap:break-word}.btn.btn-quarto,div.cell-output-display .btn-quarto{color:#d9d9d9;background-color:#434343;border-color:#434343}.btn.btn-quarto:hover,div.cell-output-display .btn-quarto:hover{color:#d9d9d9;background-color:#5f5f5f;border-color:#565656}.btn-check:focus+.btn.btn-quarto,.btn.btn-quarto:focus,.btn-check:focus+div.cell-output-display .btn-quarto,div.cell-output-display .btn-quarto:focus{color:#d9d9d9;background-color:#5f5f5f;border-color:#565656;box-shadow:0 0 0 .25rem rgba(90,90,90,.5)}.btn-check:checked+.btn.btn-quarto,.btn-check:active+.btn.btn-quarto,.btn.btn-quarto:active,.btn.btn-quarto.active,.show>.btn.btn-quarto.dropdown-toggle,.btn-check:checked+div.cell-output-display .btn-quarto,.btn-check:active+div.cell-output-display .btn-quarto,div.cell-output-display .btn-quarto:active,div.cell-output-display .btn-quarto.active,.show>div.cell-output-display .btn-quarto.dropdown-toggle{color:#fff;background-color:dimgray;border-color:#565656}.btn-check:checked+.btn.btn-quarto:focus,.btn-check:active+.btn.btn-quarto:focus,.btn.btn-quarto:active:focus,.btn.btn-quarto.active:focus,.show>.btn.btn-quarto.dropdown-toggle:focus,.btn-check:checked+div.cell-output-display .btn-quarto:focus,.btn-check:active+div.cell-output-display .btn-quarto:focus,div.cell-output-display .btn-quarto:active:focus,div.cell-output-display .btn-quarto.active:focus,.show>div.cell-output-display .btn-quarto.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(90,90,90,.5)}.btn.btn-quarto:disabled,.btn.btn-quarto.disabled,div.cell-output-display .btn-quarto:disabled,div.cell-output-display .btn-quarto.disabled{color:#fff;background-color:#434343;border-color:#434343}nav.quarto-secondary-nav.color-navbar{background-color:#375a7f;color:#dee2e6}nav.quarto-secondary-nav.color-navbar h1,nav.quarto-secondary-nav.color-navbar .h1,nav.quarto-secondary-nav.color-navbar .quarto-btn-toggle{color:#dee2e6}@media(max-width: 991.98px){body.nav-sidebar .quarto-title-banner{margin-bottom:0;padding-bottom:0}body.nav-sidebar #title-block-header{margin-block-end:0}}p.subtitle{margin-top:.25em;margin-bottom:.5em}code a:any-link{color:inherit;text-decoration-color:#6c757d}/*! dark */div.observablehq table thead tr th{background-color:var(--bs-body-bg)}input,button,select,optgroup,textarea{background-color:var(--bs-body-bg)}.code-annotated .code-copy-button{margin-right:1.25em;margin-top:0;padding-bottom:0;padding-top:3px}.code-annotation-gutter-bg{background-color:#222}.code-annotation-gutter{background-color:#000}.code-annotation-gutter,.code-annotation-gutter-bg{height:100%;width:calc(20px + .5em);position:absolute;top:0;right:0}dl.code-annotation-container-grid dt{margin-right:1em;margin-top:.25rem}dl.code-annotation-container-grid dt{font-family:var(--bs-font-monospace);color:#e6e6e6;border:solid #e6e6e6 1px;border-radius:50%;height:22px;width:22px;line-height:22px;font-size:11px;text-align:center;vertical-align:middle;text-decoration:none}dl.code-annotation-container-grid dt[data-target-cell]{cursor:pointer}dl.code-annotation-container-grid dt[data-target-cell].code-annotation-active{color:#222;border:solid #aaa 1px;background-color:#aaa}pre.code-annotation-code{padding-top:0;padding-bottom:0}pre.code-annotation-code code{z-index:3}#code-annotation-line-highlight-gutter{width:100%;border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}#code-annotation-line-highlight{margin-left:-4em;width:calc(100% + 4em);border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}code.sourceCode .code-annotation-anchor.code-annotation-active{background-color:var(--quarto-hl-normal-color, #aaaaaa);border:solid var(--quarto-hl-normal-color, #aaaaaa) 1px;color:#000;font-weight:bolder}code.sourceCode .code-annotation-anchor{font-family:var(--bs-font-monospace);color:var(--quarto-hl-co-color);border:solid var(--quarto-hl-co-color) 1px;border-radius:50%;height:18px;width:18px;font-size:9px;margin-top:2px}code.sourceCode button.code-annotation-anchor{padding:2px}code.sourceCode a.code-annotation-anchor{line-height:18px;text-align:center;vertical-align:middle;cursor:default;text-decoration:none}@media print{.page-columns .column-screen-inset{grid-column:page-start-inset/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset table{background:#222}.page-columns .column-screen-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-left table{background:#222}.page-columns .column-screen-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-right table{background:#222}.page-columns .column-screen{grid-column:page-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen table{background:#222}.page-columns .column-screen-left{grid-column:page-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-left table{background:#222}.page-columns .column-screen-right{grid-column:body-content-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-right table{background:#222}.page-columns .column-screen-inset-shaded{grid-column:page-start-inset/page-end-inset;padding:1em;background:#6f6f6f;z-index:998;transform:translate3d(0, 0, 0);margin-bottom:1em}}.quarto-video{margin-bottom:1em}.table>thead{border-top-width:0}.table>:not(caption)>*:not(:last-child)>*{border-bottom-color:#fff;border-bottom-style:solid;border-bottom-width:1px}.table>:not(:first-child){border-top:1px solid #fff;border-bottom:1px solid inherit}.table tbody{border-bottom-color:#fff}a.external:after{display:inline-block;height:.75rem;width:.75rem;margin-bottom:.15em;margin-left:.25em;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:.75rem .75rem}div.sourceCode code a.external:after{content:none}a.external:after:hover{cursor:pointer}.quarto-ext-icon{display:inline-block;font-size:.75em;padding-left:.3em}.code-with-filename .code-with-filename-file{margin-bottom:0;padding-bottom:2px;padding-top:2px;padding-left:.7em;border:var(--quarto-border-width) solid var(--quarto-border-color);border-radius:var(--quarto-border-radius);border-bottom:0;border-bottom-left-radius:0%;border-bottom-right-radius:0%}.code-with-filename div.sourceCode,.reveal .code-with-filename div.sourceCode{margin-top:0;border-top-left-radius:0%;border-top-right-radius:0%}.code-with-filename .code-with-filename-file pre{margin-bottom:0}.code-with-filename .code-with-filename-file,.code-with-filename .code-with-filename-file pre{background-color:rgba(219,219,219,.8)}.quarto-dark .code-with-filename .code-with-filename-file,.quarto-dark .code-with-filename .code-with-filename-file pre{background-color:#555}.code-with-filename .code-with-filename-file strong{font-weight:400}.blockquote-footer{color:#595959}.input-group-addon{color:#fff}.form-floating>label{color:#444}.nav-tabs .nav-link,.nav-tabs .nav-link.active,.nav-tabs .nav-link.active:focus,.nav-tabs .nav-link.active:hover,.nav-tabs .nav-item.open .nav-link,.nav-tabs .nav-item.open .nav-link:focus,.nav-tabs .nav-item.open .nav-link:hover,.nav-pills .nav-link,.nav-pills .nav-link.active,.nav-pills .nav-link.active:focus,.nav-pills .nav-link.active:hover,.nav-pills .nav-item.open .nav-link,.nav-pills .nav-item.open .nav-link:focus,.nav-pills .nav-item.open .nav-link:hover{color:#fff}.breadcrumb a{color:#fff}.pagination a:hover{text-decoration:none}.alert{border:none;color:#fff}.alert a,.alert .alert-link{color:#fff;text-decoration:underline}.alert-default{background-color:#434343}.alert-primary{background-color:#375a7f}.alert-secondary{background-color:#434343}.alert-success{background-color:#00bc8c}.alert-info{background-color:#3498db}.alert-warning{background-color:#f39c12}.alert-danger{background-color:#e74c3c}.alert-light{background-color:#6f6f6f}.alert-dark{background-color:#2d2d2d}.quarto-title-banner{margin-bottom:1em;color:#dee2e6;background:#375a7f}.quarto-title-banner .code-tools-button{color:#a4afba}.quarto-title-banner .code-tools-button:hover{color:#dee2e6}.quarto-title-banner .code-tools-button>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .quarto-title .title{font-weight:600}.quarto-title-banner .quarto-categories{margin-top:.75em}@media(min-width: 992px){.quarto-title-banner{padding-top:2.5em;padding-bottom:2.5em}}@media(max-width: 991.98px){.quarto-title-banner{padding-top:1em;padding-bottom:1em}}main.quarto-banner-title-block>section:first-child>h2,main.quarto-banner-title-block>section:first-child>.h2,main.quarto-banner-title-block>section:first-child>h3,main.quarto-banner-title-block>section:first-child>.h3,main.quarto-banner-title-block>section:first-child>h4,main.quarto-banner-title-block>section:first-child>.h4{margin-top:0}.quarto-title .quarto-categories{display:flex;flex-wrap:wrap;row-gap:.5em;column-gap:.4em;padding-bottom:.5em;margin-top:.75em}.quarto-title .quarto-categories .quarto-category{padding:.25em .75em;font-size:.65em;text-transform:uppercase;border:solid 1px;border-radius:.25rem;opacity:.6}.quarto-title .quarto-categories .quarto-category a{color:inherit}#title-block-header.quarto-title-block.default .quarto-title-meta{display:grid;grid-template-columns:repeat(2, 1fr)}#title-block-header.quarto-title-block.default .quarto-title .title{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-author-orcid img{margin-top:-5px}#title-block-header.quarto-title-block.default .quarto-description p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p,#title-block-header.quarto-title-block.default .quarto-title-authors p,#title-block-header.quarto-title-block.default .quarto-title-affiliations p{margin-bottom:.1em}#title-block-header.quarto-title-block.default .quarto-title-meta-heading{text-transform:uppercase;margin-top:1em;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-contents{font-size:.9em}#title-block-header.quarto-title-block.default .quarto-title-meta-contents a{color:#fff}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p.affiliation:last-of-type{margin-bottom:.7em}#title-block-header.quarto-title-block.default p.affiliation{margin-bottom:.1em}#title-block-header.quarto-title-block.default .description,#title-block-header.quarto-title-block.default .abstract{margin-top:0}#title-block-header.quarto-title-block.default .description>p,#title-block-header.quarto-title-block.default .abstract>p{font-size:.9em}#title-block-header.quarto-title-block.default .description>p:last-of-type,#title-block-header.quarto-title-block.default .abstract>p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .description .abstract-title,#title-block-header.quarto-title-block.default .abstract .abstract-title{margin-top:1em;text-transform:uppercase;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-author{display:grid;grid-template-columns:1fr 1fr}.quarto-title-tools-only{display:flex;justify-content:right}/*# sourceMappingURL=945575463e70190d99eb671cb8520afc.css.map */ +*/.ansi-black-fg{color:#3e424d}.ansi-black-bg{background-color:#3e424d}.ansi-black-intense-fg{color:#282c36}.ansi-black-intense-bg{background-color:#282c36}.ansi-red-fg{color:#e75c58}.ansi-red-bg{background-color:#e75c58}.ansi-red-intense-fg{color:#b22b31}.ansi-red-intense-bg{background-color:#b22b31}.ansi-green-fg{color:#00a250}.ansi-green-bg{background-color:#00a250}.ansi-green-intense-fg{color:#007427}.ansi-green-intense-bg{background-color:#007427}.ansi-yellow-fg{color:#ddb62b}.ansi-yellow-bg{background-color:#ddb62b}.ansi-yellow-intense-fg{color:#b27d12}.ansi-yellow-intense-bg{background-color:#b27d12}.ansi-blue-fg{color:#208ffb}.ansi-blue-bg{background-color:#208ffb}.ansi-blue-intense-fg{color:#0065ca}.ansi-blue-intense-bg{background-color:#0065ca}.ansi-magenta-fg{color:#d160c4}.ansi-magenta-bg{background-color:#d160c4}.ansi-magenta-intense-fg{color:#a03196}.ansi-magenta-intense-bg{background-color:#a03196}.ansi-cyan-fg{color:#60c6c8}.ansi-cyan-bg{background-color:#60c6c8}.ansi-cyan-intense-fg{color:#258f8f}.ansi-cyan-intense-bg{background-color:#258f8f}.ansi-white-fg{color:#c5c1b4}.ansi-white-bg{background-color:#c5c1b4}.ansi-white-intense-fg{color:#a1a6b2}.ansi-white-intense-bg{background-color:#a1a6b2}.ansi-default-inverse-fg{color:#fff}.ansi-default-inverse-bg{background-color:#000}.ansi-bold{font-weight:bold}.ansi-underline{text-decoration:underline}:root{--quarto-body-bg: #222;--quarto-body-color: #fff;--quarto-text-muted: #6c757d;--quarto-border-color: #434343;--quarto-border-width: 1px;--quarto-border-radius: 0.25rem}table.gt_table{color:var(--quarto-body-color);font-size:1em;width:100%;background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_column_spanner_outer{color:var(--quarto-body-color);background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_col_heading{color:var(--quarto-body-color);font-weight:bold;background-color:rgba(0,0,0,0)}table.gt_table thead.gt_col_headings{border-bottom:1px solid currentColor;border-top-width:inherit;border-top-color:var(--quarto-border-color)}table.gt_table thead.gt_col_headings:not(:first-child){border-top-width:1px;border-top-color:var(--quarto-border-color)}table.gt_table td.gt_row{border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-width:0px}table.gt_table tbody.gt_table_body{border-top-width:1px;border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-color:currentColor}div.columns{display:initial;gap:initial}div.column{display:inline-block;overflow-x:initial;vertical-align:top;width:50%}.code-annotation-tip-content{word-wrap:break-word}.code-annotation-container-hidden{display:none !important}dl.code-annotation-container-grid{display:grid;grid-template-columns:min-content auto}dl.code-annotation-container-grid dt{grid-column:1}dl.code-annotation-container-grid dd{grid-column:2}pre.sourceCode.code-annotation-code{padding-right:0}code.sourceCode .code-annotation-anchor{z-index:100;position:absolute;right:.5em;left:inherit;background-color:rgba(0,0,0,0)}:root{--mermaid-bg-color: #222;--mermaid-edge-color: #434343;--mermaid-node-fg-color: #fff;--mermaid-fg-color: #fff;--mermaid-fg-color--lighter: white;--mermaid-fg-color--lightest: white;--mermaid-font-family: Lato, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;--mermaid-label-bg-color: #222;--mermaid-label-fg-color: #375a7f;--mermaid-node-bg-color: rgba(55, 90, 127, 0.1);--mermaid-node-fg-color: #fff}@media print{:root{font-size:11pt}#quarto-sidebar,#TOC,.nav-page{display:none}.page-columns .content{grid-column-start:page-start}.fixed-top{position:relative}.panel-caption,.figure-caption,figcaption{color:#666}}.code-copy-button{position:absolute;top:0;right:0;border:0;margin-top:5px;margin-right:5px;background-color:rgba(0,0,0,0);z-index:3}.code-copy-button:focus{outline:none}.code-copy-button-tooltip{font-size:.75em}pre.sourceCode:hover>.code-copy-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}pre.sourceCode:hover>.code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button-checked:hover>.bi::before{background-image:url('data:image/svg+xml,')}main ol ol,main ul ul,main ol ul,main ul ol{margin-bottom:1em}ul>li:not(:has(>p))>ul,ol>li:not(:has(>p))>ul,ul>li:not(:has(>p))>ol,ol>li:not(:has(>p))>ol{margin-bottom:0}ul>li:not(:has(>p))>ul>li:has(>p),ol>li:not(:has(>p))>ul>li:has(>p),ul>li:not(:has(>p))>ol>li:has(>p),ol>li:not(:has(>p))>ol>li:has(>p){margin-top:1rem}body{margin:0}main.page-columns>header>h1.title,main.page-columns>header>.title.h1{margin-bottom:0}@media(min-width: 992px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] 35px [page-end-inset page-end] 5fr [screen-end-inset] 1.5em}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 3em [body-end] 50px [body-end-outset] minmax(0px, 250px) [page-end-inset] minmax(50px, 100px) [page-end] 1fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 100px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 150px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 991.98px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 1250px - 3em )) [body-content-end body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1.5em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 767.98px){body .page-columns,body.fullcontent:not(.floating):not(.docked) .page-columns,body.slimcontent:not(.floating):not(.docked) .page-columns,body.docked .page-columns,body.docked.slimcontent .page-columns,body.docked.fullcontent .page-columns,body.floating .page-columns,body.floating.slimcontent .page-columns,body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}nav[role=doc-toc]{display:none}}body,.page-row-navigation{grid-template-rows:[page-top] max-content [contents-top] max-content [contents-bottom] max-content [page-bottom]}.page-rows-contents{grid-template-rows:[content-top] minmax(max-content, 1fr) [content-bottom] minmax(60px, max-content) [page-bottom]}.page-full{grid-column:screen-start/screen-end !important}.page-columns>*{grid-column:body-content-start/body-content-end}.page-columns.column-page>*{grid-column:page-start/page-end}.page-columns.column-page-left>*{grid-column:page-start/body-content-end}.page-columns.column-page-right>*{grid-column:body-content-start/page-end}.page-rows{grid-auto-rows:auto}.header{grid-column:screen-start/screen-end;grid-row:page-top/contents-top}#quarto-content{padding:0;grid-column:screen-start/screen-end;grid-row:contents-top/contents-bottom}body.floating .sidebar.sidebar-navigation{grid-column:page-start/body-start;grid-row:content-top/page-bottom}body.docked .sidebar.sidebar-navigation{grid-column:screen-start/body-start;grid-row:content-top/page-bottom}.sidebar.toc-left{grid-column:page-start/body-start;grid-row:content-top/page-bottom}.sidebar.margin-sidebar{grid-column:body-end/page-end;grid-row:content-top/page-bottom}.page-columns .content{grid-column:body-content-start/body-content-end;grid-row:content-top/content-bottom;align-content:flex-start}.page-columns .page-navigation{grid-column:body-content-start/body-content-end;grid-row:content-bottom/page-bottom}.page-columns .footer{grid-column:screen-start/screen-end;grid-row:contents-bottom/page-bottom}.page-columns .column-body{grid-column:body-content-start/body-content-end}.page-columns .column-body-fullbleed{grid-column:body-start/body-end}.page-columns .column-body-outset{grid-column:body-start-outset/body-end-outset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset table{background:#222}.page-columns .column-body-outset-left{grid-column:body-start-outset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset-left table{background:#222}.page-columns .column-body-outset-right{grid-column:body-content-start/body-end-outset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset-right table{background:#222}.page-columns .column-page{grid-column:page-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page table{background:#222}.page-columns .column-page-inset{grid-column:page-start-inset/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset table{background:#222}.page-columns .column-page-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset-left table{background:#222}.page-columns .column-page-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset-right figcaption table{background:#222}.page-columns .column-page-left{grid-column:page-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-left table{background:#222}.page-columns .column-page-right{grid-column:body-content-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-right figcaption table{background:#222}#quarto-content.page-columns #quarto-margin-sidebar,#quarto-content.page-columns #quarto-sidebar{z-index:1}@media(max-width: 991.98px){#quarto-content.page-columns #quarto-margin-sidebar.collapse,#quarto-content.page-columns #quarto-sidebar.collapse,#quarto-content.page-columns #quarto-margin-sidebar.collapsing,#quarto-content.page-columns #quarto-sidebar.collapsing{z-index:1055}}#quarto-content.page-columns main.column-page,#quarto-content.page-columns main.column-page-right,#quarto-content.page-columns main.column-page-left{z-index:0}.page-columns .column-screen-inset{grid-column:screen-start-inset/screen-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset table{background:#222}.page-columns .column-screen-inset-left{grid-column:screen-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-left table{background:#222}.page-columns .column-screen-inset-right{grid-column:body-content-start/screen-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-right table{background:#222}.page-columns .column-screen{grid-column:screen-start/screen-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen table{background:#222}.page-columns .column-screen-left{grid-column:screen-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-left table{background:#222}.page-columns .column-screen-right{grid-column:body-content-start/screen-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-right table{background:#222}.page-columns .column-screen-inset-shaded{grid-column:screen-start/screen-end;padding:1em;background:#6f6f6f;z-index:998;transform:translate3d(0, 0, 0);margin-bottom:1em}.zindex-content{z-index:998;transform:translate3d(0, 0, 0)}.zindex-modal{z-index:1055;transform:translate3d(0, 0, 0)}.zindex-over-content{z-index:999;transform:translate3d(0, 0, 0)}img.img-fluid.column-screen,img.img-fluid.column-screen-inset-shaded,img.img-fluid.column-screen-inset,img.img-fluid.column-screen-inset-left,img.img-fluid.column-screen-inset-right,img.img-fluid.column-screen-left,img.img-fluid.column-screen-right{width:100%}@media(min-width: 992px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-end/page-end !important;z-index:998}.column-sidebar{grid-column:page-start/body-start !important;z-index:998}.column-leftmargin{grid-column:screen-start-inset/body-start !important;z-index:998}.no-row-height{height:1em;overflow:visible}}@media(max-width: 991.98px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-end/page-end !important;z-index:998}.no-row-height{height:1em;overflow:visible}.page-columns.page-full{overflow:visible}.page-columns.toc-left .margin-caption,.page-columns.toc-left div.aside,.page-columns.toc-left aside,.page-columns.toc-left .column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;transform:translate3d(0, 0, 0)}.page-columns.toc-left .no-row-height{height:initial;overflow:initial}}@media(max-width: 767.98px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;transform:translate3d(0, 0, 0)}.no-row-height{height:initial;overflow:initial}#quarto-margin-sidebar{display:none}#quarto-sidebar-toc-left{display:none}.hidden-sm{display:none}}.panel-grid{display:grid;grid-template-rows:repeat(1, 1fr);grid-template-columns:repeat(24, 1fr);gap:1em}.panel-grid .g-col-1{grid-column:auto/span 1}.panel-grid .g-col-2{grid-column:auto/span 2}.panel-grid .g-col-3{grid-column:auto/span 3}.panel-grid .g-col-4{grid-column:auto/span 4}.panel-grid .g-col-5{grid-column:auto/span 5}.panel-grid .g-col-6{grid-column:auto/span 6}.panel-grid .g-col-7{grid-column:auto/span 7}.panel-grid .g-col-8{grid-column:auto/span 8}.panel-grid .g-col-9{grid-column:auto/span 9}.panel-grid .g-col-10{grid-column:auto/span 10}.panel-grid .g-col-11{grid-column:auto/span 11}.panel-grid .g-col-12{grid-column:auto/span 12}.panel-grid .g-col-13{grid-column:auto/span 13}.panel-grid .g-col-14{grid-column:auto/span 14}.panel-grid .g-col-15{grid-column:auto/span 15}.panel-grid .g-col-16{grid-column:auto/span 16}.panel-grid .g-col-17{grid-column:auto/span 17}.panel-grid .g-col-18{grid-column:auto/span 18}.panel-grid .g-col-19{grid-column:auto/span 19}.panel-grid .g-col-20{grid-column:auto/span 20}.panel-grid .g-col-21{grid-column:auto/span 21}.panel-grid .g-col-22{grid-column:auto/span 22}.panel-grid .g-col-23{grid-column:auto/span 23}.panel-grid .g-col-24{grid-column:auto/span 24}.panel-grid .g-start-1{grid-column-start:1}.panel-grid .g-start-2{grid-column-start:2}.panel-grid .g-start-3{grid-column-start:3}.panel-grid .g-start-4{grid-column-start:4}.panel-grid .g-start-5{grid-column-start:5}.panel-grid .g-start-6{grid-column-start:6}.panel-grid .g-start-7{grid-column-start:7}.panel-grid .g-start-8{grid-column-start:8}.panel-grid .g-start-9{grid-column-start:9}.panel-grid .g-start-10{grid-column-start:10}.panel-grid .g-start-11{grid-column-start:11}.panel-grid .g-start-12{grid-column-start:12}.panel-grid .g-start-13{grid-column-start:13}.panel-grid .g-start-14{grid-column-start:14}.panel-grid .g-start-15{grid-column-start:15}.panel-grid .g-start-16{grid-column-start:16}.panel-grid .g-start-17{grid-column-start:17}.panel-grid .g-start-18{grid-column-start:18}.panel-grid .g-start-19{grid-column-start:19}.panel-grid .g-start-20{grid-column-start:20}.panel-grid .g-start-21{grid-column-start:21}.panel-grid .g-start-22{grid-column-start:22}.panel-grid .g-start-23{grid-column-start:23}@media(min-width: 576px){.panel-grid .g-col-sm-1{grid-column:auto/span 1}.panel-grid .g-col-sm-2{grid-column:auto/span 2}.panel-grid .g-col-sm-3{grid-column:auto/span 3}.panel-grid .g-col-sm-4{grid-column:auto/span 4}.panel-grid .g-col-sm-5{grid-column:auto/span 5}.panel-grid .g-col-sm-6{grid-column:auto/span 6}.panel-grid .g-col-sm-7{grid-column:auto/span 7}.panel-grid .g-col-sm-8{grid-column:auto/span 8}.panel-grid .g-col-sm-9{grid-column:auto/span 9}.panel-grid .g-col-sm-10{grid-column:auto/span 10}.panel-grid .g-col-sm-11{grid-column:auto/span 11}.panel-grid .g-col-sm-12{grid-column:auto/span 12}.panel-grid .g-col-sm-13{grid-column:auto/span 13}.panel-grid .g-col-sm-14{grid-column:auto/span 14}.panel-grid .g-col-sm-15{grid-column:auto/span 15}.panel-grid .g-col-sm-16{grid-column:auto/span 16}.panel-grid .g-col-sm-17{grid-column:auto/span 17}.panel-grid .g-col-sm-18{grid-column:auto/span 18}.panel-grid .g-col-sm-19{grid-column:auto/span 19}.panel-grid .g-col-sm-20{grid-column:auto/span 20}.panel-grid .g-col-sm-21{grid-column:auto/span 21}.panel-grid .g-col-sm-22{grid-column:auto/span 22}.panel-grid .g-col-sm-23{grid-column:auto/span 23}.panel-grid .g-col-sm-24{grid-column:auto/span 24}.panel-grid .g-start-sm-1{grid-column-start:1}.panel-grid .g-start-sm-2{grid-column-start:2}.panel-grid .g-start-sm-3{grid-column-start:3}.panel-grid .g-start-sm-4{grid-column-start:4}.panel-grid .g-start-sm-5{grid-column-start:5}.panel-grid .g-start-sm-6{grid-column-start:6}.panel-grid .g-start-sm-7{grid-column-start:7}.panel-grid .g-start-sm-8{grid-column-start:8}.panel-grid .g-start-sm-9{grid-column-start:9}.panel-grid .g-start-sm-10{grid-column-start:10}.panel-grid .g-start-sm-11{grid-column-start:11}.panel-grid .g-start-sm-12{grid-column-start:12}.panel-grid .g-start-sm-13{grid-column-start:13}.panel-grid .g-start-sm-14{grid-column-start:14}.panel-grid .g-start-sm-15{grid-column-start:15}.panel-grid .g-start-sm-16{grid-column-start:16}.panel-grid .g-start-sm-17{grid-column-start:17}.panel-grid .g-start-sm-18{grid-column-start:18}.panel-grid .g-start-sm-19{grid-column-start:19}.panel-grid .g-start-sm-20{grid-column-start:20}.panel-grid .g-start-sm-21{grid-column-start:21}.panel-grid .g-start-sm-22{grid-column-start:22}.panel-grid .g-start-sm-23{grid-column-start:23}}@media(min-width: 768px){.panel-grid .g-col-md-1{grid-column:auto/span 1}.panel-grid .g-col-md-2{grid-column:auto/span 2}.panel-grid .g-col-md-3{grid-column:auto/span 3}.panel-grid .g-col-md-4{grid-column:auto/span 4}.panel-grid .g-col-md-5{grid-column:auto/span 5}.panel-grid .g-col-md-6{grid-column:auto/span 6}.panel-grid .g-col-md-7{grid-column:auto/span 7}.panel-grid .g-col-md-8{grid-column:auto/span 8}.panel-grid .g-col-md-9{grid-column:auto/span 9}.panel-grid .g-col-md-10{grid-column:auto/span 10}.panel-grid .g-col-md-11{grid-column:auto/span 11}.panel-grid .g-col-md-12{grid-column:auto/span 12}.panel-grid .g-col-md-13{grid-column:auto/span 13}.panel-grid .g-col-md-14{grid-column:auto/span 14}.panel-grid .g-col-md-15{grid-column:auto/span 15}.panel-grid .g-col-md-16{grid-column:auto/span 16}.panel-grid .g-col-md-17{grid-column:auto/span 17}.panel-grid .g-col-md-18{grid-column:auto/span 18}.panel-grid .g-col-md-19{grid-column:auto/span 19}.panel-grid .g-col-md-20{grid-column:auto/span 20}.panel-grid .g-col-md-21{grid-column:auto/span 21}.panel-grid .g-col-md-22{grid-column:auto/span 22}.panel-grid .g-col-md-23{grid-column:auto/span 23}.panel-grid .g-col-md-24{grid-column:auto/span 24}.panel-grid .g-start-md-1{grid-column-start:1}.panel-grid .g-start-md-2{grid-column-start:2}.panel-grid .g-start-md-3{grid-column-start:3}.panel-grid .g-start-md-4{grid-column-start:4}.panel-grid .g-start-md-5{grid-column-start:5}.panel-grid .g-start-md-6{grid-column-start:6}.panel-grid .g-start-md-7{grid-column-start:7}.panel-grid .g-start-md-8{grid-column-start:8}.panel-grid .g-start-md-9{grid-column-start:9}.panel-grid .g-start-md-10{grid-column-start:10}.panel-grid .g-start-md-11{grid-column-start:11}.panel-grid .g-start-md-12{grid-column-start:12}.panel-grid .g-start-md-13{grid-column-start:13}.panel-grid .g-start-md-14{grid-column-start:14}.panel-grid .g-start-md-15{grid-column-start:15}.panel-grid .g-start-md-16{grid-column-start:16}.panel-grid .g-start-md-17{grid-column-start:17}.panel-grid .g-start-md-18{grid-column-start:18}.panel-grid .g-start-md-19{grid-column-start:19}.panel-grid .g-start-md-20{grid-column-start:20}.panel-grid .g-start-md-21{grid-column-start:21}.panel-grid .g-start-md-22{grid-column-start:22}.panel-grid .g-start-md-23{grid-column-start:23}}@media(min-width: 992px){.panel-grid .g-col-lg-1{grid-column:auto/span 1}.panel-grid .g-col-lg-2{grid-column:auto/span 2}.panel-grid .g-col-lg-3{grid-column:auto/span 3}.panel-grid .g-col-lg-4{grid-column:auto/span 4}.panel-grid .g-col-lg-5{grid-column:auto/span 5}.panel-grid .g-col-lg-6{grid-column:auto/span 6}.panel-grid .g-col-lg-7{grid-column:auto/span 7}.panel-grid .g-col-lg-8{grid-column:auto/span 8}.panel-grid .g-col-lg-9{grid-column:auto/span 9}.panel-grid .g-col-lg-10{grid-column:auto/span 10}.panel-grid .g-col-lg-11{grid-column:auto/span 11}.panel-grid .g-col-lg-12{grid-column:auto/span 12}.panel-grid .g-col-lg-13{grid-column:auto/span 13}.panel-grid .g-col-lg-14{grid-column:auto/span 14}.panel-grid .g-col-lg-15{grid-column:auto/span 15}.panel-grid .g-col-lg-16{grid-column:auto/span 16}.panel-grid .g-col-lg-17{grid-column:auto/span 17}.panel-grid .g-col-lg-18{grid-column:auto/span 18}.panel-grid .g-col-lg-19{grid-column:auto/span 19}.panel-grid .g-col-lg-20{grid-column:auto/span 20}.panel-grid .g-col-lg-21{grid-column:auto/span 21}.panel-grid .g-col-lg-22{grid-column:auto/span 22}.panel-grid .g-col-lg-23{grid-column:auto/span 23}.panel-grid .g-col-lg-24{grid-column:auto/span 24}.panel-grid .g-start-lg-1{grid-column-start:1}.panel-grid .g-start-lg-2{grid-column-start:2}.panel-grid .g-start-lg-3{grid-column-start:3}.panel-grid .g-start-lg-4{grid-column-start:4}.panel-grid .g-start-lg-5{grid-column-start:5}.panel-grid .g-start-lg-6{grid-column-start:6}.panel-grid .g-start-lg-7{grid-column-start:7}.panel-grid .g-start-lg-8{grid-column-start:8}.panel-grid .g-start-lg-9{grid-column-start:9}.panel-grid .g-start-lg-10{grid-column-start:10}.panel-grid .g-start-lg-11{grid-column-start:11}.panel-grid .g-start-lg-12{grid-column-start:12}.panel-grid .g-start-lg-13{grid-column-start:13}.panel-grid .g-start-lg-14{grid-column-start:14}.panel-grid .g-start-lg-15{grid-column-start:15}.panel-grid .g-start-lg-16{grid-column-start:16}.panel-grid .g-start-lg-17{grid-column-start:17}.panel-grid .g-start-lg-18{grid-column-start:18}.panel-grid .g-start-lg-19{grid-column-start:19}.panel-grid .g-start-lg-20{grid-column-start:20}.panel-grid .g-start-lg-21{grid-column-start:21}.panel-grid .g-start-lg-22{grid-column-start:22}.panel-grid .g-start-lg-23{grid-column-start:23}}@media(min-width: 1200px){.panel-grid .g-col-xl-1{grid-column:auto/span 1}.panel-grid .g-col-xl-2{grid-column:auto/span 2}.panel-grid .g-col-xl-3{grid-column:auto/span 3}.panel-grid .g-col-xl-4{grid-column:auto/span 4}.panel-grid .g-col-xl-5{grid-column:auto/span 5}.panel-grid .g-col-xl-6{grid-column:auto/span 6}.panel-grid .g-col-xl-7{grid-column:auto/span 7}.panel-grid .g-col-xl-8{grid-column:auto/span 8}.panel-grid .g-col-xl-9{grid-column:auto/span 9}.panel-grid .g-col-xl-10{grid-column:auto/span 10}.panel-grid .g-col-xl-11{grid-column:auto/span 11}.panel-grid .g-col-xl-12{grid-column:auto/span 12}.panel-grid .g-col-xl-13{grid-column:auto/span 13}.panel-grid .g-col-xl-14{grid-column:auto/span 14}.panel-grid .g-col-xl-15{grid-column:auto/span 15}.panel-grid .g-col-xl-16{grid-column:auto/span 16}.panel-grid .g-col-xl-17{grid-column:auto/span 17}.panel-grid .g-col-xl-18{grid-column:auto/span 18}.panel-grid .g-col-xl-19{grid-column:auto/span 19}.panel-grid .g-col-xl-20{grid-column:auto/span 20}.panel-grid .g-col-xl-21{grid-column:auto/span 21}.panel-grid .g-col-xl-22{grid-column:auto/span 22}.panel-grid .g-col-xl-23{grid-column:auto/span 23}.panel-grid .g-col-xl-24{grid-column:auto/span 24}.panel-grid .g-start-xl-1{grid-column-start:1}.panel-grid .g-start-xl-2{grid-column-start:2}.panel-grid .g-start-xl-3{grid-column-start:3}.panel-grid .g-start-xl-4{grid-column-start:4}.panel-grid .g-start-xl-5{grid-column-start:5}.panel-grid .g-start-xl-6{grid-column-start:6}.panel-grid .g-start-xl-7{grid-column-start:7}.panel-grid .g-start-xl-8{grid-column-start:8}.panel-grid .g-start-xl-9{grid-column-start:9}.panel-grid .g-start-xl-10{grid-column-start:10}.panel-grid .g-start-xl-11{grid-column-start:11}.panel-grid .g-start-xl-12{grid-column-start:12}.panel-grid .g-start-xl-13{grid-column-start:13}.panel-grid .g-start-xl-14{grid-column-start:14}.panel-grid .g-start-xl-15{grid-column-start:15}.panel-grid .g-start-xl-16{grid-column-start:16}.panel-grid .g-start-xl-17{grid-column-start:17}.panel-grid .g-start-xl-18{grid-column-start:18}.panel-grid .g-start-xl-19{grid-column-start:19}.panel-grid .g-start-xl-20{grid-column-start:20}.panel-grid .g-start-xl-21{grid-column-start:21}.panel-grid .g-start-xl-22{grid-column-start:22}.panel-grid .g-start-xl-23{grid-column-start:23}}@media(min-width: 1400px){.panel-grid .g-col-xxl-1{grid-column:auto/span 1}.panel-grid .g-col-xxl-2{grid-column:auto/span 2}.panel-grid .g-col-xxl-3{grid-column:auto/span 3}.panel-grid .g-col-xxl-4{grid-column:auto/span 4}.panel-grid .g-col-xxl-5{grid-column:auto/span 5}.panel-grid .g-col-xxl-6{grid-column:auto/span 6}.panel-grid .g-col-xxl-7{grid-column:auto/span 7}.panel-grid .g-col-xxl-8{grid-column:auto/span 8}.panel-grid .g-col-xxl-9{grid-column:auto/span 9}.panel-grid .g-col-xxl-10{grid-column:auto/span 10}.panel-grid .g-col-xxl-11{grid-column:auto/span 11}.panel-grid .g-col-xxl-12{grid-column:auto/span 12}.panel-grid .g-col-xxl-13{grid-column:auto/span 13}.panel-grid .g-col-xxl-14{grid-column:auto/span 14}.panel-grid .g-col-xxl-15{grid-column:auto/span 15}.panel-grid .g-col-xxl-16{grid-column:auto/span 16}.panel-grid .g-col-xxl-17{grid-column:auto/span 17}.panel-grid .g-col-xxl-18{grid-column:auto/span 18}.panel-grid .g-col-xxl-19{grid-column:auto/span 19}.panel-grid .g-col-xxl-20{grid-column:auto/span 20}.panel-grid .g-col-xxl-21{grid-column:auto/span 21}.panel-grid .g-col-xxl-22{grid-column:auto/span 22}.panel-grid .g-col-xxl-23{grid-column:auto/span 23}.panel-grid .g-col-xxl-24{grid-column:auto/span 24}.panel-grid .g-start-xxl-1{grid-column-start:1}.panel-grid .g-start-xxl-2{grid-column-start:2}.panel-grid .g-start-xxl-3{grid-column-start:3}.panel-grid .g-start-xxl-4{grid-column-start:4}.panel-grid .g-start-xxl-5{grid-column-start:5}.panel-grid .g-start-xxl-6{grid-column-start:6}.panel-grid .g-start-xxl-7{grid-column-start:7}.panel-grid .g-start-xxl-8{grid-column-start:8}.panel-grid .g-start-xxl-9{grid-column-start:9}.panel-grid .g-start-xxl-10{grid-column-start:10}.panel-grid .g-start-xxl-11{grid-column-start:11}.panel-grid .g-start-xxl-12{grid-column-start:12}.panel-grid .g-start-xxl-13{grid-column-start:13}.panel-grid .g-start-xxl-14{grid-column-start:14}.panel-grid .g-start-xxl-15{grid-column-start:15}.panel-grid .g-start-xxl-16{grid-column-start:16}.panel-grid .g-start-xxl-17{grid-column-start:17}.panel-grid .g-start-xxl-18{grid-column-start:18}.panel-grid .g-start-xxl-19{grid-column-start:19}.panel-grid .g-start-xxl-20{grid-column-start:20}.panel-grid .g-start-xxl-21{grid-column-start:21}.panel-grid .g-start-xxl-22{grid-column-start:22}.panel-grid .g-start-xxl-23{grid-column-start:23}}main{margin-top:1em;margin-bottom:1em}h1,.h1,h2,.h2{opacity:.9;margin-top:2rem;margin-bottom:1rem;font-weight:600}h1.title,.title.h1{margin-top:0}h2,.h2{border-bottom:1px solid #434343;padding-bottom:.5rem}h3,.h3{font-weight:600}h3,.h3,h4,.h4{opacity:.9;margin-top:1.5rem}h5,.h5,h6,.h6{opacity:.9}.header-section-number{color:#bfbfbf}.nav-link.active .header-section-number{color:inherit}mark,.mark{padding:0em}.panel-caption,caption,.figure-caption{font-size:.9rem}.panel-caption,.figure-caption,figcaption{color:#bfbfbf}.table-caption,caption{color:#fff}.quarto-layout-cell[data-ref-parent] caption{color:#bfbfbf}.column-margin figcaption,.margin-caption,div.aside,aside,.column-margin{color:#bfbfbf;font-size:.825rem}.panel-caption.margin-caption{text-align:inherit}.column-margin.column-container p{margin-bottom:0}.column-margin.column-container>*:not(.collapse){padding-top:.5em;padding-bottom:.5em;display:block}.column-margin.column-container>*.collapse:not(.show){display:none}@media(min-width: 768px){.column-margin.column-container .callout-margin-content:first-child{margin-top:4.5em}.column-margin.column-container .callout-margin-content-simple:first-child{margin-top:3.5em}}.margin-caption>*{padding-top:.5em;padding-bottom:.5em}@media(max-width: 767.98px){.quarto-layout-row{flex-direction:column}}.nav-tabs .nav-item{margin-top:1px;cursor:pointer}.tab-content{margin-top:0px;border-left:#434343 1px solid;border-right:#434343 1px solid;border-bottom:#434343 1px solid;margin-left:0;padding:1em;margin-bottom:1em}@media(max-width: 767.98px){.layout-sidebar{margin-left:0;margin-right:0}}.panel-sidebar,.panel-sidebar .form-control,.panel-input,.panel-input .form-control,.selectize-dropdown{font-size:.9rem}.panel-sidebar .form-control,.panel-input .form-control{padding-top:.1rem}.tab-pane div.sourceCode{margin-top:0px}.tab-pane>p{padding-top:1em}.tab-content>.tab-pane:not(.active){display:none !important}div.sourceCode{background-color:#000;border:1px solid #000;border-radius:.25rem}pre.sourceCode{background-color:rgba(0,0,0,0)}pre.sourceCode{border:none;font-size:.875em;overflow:visible !important;padding:.4em}.callout pre.sourceCode{padding-left:0}div.sourceCode{overflow-y:hidden}.callout div.sourceCode{margin-left:initial}.blockquote{font-size:inherit;padding-left:1rem;padding-right:1.5rem;color:#bfbfbf}.blockquote h1:first-child,.blockquote .h1:first-child,.blockquote h2:first-child,.blockquote .h2:first-child,.blockquote h3:first-child,.blockquote .h3:first-child,.blockquote h4:first-child,.blockquote .h4:first-child,.blockquote h5:first-child,.blockquote .h5:first-child{margin-top:0}pre{background-color:initial;padding:initial;border:initial}p code:not(.sourceCode),li code:not(.sourceCode),td code:not(.sourceCode){background-color:#000;padding:.2em}nav p code:not(.sourceCode),nav li code:not(.sourceCode),nav td code:not(.sourceCode){background-color:rgba(0,0,0,0);padding:0}td code:not(.sourceCode){white-space:pre-wrap}#quarto-embedded-source-code-modal>.modal-dialog{max-width:1000px;padding-left:1.75rem;padding-right:1.75rem}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body{padding:0}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body div.sourceCode{margin:0;padding:.2rem .2rem;border-radius:0px;border:none}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-header{padding:.7rem}.code-tools-button{font-size:1rem;padding:.15rem .15rem;margin-left:5px;color:#6c757d;background-color:rgba(0,0,0,0);transition:initial;cursor:pointer}.code-tools-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}.code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}.sidebar{will-change:top;transition:top 200ms linear;position:sticky;overflow-y:auto;padding-top:1.2em;max-height:100vh}.sidebar.toc-left,.sidebar.margin-sidebar{top:0px;padding-top:1em}.sidebar.toc-left>*,.sidebar.margin-sidebar>*{padding-top:.5em}.sidebar.quarto-banner-title-block-sidebar>*{padding-top:1.65em}figure .quarto-notebook-link{margin-top:.5em}.quarto-notebook-link{font-size:.75em;color:#6c757d;margin-bottom:1em;text-decoration:none;display:block}.quarto-notebook-link:hover{text-decoration:underline;color:#00bc8c}.quarto-notebook-link::before{display:inline-block;height:.75rem;width:.75rem;margin-bottom:0em;margin-right:.25em;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:.75rem .75rem}.quarto-alternate-notebooks i.bi,.quarto-alternate-formats i.bi{margin-right:.4em}.quarto-notebook .cell-container{display:flex}.quarto-notebook .cell-container .cell{flex-grow:4}.quarto-notebook .cell-container .cell-decorator{padding-top:1.5em;padding-right:1em;text-align:right}.quarto-notebook h2,.quarto-notebook .h2{border-bottom:none}.sidebar .quarto-alternate-formats a,.sidebar .quarto-alternate-notebooks a{text-decoration:none}.sidebar .quarto-alternate-formats a:hover,.sidebar .quarto-alternate-notebooks a:hover{color:#00bc8c}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2,.sidebar nav[role=doc-toc]>h2,.sidebar nav[role=doc-toc]>.h2{font-size:.875rem;font-weight:400;margin-bottom:.5rem;margin-top:.3rem;font-family:inherit;border-bottom:0;padding-bottom:0;padding-top:0px}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2{margin-top:1rem}.sidebar nav[role=doc-toc]>ul a{border-left:1px solid #ebebeb;padding-left:.6rem}.sidebar .quarto-alternate-notebooks h2>ul a,.sidebar .quarto-alternate-notebooks .h2>ul a,.sidebar .quarto-alternate-formats h2>ul a,.sidebar .quarto-alternate-formats .h2>ul a{border-left:none;padding-left:.6rem}.sidebar .quarto-alternate-notebooks ul a:empty,.sidebar .quarto-alternate-formats ul a:empty,.sidebar nav[role=doc-toc]>ul a:empty{display:none}.sidebar .quarto-alternate-notebooks ul,.sidebar .quarto-alternate-formats ul,.sidebar nav[role=doc-toc] ul{padding-left:0;list-style:none;font-size:.875rem;font-weight:300}.sidebar .quarto-alternate-notebooks ul li a,.sidebar .quarto-alternate-formats ul li a,.sidebar nav[role=doc-toc]>ul li a{line-height:1.1rem;padding-bottom:.2rem;padding-top:.2rem;color:inherit}.sidebar nav[role=doc-toc] ul>li>ul>li>a{padding-left:1.2em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>a{padding-left:2.4em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>a{padding-left:3.6em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:4.8em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:6em}.sidebar nav[role=doc-toc] ul>li>a.active,.sidebar nav[role=doc-toc] ul>li>ul>li>a.active{border-left:1px solid #00bc8c;color:#00bc8c !important}.sidebar nav[role=doc-toc] ul>li>a:hover,.sidebar nav[role=doc-toc] ul>li>ul>li>a:hover{color:#00bc8c !important}kbd,.kbd{color:#fff;background-color:#f8f9fa;border:1px solid;border-radius:5px;border-color:#434343}div.hanging-indent{margin-left:1em;text-indent:-1em}.citation a,.footnote-ref{text-decoration:none}.footnotes ol{padding-left:1em}.tippy-content>*{margin-bottom:.7em}.tippy-content>*:last-child{margin-bottom:0}.table a{word-break:break-word}.table>thead{border-top-width:1px;border-top-color:#434343;border-bottom:1px solid #fff}.callout{margin-top:1.25rem;margin-bottom:1.25rem;border-radius:.25rem;overflow-wrap:break-word}.callout .callout-title-container{overflow-wrap:anywhere}.callout.callout-style-simple{padding:.4em .7em;border-left:5px solid;border-right:1px solid #434343;border-top:1px solid #434343;border-bottom:1px solid #434343}.callout.callout-style-default{border-left:5px solid;border-right:1px solid #434343;border-top:1px solid #434343;border-bottom:1px solid #434343}.callout .callout-body-container{flex-grow:1}.callout.callout-style-simple .callout-body{font-size:.9rem;font-weight:400}.callout.callout-style-default .callout-body{font-size:.9rem;font-weight:400}.callout.callout-titled .callout-body{margin-top:.2em}.callout:not(.no-icon).callout-titled.callout-style-simple .callout-body{padding-left:1.6em}.callout.callout-titled>.callout-header{padding-top:.2em;margin-bottom:-0.2em}.callout.callout-style-simple>div.callout-header{border-bottom:none;font-size:.9rem;font-weight:600;opacity:75%}.callout.callout-style-default>div.callout-header{border-bottom:none;font-weight:600;opacity:85%;font-size:.9rem;padding-left:.5em;padding-right:.5em}.callout.callout-style-default div.callout-body{padding-left:.5em;padding-right:.5em}.callout.callout-style-default div.callout-body>:first-child{margin-top:.5em}.callout>div.callout-header[data-bs-toggle=collapse]{cursor:pointer}.callout.callout-style-default .callout-header[aria-expanded=false],.callout.callout-style-default .callout-header[aria-expanded=true]{padding-top:0px;margin-bottom:0px;align-items:center}.callout.callout-titled .callout-body>:last-child:not(.sourceCode),.callout.callout-titled .callout-body>div>:last-child:not(.sourceCode){margin-bottom:.5rem}.callout:not(.callout-titled) .callout-body>:first-child,.callout:not(.callout-titled) .callout-body>div>:first-child{margin-top:.25rem}.callout:not(.callout-titled) .callout-body>:last-child,.callout:not(.callout-titled) .callout-body>div>:last-child{margin-bottom:.2rem}.callout.callout-style-simple .callout-icon::before,.callout.callout-style-simple .callout-toggle::before{height:1rem;width:1rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.callout.callout-style-default .callout-icon::before,.callout.callout-style-default .callout-toggle::before{height:.9rem;width:.9rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:.9rem .9rem}.callout.callout-style-default .callout-toggle::before{margin-top:5px}.callout .callout-btn-toggle .callout-toggle::before{transition:transform .2s linear}.callout .callout-header[aria-expanded=false] .callout-toggle::before{transform:rotate(-90deg)}.callout .callout-header[aria-expanded=true] .callout-toggle::before{transform:none}.callout.callout-style-simple:not(.no-icon) div.callout-icon-container{padding-top:.2em;padding-right:.55em}.callout.callout-style-default:not(.no-icon) div.callout-icon-container{padding-top:.1em;padding-right:.35em}.callout.callout-style-default:not(.no-icon) div.callout-title-container{margin-top:-1px}.callout.callout-style-default.callout-caution:not(.no-icon) div.callout-icon-container{padding-top:.3em;padding-right:.35em}.callout>.callout-body>.callout-icon-container>.no-icon,.callout>.callout-header>.callout-icon-container>.no-icon{display:none}div.callout.callout{border-left-color:#6c757d}div.callout.callout-style-default>.callout-header{background-color:#6c757d}div.callout-note.callout{border-left-color:#375a7f}div.callout-note.callout-style-default>.callout-header{background-color:#111b26}div.callout-note:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-tip.callout{border-left-color:#00bc8c}div.callout-tip.callout-style-default>.callout-header{background-color:#00382a}div.callout-tip:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-warning.callout{border-left-color:#f39c12}div.callout-warning.callout-style-default>.callout-header{background-color:#492f05}div.callout-warning:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-caution.callout{border-left-color:#fd7e14}div.callout-caution.callout-style-default>.callout-header{background-color:#4c2606}div.callout-caution:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-important.callout{border-left-color:#e74c3c}div.callout-important.callout-style-default>.callout-header{background-color:#451712}div.callout-important:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important .callout-toggle::before{background-image:url('data:image/svg+xml,')}.quarto-toggle-container{display:flex;align-items:center}.quarto-reader-toggle .bi::before,.quarto-color-scheme-toggle .bi::before{display:inline-block;height:1rem;width:1rem;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.sidebar-navigation{padding-left:20px}.navbar .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.navbar .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.quarto-sidebar-toggle{border-color:#dee2e6;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem;border-style:solid;border-width:1px;overflow:hidden;border-top-width:0px;padding-top:0px !important}.quarto-sidebar-toggle-title{cursor:pointer;padding-bottom:2px;margin-left:.25em;text-align:center;font-weight:400;font-size:.775em}#quarto-content .quarto-sidebar-toggle{background:#272727}#quarto-content .quarto-sidebar-toggle-title{color:#fff}.quarto-sidebar-toggle-icon{color:#dee2e6;margin-right:.5em;float:right;transition:transform .2s ease}.quarto-sidebar-toggle-icon::before{padding-top:5px}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-icon{transform:rotate(-180deg)}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-title{border-bottom:solid #dee2e6 1px}.quarto-sidebar-toggle-contents{background-color:#222;padding-right:10px;padding-left:10px;margin-top:0px !important;transition:max-height .5s ease}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-contents{padding-top:1em;padding-bottom:10px}.quarto-sidebar-toggle:not(.expanded) .quarto-sidebar-toggle-contents{padding-top:0px !important;padding-bottom:0px}nav[role=doc-toc]{z-index:1020}#quarto-sidebar>*,nav[role=doc-toc]>*{transition:opacity .1s ease,border .1s ease}#quarto-sidebar.slow>*,nav[role=doc-toc].slow>*{transition:opacity .4s ease,border .4s ease}.quarto-color-scheme-toggle:not(.alternate).top-right .bi::before{background-image:url('data:image/svg+xml,')}.quarto-color-scheme-toggle.alternate.top-right .bi::before{background-image:url('data:image/svg+xml,')}#quarto-appendix.default{border-top:1px solid #dee2e6}#quarto-appendix.default{background-color:#222;padding-top:1.5em;margin-top:2em;z-index:998}#quarto-appendix.default .quarto-appendix-heading{margin-top:0;line-height:1.4em;font-weight:600;opacity:.9;border-bottom:none;margin-bottom:0}#quarto-appendix.default .footnotes ol,#quarto-appendix.default .footnotes ol li>p:last-of-type,#quarto-appendix.default .quarto-appendix-contents>p:last-of-type{margin-bottom:0}#quarto-appendix.default .quarto-appendix-secondary-label{margin-bottom:.4em}#quarto-appendix.default .quarto-appendix-bibtex{font-size:.7em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-bibtex code.sourceCode{white-space:pre-wrap}#quarto-appendix.default .quarto-appendix-citeas{font-size:.9em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-heading{font-size:1em !important}#quarto-appendix.default *[role=doc-endnotes]>ol,#quarto-appendix.default .quarto-appendix-contents>*:not(h2):not(.h2){font-size:.9em}#quarto-appendix.default section{padding-bottom:1.5em}#quarto-appendix.default section *[role=doc-endnotes],#quarto-appendix.default section>*:not(a){opacity:.9;word-wrap:break-word}.btn.btn-quarto,div.cell-output-display .btn-quarto{color:#d9d9d9;background-color:#434343;border-color:#434343}.btn.btn-quarto:hover,div.cell-output-display .btn-quarto:hover{color:#d9d9d9;background-color:#5f5f5f;border-color:#565656}.btn-check:focus+.btn.btn-quarto,.btn.btn-quarto:focus,.btn-check:focus+div.cell-output-display .btn-quarto,div.cell-output-display .btn-quarto:focus{color:#d9d9d9;background-color:#5f5f5f;border-color:#565656;box-shadow:0 0 0 .25rem rgba(90,90,90,.5)}.btn-check:checked+.btn.btn-quarto,.btn-check:active+.btn.btn-quarto,.btn.btn-quarto:active,.btn.btn-quarto.active,.show>.btn.btn-quarto.dropdown-toggle,.btn-check:checked+div.cell-output-display .btn-quarto,.btn-check:active+div.cell-output-display .btn-quarto,div.cell-output-display .btn-quarto:active,div.cell-output-display .btn-quarto.active,.show>div.cell-output-display .btn-quarto.dropdown-toggle{color:#fff;background-color:dimgray;border-color:#565656}.btn-check:checked+.btn.btn-quarto:focus,.btn-check:active+.btn.btn-quarto:focus,.btn.btn-quarto:active:focus,.btn.btn-quarto.active:focus,.show>.btn.btn-quarto.dropdown-toggle:focus,.btn-check:checked+div.cell-output-display .btn-quarto:focus,.btn-check:active+div.cell-output-display .btn-quarto:focus,div.cell-output-display .btn-quarto:active:focus,div.cell-output-display .btn-quarto.active:focus,.show>div.cell-output-display .btn-quarto.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(90,90,90,.5)}.btn.btn-quarto:disabled,.btn.btn-quarto.disabled,div.cell-output-display .btn-quarto:disabled,div.cell-output-display .btn-quarto.disabled{color:#fff;background-color:#434343;border-color:#434343}nav.quarto-secondary-nav.color-navbar{background-color:#375a7f;color:#dee2e6}nav.quarto-secondary-nav.color-navbar h1,nav.quarto-secondary-nav.color-navbar .h1,nav.quarto-secondary-nav.color-navbar .quarto-btn-toggle{color:#dee2e6}@media(max-width: 991.98px){body.nav-sidebar .quarto-title-banner{margin-bottom:0;padding-bottom:0}body.nav-sidebar #title-block-header{margin-block-end:0}}p.subtitle{margin-top:.25em;margin-bottom:.5em}code a:any-link{color:inherit;text-decoration-color:#6c757d}/*! dark */div.observablehq table thead tr th{background-color:var(--bs-body-bg)}input,button,select,optgroup,textarea{background-color:var(--bs-body-bg)}.code-annotated .code-copy-button{margin-right:1.25em;margin-top:0;padding-bottom:0;padding-top:3px}.code-annotation-gutter-bg{background-color:#222}.code-annotation-gutter{background-color:#000}.code-annotation-gutter,.code-annotation-gutter-bg{height:100%;width:calc(20px + .5em);position:absolute;top:0;right:0}dl.code-annotation-container-grid dt{margin-right:1em;margin-top:.25rem}dl.code-annotation-container-grid dt{font-family:var(--bs-font-monospace);color:#e6e6e6;border:solid #e6e6e6 1px;border-radius:50%;height:22px;width:22px;line-height:22px;font-size:11px;text-align:center;vertical-align:middle;text-decoration:none}dl.code-annotation-container-grid dt[data-target-cell]{cursor:pointer}dl.code-annotation-container-grid dt[data-target-cell].code-annotation-active{color:#222;border:solid #aaa 1px;background-color:#aaa}pre.code-annotation-code{padding-top:0;padding-bottom:0}pre.code-annotation-code code{z-index:3}#code-annotation-line-highlight-gutter{width:100%;border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}#code-annotation-line-highlight{margin-left:-4em;width:calc(100% + 4em);border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}code.sourceCode .code-annotation-anchor.code-annotation-active{background-color:var(--quarto-hl-normal-color, #aaaaaa);border:solid var(--quarto-hl-normal-color, #aaaaaa) 1px;color:#000;font-weight:bolder}code.sourceCode .code-annotation-anchor{font-family:var(--bs-font-monospace);color:var(--quarto-hl-co-color);border:solid var(--quarto-hl-co-color) 1px;border-radius:50%;height:18px;width:18px;font-size:9px;margin-top:2px}code.sourceCode button.code-annotation-anchor{padding:2px}code.sourceCode a.code-annotation-anchor{line-height:18px;text-align:center;vertical-align:middle;cursor:default;text-decoration:none}@media print{.page-columns .column-screen-inset{grid-column:page-start-inset/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset table{background:#222}.page-columns .column-screen-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-left table{background:#222}.page-columns .column-screen-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-right table{background:#222}.page-columns .column-screen{grid-column:page-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen table{background:#222}.page-columns .column-screen-left{grid-column:page-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-left table{background:#222}.page-columns .column-screen-right{grid-column:body-content-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-right table{background:#222}.page-columns .column-screen-inset-shaded{grid-column:page-start-inset/page-end-inset;padding:1em;background:#6f6f6f;z-index:998;transform:translate3d(0, 0, 0);margin-bottom:1em}}.quarto-video{margin-bottom:1em}.table>thead{border-top-width:0}.table>:not(caption)>*:not(:last-child)>*{border-bottom-color:#fff;border-bottom-style:solid;border-bottom-width:1px}.table>:not(:first-child){border-top:1px solid #fff;border-bottom:1px solid inherit}.table tbody{border-bottom-color:#fff}a.external:after{display:inline-block;height:.75rem;width:.75rem;margin-bottom:.15em;margin-left:.25em;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:.75rem .75rem}div.sourceCode code a.external:after{content:none}a.external:after:hover{cursor:pointer}.quarto-ext-icon{display:inline-block;font-size:.75em;padding-left:.3em}.code-with-filename .code-with-filename-file{margin-bottom:0;padding-bottom:2px;padding-top:2px;padding-left:.7em;border:var(--quarto-border-width) solid var(--quarto-border-color);border-radius:var(--quarto-border-radius);border-bottom:0;border-bottom-left-radius:0%;border-bottom-right-radius:0%}.code-with-filename div.sourceCode,.reveal .code-with-filename div.sourceCode{margin-top:0;border-top-left-radius:0%;border-top-right-radius:0%}.code-with-filename .code-with-filename-file pre{margin-bottom:0}.code-with-filename .code-with-filename-file,.code-with-filename .code-with-filename-file pre{background-color:rgba(219,219,219,.8)}.quarto-dark .code-with-filename .code-with-filename-file,.quarto-dark .code-with-filename .code-with-filename-file pre{background-color:#555}.code-with-filename .code-with-filename-file strong{font-weight:400}.blockquote-footer{color:#595959}.input-group-addon{color:#fff}.form-floating>label{color:#444}.nav-tabs .nav-link,.nav-tabs .nav-link.active,.nav-tabs .nav-link.active:focus,.nav-tabs .nav-link.active:hover,.nav-tabs .nav-item.open .nav-link,.nav-tabs .nav-item.open .nav-link:focus,.nav-tabs .nav-item.open .nav-link:hover,.nav-pills .nav-link,.nav-pills .nav-link.active,.nav-pills .nav-link.active:focus,.nav-pills .nav-link.active:hover,.nav-pills .nav-item.open .nav-link,.nav-pills .nav-item.open .nav-link:focus,.nav-pills .nav-item.open .nav-link:hover{color:#fff}.breadcrumb a{color:#fff}.pagination a:hover{text-decoration:none}.alert{border:none;color:#fff}.alert a,.alert .alert-link{color:#fff;text-decoration:underline}.alert-default{background-color:#434343}.alert-primary{background-color:#375a7f}.alert-secondary{background-color:#434343}.alert-success{background-color:#00bc8c}.alert-info{background-color:#3498db}.alert-warning{background-color:#f39c12}.alert-danger{background-color:#e74c3c}.alert-light{background-color:#6f6f6f}.alert-dark{background-color:#2d2d2d}.quarto-title-banner{margin-bottom:1em;color:#dee2e6;background:#375a7f}.quarto-title-banner .code-tools-button{color:#a4afba}.quarto-title-banner .code-tools-button:hover{color:#dee2e6}.quarto-title-banner .code-tools-button>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .quarto-title .title{font-weight:600}.quarto-title-banner .quarto-categories{margin-top:.75em}@media(min-width: 992px){.quarto-title-banner{padding-top:2.5em;padding-bottom:2.5em}}@media(max-width: 991.98px){.quarto-title-banner{padding-top:1em;padding-bottom:1em}}main.quarto-banner-title-block>section:first-child>h2,main.quarto-banner-title-block>section:first-child>.h2,main.quarto-banner-title-block>section:first-child>h3,main.quarto-banner-title-block>section:first-child>.h3,main.quarto-banner-title-block>section:first-child>h4,main.quarto-banner-title-block>section:first-child>.h4{margin-top:0}.quarto-title .quarto-categories{display:flex;flex-wrap:wrap;row-gap:.5em;column-gap:.4em;padding-bottom:.5em;margin-top:.75em}.quarto-title .quarto-categories .quarto-category{padding:.25em .75em;font-size:.65em;text-transform:uppercase;border:solid 1px;border-radius:.25rem;opacity:.6}.quarto-title .quarto-categories .quarto-category a{color:inherit}#title-block-header.quarto-title-block.default .quarto-title-meta{display:grid;grid-template-columns:repeat(2, 1fr)}#title-block-header.quarto-title-block.default .quarto-title .title{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-author-orcid img{margin-top:-5px}#title-block-header.quarto-title-block.default .quarto-description p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p,#title-block-header.quarto-title-block.default .quarto-title-authors p,#title-block-header.quarto-title-block.default .quarto-title-affiliations p{margin-bottom:.1em}#title-block-header.quarto-title-block.default .quarto-title-meta-heading{text-transform:uppercase;margin-top:1em;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-contents{font-size:.9em}#title-block-header.quarto-title-block.default .quarto-title-meta-contents a{color:#fff}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p.affiliation:last-of-type{margin-bottom:.7em}#title-block-header.quarto-title-block.default p.affiliation{margin-bottom:.1em}#title-block-header.quarto-title-block.default .description,#title-block-header.quarto-title-block.default .abstract{margin-top:0}#title-block-header.quarto-title-block.default .description>p,#title-block-header.quarto-title-block.default .abstract>p{font-size:.9em}#title-block-header.quarto-title-block.default .description>p:last-of-type,#title-block-header.quarto-title-block.default .abstract>p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .description .abstract-title,#title-block-header.quarto-title-block.default .abstract .abstract-title{margin-top:1em;text-transform:uppercase;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-author{display:grid;grid-template-columns:1fr 1fr}.quarto-title-tools-only{display:flex;justify-content:right}/*# sourceMappingURL=4bfef878f23bf82584b07c8278ef38b6.css.map */ diff --git a/site_libs/bootstrap/bootstrap.min.css b/site_libs/bootstrap/bootstrap.min.css index f5da7b1..c92686d 100644 --- a/site_libs/bootstrap/bootstrap.min.css +++ b/site_libs/bootstrap/bootstrap.min.css @@ -7,4 +7,4 @@ * * ansi colors from IPython notebook's * -*/.ansi-black-fg{color:#3e424d}.ansi-black-bg{background-color:#3e424d}.ansi-black-intense-fg{color:#282c36}.ansi-black-intense-bg{background-color:#282c36}.ansi-red-fg{color:#e75c58}.ansi-red-bg{background-color:#e75c58}.ansi-red-intense-fg{color:#b22b31}.ansi-red-intense-bg{background-color:#b22b31}.ansi-green-fg{color:#00a250}.ansi-green-bg{background-color:#00a250}.ansi-green-intense-fg{color:#007427}.ansi-green-intense-bg{background-color:#007427}.ansi-yellow-fg{color:#ddb62b}.ansi-yellow-bg{background-color:#ddb62b}.ansi-yellow-intense-fg{color:#b27d12}.ansi-yellow-intense-bg{background-color:#b27d12}.ansi-blue-fg{color:#208ffb}.ansi-blue-bg{background-color:#208ffb}.ansi-blue-intense-fg{color:#0065ca}.ansi-blue-intense-bg{background-color:#0065ca}.ansi-magenta-fg{color:#d160c4}.ansi-magenta-bg{background-color:#d160c4}.ansi-magenta-intense-fg{color:#a03196}.ansi-magenta-intense-bg{background-color:#a03196}.ansi-cyan-fg{color:#60c6c8}.ansi-cyan-bg{background-color:#60c6c8}.ansi-cyan-intense-fg{color:#258f8f}.ansi-cyan-intense-bg{background-color:#258f8f}.ansi-white-fg{color:#c5c1b4}.ansi-white-bg{background-color:#c5c1b4}.ansi-white-intense-fg{color:#a1a6b2}.ansi-white-intense-bg{background-color:#a1a6b2}.ansi-default-inverse-fg{color:#fff}.ansi-default-inverse-bg{background-color:#000}.ansi-bold{font-weight:bold}.ansi-underline{text-decoration:underline}:root{--quarto-body-bg: #fff;--quarto-body-color: #3e3f3a;--quarto-text-muted: #6c757d;--quarto-border-color: #dee2e6;--quarto-border-width: 1px;--quarto-border-radius: 0.25rem}table.gt_table{color:var(--quarto-body-color);font-size:1em;width:100%;background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_column_spanner_outer{color:var(--quarto-body-color);background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_col_heading{color:var(--quarto-body-color);font-weight:bold;background-color:rgba(0,0,0,0)}table.gt_table thead.gt_col_headings{border-bottom:1px solid currentColor;border-top-width:inherit;border-top-color:var(--quarto-border-color)}table.gt_table thead.gt_col_headings:not(:first-child){border-top-width:1px;border-top-color:var(--quarto-border-color)}table.gt_table td.gt_row{border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-width:0px}table.gt_table tbody.gt_table_body{border-top-width:1px;border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-color:currentColor}div.columns{display:initial;gap:initial}div.column{display:inline-block;overflow-x:initial;vertical-align:top;width:50%}.code-annotation-tip-content{word-wrap:break-word}.code-annotation-container-hidden{display:none !important}dl.code-annotation-container-grid{display:grid;grid-template-columns:min-content auto}dl.code-annotation-container-grid dt{grid-column:1}dl.code-annotation-container-grid dd{grid-column:2}pre.sourceCode.code-annotation-code{padding-right:0}code.sourceCode .code-annotation-anchor{z-index:100;position:absolute;right:.5em;left:inherit;background-color:rgba(0,0,0,0)}:root{--mermaid-bg-color: #fff;--mermaid-edge-color: #6c757d;--mermaid-node-fg-color: #3e3f3a;--mermaid-fg-color: #3e3f3a;--mermaid-fg-color--lighter: #585a52;--mermaid-fg-color--lightest: #72746b;--mermaid-font-family: Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;--mermaid-label-bg-color: #fff;--mermaid-label-fg-color: #325d88;--mermaid-node-bg-color: rgba(50, 93, 136, 0.1);--mermaid-node-fg-color: #3e3f3a}@media print{:root{font-size:11pt}#quarto-sidebar,#TOC,.nav-page{display:none}.page-columns .content{grid-column-start:page-start}.fixed-top{position:relative}.panel-caption,.figure-caption,figcaption{color:#666}}.code-copy-button{position:absolute;top:0;right:0;border:0;margin-top:5px;margin-right:5px;background-color:rgba(0,0,0,0);z-index:3}.code-copy-button:focus{outline:none}.code-copy-button-tooltip{font-size:.75em}pre.sourceCode:hover>.code-copy-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}pre.sourceCode:hover>.code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button-checked:hover>.bi::before{background-image:url('data:image/svg+xml,')}main ol ol,main ul ul,main ol ul,main ul ol{margin-bottom:1em}ul>li:not(:has(>p))>ul,ol>li:not(:has(>p))>ul,ul>li:not(:has(>p))>ol,ol>li:not(:has(>p))>ol{margin-bottom:0}ul>li:not(:has(>p))>ul>li:has(>p),ol>li:not(:has(>p))>ul>li:has(>p),ul>li:not(:has(>p))>ol>li:has(>p),ol>li:not(:has(>p))>ol>li:has(>p){margin-top:1rem}body{margin:0}main.page-columns>header>h1.title,main.page-columns>header>.title.h1{margin-bottom:0}@media(min-width: 992px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] 35px [page-end-inset page-end] 5fr [screen-end-inset] 1.5em}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 3em [body-end] 50px [body-end-outset] minmax(0px, 250px) [page-end-inset] minmax(50px, 100px) [page-end] 1fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 100px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 150px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 991.98px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 1250px - 3em )) [body-content-end body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1.5em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 767.98px){body .page-columns,body.fullcontent:not(.floating):not(.docked) .page-columns,body.slimcontent:not(.floating):not(.docked) .page-columns,body.docked .page-columns,body.docked.slimcontent .page-columns,body.docked.fullcontent .page-columns,body.floating .page-columns,body.floating.slimcontent .page-columns,body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}nav[role=doc-toc]{display:none}}body,.page-row-navigation{grid-template-rows:[page-top] max-content [contents-top] max-content [contents-bottom] max-content [page-bottom]}.page-rows-contents{grid-template-rows:[content-top] minmax(max-content, 1fr) [content-bottom] minmax(60px, max-content) [page-bottom]}.page-full{grid-column:screen-start/screen-end !important}.page-columns>*{grid-column:body-content-start/body-content-end}.page-columns.column-page>*{grid-column:page-start/page-end}.page-columns.column-page-left>*{grid-column:page-start/body-content-end}.page-columns.column-page-right>*{grid-column:body-content-start/page-end}.page-rows{grid-auto-rows:auto}.header{grid-column:screen-start/screen-end;grid-row:page-top/contents-top}#quarto-content{padding:0;grid-column:screen-start/screen-end;grid-row:contents-top/contents-bottom}body.floating .sidebar.sidebar-navigation{grid-column:page-start/body-start;grid-row:content-top/page-bottom}body.docked .sidebar.sidebar-navigation{grid-column:screen-start/body-start;grid-row:content-top/page-bottom}.sidebar.toc-left{grid-column:page-start/body-start;grid-row:content-top/page-bottom}.sidebar.margin-sidebar{grid-column:body-end/page-end;grid-row:content-top/page-bottom}.page-columns .content{grid-column:body-content-start/body-content-end;grid-row:content-top/content-bottom;align-content:flex-start}.page-columns .page-navigation{grid-column:body-content-start/body-content-end;grid-row:content-bottom/page-bottom}.page-columns .footer{grid-column:screen-start/screen-end;grid-row:contents-bottom/page-bottom}.page-columns .column-body{grid-column:body-content-start/body-content-end}.page-columns .column-body-fullbleed{grid-column:body-start/body-end}.page-columns .column-body-outset{grid-column:body-start-outset/body-end-outset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset table{background:#fff}.page-columns .column-body-outset-left{grid-column:body-start-outset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset-left table{background:#fff}.page-columns .column-body-outset-right{grid-column:body-content-start/body-end-outset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset-right table{background:#fff}.page-columns .column-page{grid-column:page-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page table{background:#fff}.page-columns .column-page-inset{grid-column:page-start-inset/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset table{background:#fff}.page-columns .column-page-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset-left table{background:#fff}.page-columns .column-page-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset-right figcaption table{background:#fff}.page-columns .column-page-left{grid-column:page-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-left table{background:#fff}.page-columns .column-page-right{grid-column:body-content-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-right figcaption table{background:#fff}#quarto-content.page-columns #quarto-margin-sidebar,#quarto-content.page-columns #quarto-sidebar{z-index:1}@media(max-width: 991.98px){#quarto-content.page-columns #quarto-margin-sidebar.collapse,#quarto-content.page-columns #quarto-sidebar.collapse,#quarto-content.page-columns #quarto-margin-sidebar.collapsing,#quarto-content.page-columns #quarto-sidebar.collapsing{z-index:1055}}#quarto-content.page-columns main.column-page,#quarto-content.page-columns main.column-page-right,#quarto-content.page-columns main.column-page-left{z-index:0}.page-columns .column-screen-inset{grid-column:screen-start-inset/screen-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset table{background:#fff}.page-columns .column-screen-inset-left{grid-column:screen-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-left table{background:#fff}.page-columns .column-screen-inset-right{grid-column:body-content-start/screen-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-right table{background:#fff}.page-columns .column-screen{grid-column:screen-start/screen-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen table{background:#fff}.page-columns .column-screen-left{grid-column:screen-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-left table{background:#fff}.page-columns .column-screen-right{grid-column:body-content-start/screen-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-right table{background:#fff}.page-columns .column-screen-inset-shaded{grid-column:screen-start/screen-end;padding:1em;background:#f8f5f0;z-index:998;transform:translate3d(0, 0, 0);margin-bottom:1em}.zindex-content{z-index:998;transform:translate3d(0, 0, 0)}.zindex-modal{z-index:1055;transform:translate3d(0, 0, 0)}.zindex-over-content{z-index:999;transform:translate3d(0, 0, 0)}img.img-fluid.column-screen,img.img-fluid.column-screen-inset-shaded,img.img-fluid.column-screen-inset,img.img-fluid.column-screen-inset-left,img.img-fluid.column-screen-inset-right,img.img-fluid.column-screen-left,img.img-fluid.column-screen-right{width:100%}@media(min-width: 992px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-end/page-end !important;z-index:998}.column-sidebar{grid-column:page-start/body-start !important;z-index:998}.column-leftmargin{grid-column:screen-start-inset/body-start !important;z-index:998}.no-row-height{height:1em;overflow:visible}}@media(max-width: 991.98px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-end/page-end !important;z-index:998}.no-row-height{height:1em;overflow:visible}.page-columns.page-full{overflow:visible}.page-columns.toc-left .margin-caption,.page-columns.toc-left div.aside,.page-columns.toc-left aside,.page-columns.toc-left .column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;transform:translate3d(0, 0, 0)}.page-columns.toc-left .no-row-height{height:initial;overflow:initial}}@media(max-width: 767.98px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;transform:translate3d(0, 0, 0)}.no-row-height{height:initial;overflow:initial}#quarto-margin-sidebar{display:none}#quarto-sidebar-toc-left{display:none}.hidden-sm{display:none}}.panel-grid{display:grid;grid-template-rows:repeat(1, 1fr);grid-template-columns:repeat(24, 1fr);gap:1em}.panel-grid .g-col-1{grid-column:auto/span 1}.panel-grid .g-col-2{grid-column:auto/span 2}.panel-grid .g-col-3{grid-column:auto/span 3}.panel-grid .g-col-4{grid-column:auto/span 4}.panel-grid .g-col-5{grid-column:auto/span 5}.panel-grid .g-col-6{grid-column:auto/span 6}.panel-grid .g-col-7{grid-column:auto/span 7}.panel-grid .g-col-8{grid-column:auto/span 8}.panel-grid .g-col-9{grid-column:auto/span 9}.panel-grid .g-col-10{grid-column:auto/span 10}.panel-grid .g-col-11{grid-column:auto/span 11}.panel-grid .g-col-12{grid-column:auto/span 12}.panel-grid .g-col-13{grid-column:auto/span 13}.panel-grid .g-col-14{grid-column:auto/span 14}.panel-grid .g-col-15{grid-column:auto/span 15}.panel-grid .g-col-16{grid-column:auto/span 16}.panel-grid .g-col-17{grid-column:auto/span 17}.panel-grid .g-col-18{grid-column:auto/span 18}.panel-grid .g-col-19{grid-column:auto/span 19}.panel-grid .g-col-20{grid-column:auto/span 20}.panel-grid .g-col-21{grid-column:auto/span 21}.panel-grid .g-col-22{grid-column:auto/span 22}.panel-grid .g-col-23{grid-column:auto/span 23}.panel-grid .g-col-24{grid-column:auto/span 24}.panel-grid .g-start-1{grid-column-start:1}.panel-grid .g-start-2{grid-column-start:2}.panel-grid .g-start-3{grid-column-start:3}.panel-grid .g-start-4{grid-column-start:4}.panel-grid .g-start-5{grid-column-start:5}.panel-grid .g-start-6{grid-column-start:6}.panel-grid .g-start-7{grid-column-start:7}.panel-grid .g-start-8{grid-column-start:8}.panel-grid .g-start-9{grid-column-start:9}.panel-grid .g-start-10{grid-column-start:10}.panel-grid .g-start-11{grid-column-start:11}.panel-grid .g-start-12{grid-column-start:12}.panel-grid .g-start-13{grid-column-start:13}.panel-grid .g-start-14{grid-column-start:14}.panel-grid .g-start-15{grid-column-start:15}.panel-grid .g-start-16{grid-column-start:16}.panel-grid .g-start-17{grid-column-start:17}.panel-grid .g-start-18{grid-column-start:18}.panel-grid .g-start-19{grid-column-start:19}.panel-grid .g-start-20{grid-column-start:20}.panel-grid .g-start-21{grid-column-start:21}.panel-grid .g-start-22{grid-column-start:22}.panel-grid .g-start-23{grid-column-start:23}@media(min-width: 576px){.panel-grid .g-col-sm-1{grid-column:auto/span 1}.panel-grid .g-col-sm-2{grid-column:auto/span 2}.panel-grid .g-col-sm-3{grid-column:auto/span 3}.panel-grid .g-col-sm-4{grid-column:auto/span 4}.panel-grid .g-col-sm-5{grid-column:auto/span 5}.panel-grid .g-col-sm-6{grid-column:auto/span 6}.panel-grid .g-col-sm-7{grid-column:auto/span 7}.panel-grid .g-col-sm-8{grid-column:auto/span 8}.panel-grid .g-col-sm-9{grid-column:auto/span 9}.panel-grid .g-col-sm-10{grid-column:auto/span 10}.panel-grid .g-col-sm-11{grid-column:auto/span 11}.panel-grid .g-col-sm-12{grid-column:auto/span 12}.panel-grid .g-col-sm-13{grid-column:auto/span 13}.panel-grid .g-col-sm-14{grid-column:auto/span 14}.panel-grid .g-col-sm-15{grid-column:auto/span 15}.panel-grid .g-col-sm-16{grid-column:auto/span 16}.panel-grid .g-col-sm-17{grid-column:auto/span 17}.panel-grid .g-col-sm-18{grid-column:auto/span 18}.panel-grid .g-col-sm-19{grid-column:auto/span 19}.panel-grid .g-col-sm-20{grid-column:auto/span 20}.panel-grid .g-col-sm-21{grid-column:auto/span 21}.panel-grid .g-col-sm-22{grid-column:auto/span 22}.panel-grid .g-col-sm-23{grid-column:auto/span 23}.panel-grid .g-col-sm-24{grid-column:auto/span 24}.panel-grid .g-start-sm-1{grid-column-start:1}.panel-grid .g-start-sm-2{grid-column-start:2}.panel-grid .g-start-sm-3{grid-column-start:3}.panel-grid .g-start-sm-4{grid-column-start:4}.panel-grid .g-start-sm-5{grid-column-start:5}.panel-grid .g-start-sm-6{grid-column-start:6}.panel-grid .g-start-sm-7{grid-column-start:7}.panel-grid .g-start-sm-8{grid-column-start:8}.panel-grid .g-start-sm-9{grid-column-start:9}.panel-grid .g-start-sm-10{grid-column-start:10}.panel-grid .g-start-sm-11{grid-column-start:11}.panel-grid .g-start-sm-12{grid-column-start:12}.panel-grid .g-start-sm-13{grid-column-start:13}.panel-grid .g-start-sm-14{grid-column-start:14}.panel-grid .g-start-sm-15{grid-column-start:15}.panel-grid .g-start-sm-16{grid-column-start:16}.panel-grid .g-start-sm-17{grid-column-start:17}.panel-grid .g-start-sm-18{grid-column-start:18}.panel-grid .g-start-sm-19{grid-column-start:19}.panel-grid .g-start-sm-20{grid-column-start:20}.panel-grid .g-start-sm-21{grid-column-start:21}.panel-grid .g-start-sm-22{grid-column-start:22}.panel-grid .g-start-sm-23{grid-column-start:23}}@media(min-width: 768px){.panel-grid .g-col-md-1{grid-column:auto/span 1}.panel-grid .g-col-md-2{grid-column:auto/span 2}.panel-grid .g-col-md-3{grid-column:auto/span 3}.panel-grid .g-col-md-4{grid-column:auto/span 4}.panel-grid .g-col-md-5{grid-column:auto/span 5}.panel-grid .g-col-md-6{grid-column:auto/span 6}.panel-grid .g-col-md-7{grid-column:auto/span 7}.panel-grid .g-col-md-8{grid-column:auto/span 8}.panel-grid .g-col-md-9{grid-column:auto/span 9}.panel-grid .g-col-md-10{grid-column:auto/span 10}.panel-grid .g-col-md-11{grid-column:auto/span 11}.panel-grid .g-col-md-12{grid-column:auto/span 12}.panel-grid .g-col-md-13{grid-column:auto/span 13}.panel-grid .g-col-md-14{grid-column:auto/span 14}.panel-grid .g-col-md-15{grid-column:auto/span 15}.panel-grid .g-col-md-16{grid-column:auto/span 16}.panel-grid .g-col-md-17{grid-column:auto/span 17}.panel-grid .g-col-md-18{grid-column:auto/span 18}.panel-grid .g-col-md-19{grid-column:auto/span 19}.panel-grid .g-col-md-20{grid-column:auto/span 20}.panel-grid .g-col-md-21{grid-column:auto/span 21}.panel-grid .g-col-md-22{grid-column:auto/span 22}.panel-grid .g-col-md-23{grid-column:auto/span 23}.panel-grid .g-col-md-24{grid-column:auto/span 24}.panel-grid .g-start-md-1{grid-column-start:1}.panel-grid .g-start-md-2{grid-column-start:2}.panel-grid .g-start-md-3{grid-column-start:3}.panel-grid .g-start-md-4{grid-column-start:4}.panel-grid .g-start-md-5{grid-column-start:5}.panel-grid .g-start-md-6{grid-column-start:6}.panel-grid .g-start-md-7{grid-column-start:7}.panel-grid .g-start-md-8{grid-column-start:8}.panel-grid .g-start-md-9{grid-column-start:9}.panel-grid .g-start-md-10{grid-column-start:10}.panel-grid .g-start-md-11{grid-column-start:11}.panel-grid .g-start-md-12{grid-column-start:12}.panel-grid .g-start-md-13{grid-column-start:13}.panel-grid .g-start-md-14{grid-column-start:14}.panel-grid .g-start-md-15{grid-column-start:15}.panel-grid .g-start-md-16{grid-column-start:16}.panel-grid .g-start-md-17{grid-column-start:17}.panel-grid .g-start-md-18{grid-column-start:18}.panel-grid .g-start-md-19{grid-column-start:19}.panel-grid .g-start-md-20{grid-column-start:20}.panel-grid .g-start-md-21{grid-column-start:21}.panel-grid .g-start-md-22{grid-column-start:22}.panel-grid .g-start-md-23{grid-column-start:23}}@media(min-width: 992px){.panel-grid .g-col-lg-1{grid-column:auto/span 1}.panel-grid .g-col-lg-2{grid-column:auto/span 2}.panel-grid .g-col-lg-3{grid-column:auto/span 3}.panel-grid .g-col-lg-4{grid-column:auto/span 4}.panel-grid .g-col-lg-5{grid-column:auto/span 5}.panel-grid .g-col-lg-6{grid-column:auto/span 6}.panel-grid .g-col-lg-7{grid-column:auto/span 7}.panel-grid .g-col-lg-8{grid-column:auto/span 8}.panel-grid .g-col-lg-9{grid-column:auto/span 9}.panel-grid .g-col-lg-10{grid-column:auto/span 10}.panel-grid .g-col-lg-11{grid-column:auto/span 11}.panel-grid .g-col-lg-12{grid-column:auto/span 12}.panel-grid .g-col-lg-13{grid-column:auto/span 13}.panel-grid .g-col-lg-14{grid-column:auto/span 14}.panel-grid .g-col-lg-15{grid-column:auto/span 15}.panel-grid .g-col-lg-16{grid-column:auto/span 16}.panel-grid .g-col-lg-17{grid-column:auto/span 17}.panel-grid .g-col-lg-18{grid-column:auto/span 18}.panel-grid .g-col-lg-19{grid-column:auto/span 19}.panel-grid .g-col-lg-20{grid-column:auto/span 20}.panel-grid .g-col-lg-21{grid-column:auto/span 21}.panel-grid .g-col-lg-22{grid-column:auto/span 22}.panel-grid .g-col-lg-23{grid-column:auto/span 23}.panel-grid .g-col-lg-24{grid-column:auto/span 24}.panel-grid .g-start-lg-1{grid-column-start:1}.panel-grid .g-start-lg-2{grid-column-start:2}.panel-grid .g-start-lg-3{grid-column-start:3}.panel-grid .g-start-lg-4{grid-column-start:4}.panel-grid .g-start-lg-5{grid-column-start:5}.panel-grid .g-start-lg-6{grid-column-start:6}.panel-grid .g-start-lg-7{grid-column-start:7}.panel-grid .g-start-lg-8{grid-column-start:8}.panel-grid .g-start-lg-9{grid-column-start:9}.panel-grid .g-start-lg-10{grid-column-start:10}.panel-grid .g-start-lg-11{grid-column-start:11}.panel-grid .g-start-lg-12{grid-column-start:12}.panel-grid .g-start-lg-13{grid-column-start:13}.panel-grid .g-start-lg-14{grid-column-start:14}.panel-grid .g-start-lg-15{grid-column-start:15}.panel-grid .g-start-lg-16{grid-column-start:16}.panel-grid .g-start-lg-17{grid-column-start:17}.panel-grid .g-start-lg-18{grid-column-start:18}.panel-grid .g-start-lg-19{grid-column-start:19}.panel-grid .g-start-lg-20{grid-column-start:20}.panel-grid .g-start-lg-21{grid-column-start:21}.panel-grid .g-start-lg-22{grid-column-start:22}.panel-grid .g-start-lg-23{grid-column-start:23}}@media(min-width: 1200px){.panel-grid .g-col-xl-1{grid-column:auto/span 1}.panel-grid .g-col-xl-2{grid-column:auto/span 2}.panel-grid .g-col-xl-3{grid-column:auto/span 3}.panel-grid .g-col-xl-4{grid-column:auto/span 4}.panel-grid .g-col-xl-5{grid-column:auto/span 5}.panel-grid .g-col-xl-6{grid-column:auto/span 6}.panel-grid .g-col-xl-7{grid-column:auto/span 7}.panel-grid .g-col-xl-8{grid-column:auto/span 8}.panel-grid .g-col-xl-9{grid-column:auto/span 9}.panel-grid .g-col-xl-10{grid-column:auto/span 10}.panel-grid .g-col-xl-11{grid-column:auto/span 11}.panel-grid .g-col-xl-12{grid-column:auto/span 12}.panel-grid .g-col-xl-13{grid-column:auto/span 13}.panel-grid .g-col-xl-14{grid-column:auto/span 14}.panel-grid .g-col-xl-15{grid-column:auto/span 15}.panel-grid .g-col-xl-16{grid-column:auto/span 16}.panel-grid .g-col-xl-17{grid-column:auto/span 17}.panel-grid .g-col-xl-18{grid-column:auto/span 18}.panel-grid .g-col-xl-19{grid-column:auto/span 19}.panel-grid .g-col-xl-20{grid-column:auto/span 20}.panel-grid .g-col-xl-21{grid-column:auto/span 21}.panel-grid .g-col-xl-22{grid-column:auto/span 22}.panel-grid .g-col-xl-23{grid-column:auto/span 23}.panel-grid .g-col-xl-24{grid-column:auto/span 24}.panel-grid .g-start-xl-1{grid-column-start:1}.panel-grid .g-start-xl-2{grid-column-start:2}.panel-grid .g-start-xl-3{grid-column-start:3}.panel-grid .g-start-xl-4{grid-column-start:4}.panel-grid .g-start-xl-5{grid-column-start:5}.panel-grid .g-start-xl-6{grid-column-start:6}.panel-grid .g-start-xl-7{grid-column-start:7}.panel-grid .g-start-xl-8{grid-column-start:8}.panel-grid .g-start-xl-9{grid-column-start:9}.panel-grid .g-start-xl-10{grid-column-start:10}.panel-grid .g-start-xl-11{grid-column-start:11}.panel-grid .g-start-xl-12{grid-column-start:12}.panel-grid .g-start-xl-13{grid-column-start:13}.panel-grid .g-start-xl-14{grid-column-start:14}.panel-grid .g-start-xl-15{grid-column-start:15}.panel-grid .g-start-xl-16{grid-column-start:16}.panel-grid .g-start-xl-17{grid-column-start:17}.panel-grid .g-start-xl-18{grid-column-start:18}.panel-grid .g-start-xl-19{grid-column-start:19}.panel-grid .g-start-xl-20{grid-column-start:20}.panel-grid .g-start-xl-21{grid-column-start:21}.panel-grid .g-start-xl-22{grid-column-start:22}.panel-grid .g-start-xl-23{grid-column-start:23}}@media(min-width: 1400px){.panel-grid .g-col-xxl-1{grid-column:auto/span 1}.panel-grid .g-col-xxl-2{grid-column:auto/span 2}.panel-grid .g-col-xxl-3{grid-column:auto/span 3}.panel-grid .g-col-xxl-4{grid-column:auto/span 4}.panel-grid .g-col-xxl-5{grid-column:auto/span 5}.panel-grid .g-col-xxl-6{grid-column:auto/span 6}.panel-grid .g-col-xxl-7{grid-column:auto/span 7}.panel-grid .g-col-xxl-8{grid-column:auto/span 8}.panel-grid .g-col-xxl-9{grid-column:auto/span 9}.panel-grid .g-col-xxl-10{grid-column:auto/span 10}.panel-grid .g-col-xxl-11{grid-column:auto/span 11}.panel-grid .g-col-xxl-12{grid-column:auto/span 12}.panel-grid .g-col-xxl-13{grid-column:auto/span 13}.panel-grid .g-col-xxl-14{grid-column:auto/span 14}.panel-grid .g-col-xxl-15{grid-column:auto/span 15}.panel-grid .g-col-xxl-16{grid-column:auto/span 16}.panel-grid .g-col-xxl-17{grid-column:auto/span 17}.panel-grid .g-col-xxl-18{grid-column:auto/span 18}.panel-grid .g-col-xxl-19{grid-column:auto/span 19}.panel-grid .g-col-xxl-20{grid-column:auto/span 20}.panel-grid .g-col-xxl-21{grid-column:auto/span 21}.panel-grid .g-col-xxl-22{grid-column:auto/span 22}.panel-grid .g-col-xxl-23{grid-column:auto/span 23}.panel-grid .g-col-xxl-24{grid-column:auto/span 24}.panel-grid .g-start-xxl-1{grid-column-start:1}.panel-grid .g-start-xxl-2{grid-column-start:2}.panel-grid .g-start-xxl-3{grid-column-start:3}.panel-grid .g-start-xxl-4{grid-column-start:4}.panel-grid .g-start-xxl-5{grid-column-start:5}.panel-grid .g-start-xxl-6{grid-column-start:6}.panel-grid .g-start-xxl-7{grid-column-start:7}.panel-grid .g-start-xxl-8{grid-column-start:8}.panel-grid .g-start-xxl-9{grid-column-start:9}.panel-grid .g-start-xxl-10{grid-column-start:10}.panel-grid .g-start-xxl-11{grid-column-start:11}.panel-grid .g-start-xxl-12{grid-column-start:12}.panel-grid .g-start-xxl-13{grid-column-start:13}.panel-grid .g-start-xxl-14{grid-column-start:14}.panel-grid .g-start-xxl-15{grid-column-start:15}.panel-grid .g-start-xxl-16{grid-column-start:16}.panel-grid .g-start-xxl-17{grid-column-start:17}.panel-grid .g-start-xxl-18{grid-column-start:18}.panel-grid .g-start-xxl-19{grid-column-start:19}.panel-grid .g-start-xxl-20{grid-column-start:20}.panel-grid .g-start-xxl-21{grid-column-start:21}.panel-grid .g-start-xxl-22{grid-column-start:22}.panel-grid .g-start-xxl-23{grid-column-start:23}}main{margin-top:1em;margin-bottom:1em}h1,.h1,h2,.h2{opacity:.9;margin-top:2rem;margin-bottom:1rem;font-weight:600}h1.title,.title.h1{margin-top:0}h2,.h2{border-bottom:1px solid #dee2e6;padding-bottom:.5rem}h3,.h3{font-weight:600}h3,.h3,h4,.h4{opacity:.9;margin-top:1.5rem}h5,.h5,h6,.h6{opacity:.9}.header-section-number{color:#7f8177}.nav-link.active .header-section-number{color:inherit}mark,.mark{padding:0em}.panel-caption,caption,.figure-caption{font-size:.9rem}.panel-caption,.figure-caption,figcaption{color:#7f8177}.table-caption,caption{color:#3e3f3a}.quarto-layout-cell[data-ref-parent] caption{color:#7f8177}.column-margin figcaption,.margin-caption,div.aside,aside,.column-margin{color:#7f8177;font-size:.825rem}.panel-caption.margin-caption{text-align:inherit}.column-margin.column-container p{margin-bottom:0}.column-margin.column-container>*:not(.collapse){padding-top:.5em;padding-bottom:.5em;display:block}.column-margin.column-container>*.collapse:not(.show){display:none}@media(min-width: 768px){.column-margin.column-container .callout-margin-content:first-child{margin-top:4.5em}.column-margin.column-container .callout-margin-content-simple:first-child{margin-top:3.5em}}.margin-caption>*{padding-top:.5em;padding-bottom:.5em}@media(max-width: 767.98px){.quarto-layout-row{flex-direction:column}}.nav-tabs .nav-item{margin-top:1px;cursor:pointer}.tab-content{margin-top:0px;border-left:#dee2e6 1px solid;border-right:#dee2e6 1px solid;border-bottom:#dee2e6 1px solid;margin-left:0;padding:1em;margin-bottom:1em}@media(max-width: 767.98px){.layout-sidebar{margin-left:0;margin-right:0}}.panel-sidebar,.panel-sidebar .form-control,.panel-input,.panel-input .form-control,.selectize-dropdown{font-size:.9rem}.panel-sidebar .form-control,.panel-input .form-control{padding-top:.1rem}.tab-pane div.sourceCode{margin-top:0px}.tab-pane>p{padding-top:1em}.tab-content>.tab-pane:not(.active){display:none !important}div.sourceCode{background-color:#f8f5f0;border:1px solid #f8f5f0;border-radius:.25rem}pre.sourceCode{background-color:rgba(0,0,0,0)}pre.sourceCode{border:none;font-size:.875em;overflow:visible !important;padding:.4em}.callout pre.sourceCode{padding-left:0}div.sourceCode{overflow-y:hidden}.callout div.sourceCode{margin-left:initial}.blockquote{font-size:inherit;padding-left:1rem;padding-right:1.5rem;color:#7f8177}.blockquote h1:first-child,.blockquote .h1:first-child,.blockquote h2:first-child,.blockquote .h2:first-child,.blockquote h3:first-child,.blockquote .h3:first-child,.blockquote h4:first-child,.blockquote .h4:first-child,.blockquote h5:first-child,.blockquote .h5:first-child{margin-top:0}pre{background-color:initial;padding:initial;border:initial}p code:not(.sourceCode),li code:not(.sourceCode),td code:not(.sourceCode){background-color:#f8f5f0;padding:.2em}nav p code:not(.sourceCode),nav li code:not(.sourceCode),nav td code:not(.sourceCode){background-color:rgba(0,0,0,0);padding:0}td code:not(.sourceCode){white-space:pre-wrap}#quarto-embedded-source-code-modal>.modal-dialog{max-width:1000px;padding-left:1.75rem;padding-right:1.75rem}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body{padding:0}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body div.sourceCode{margin:0;padding:.2rem .2rem;border-radius:0px;border:none}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-header{padding:.7rem}.code-tools-button{font-size:1rem;padding:.15rem .15rem;margin-left:5px;color:#6c757d;background-color:rgba(0,0,0,0);transition:initial;cursor:pointer}.code-tools-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}.code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}.sidebar{will-change:top;transition:top 200ms linear;position:sticky;overflow-y:auto;padding-top:1.2em;max-height:100vh}.sidebar.toc-left,.sidebar.margin-sidebar{top:0px;padding-top:1em}.sidebar.toc-left>*,.sidebar.margin-sidebar>*{padding-top:.5em}.sidebar.quarto-banner-title-block-sidebar>*{padding-top:1.65em}figure .quarto-notebook-link{margin-top:.5em}.quarto-notebook-link{font-size:.75em;color:#6c757d;margin-bottom:1em;text-decoration:none;display:block}.quarto-notebook-link:hover{text-decoration:underline;color:#93c54b}.quarto-notebook-link::before{display:inline-block;height:.75rem;width:.75rem;margin-bottom:0em;margin-right:.25em;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:.75rem .75rem}.quarto-alternate-notebooks i.bi,.quarto-alternate-formats i.bi{margin-right:.4em}.quarto-notebook .cell-container{display:flex}.quarto-notebook .cell-container .cell{flex-grow:4}.quarto-notebook .cell-container .cell-decorator{padding-top:1.5em;padding-right:1em;text-align:right}.quarto-notebook h2,.quarto-notebook .h2{border-bottom:none}.sidebar .quarto-alternate-formats a,.sidebar .quarto-alternate-notebooks a{text-decoration:none}.sidebar .quarto-alternate-formats a:hover,.sidebar .quarto-alternate-notebooks a:hover{color:#93c54b}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2,.sidebar nav[role=doc-toc]>h2,.sidebar nav[role=doc-toc]>.h2{font-size:.875rem;font-weight:400;margin-bottom:.5rem;margin-top:.3rem;font-family:inherit;border-bottom:0;padding-bottom:0;padding-top:0px}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2{margin-top:1rem}.sidebar nav[role=doc-toc]>ul a{border-left:1px solid #f8f5f0;padding-left:.6rem}.sidebar .quarto-alternate-notebooks h2>ul a,.sidebar .quarto-alternate-notebooks .h2>ul a,.sidebar .quarto-alternate-formats h2>ul a,.sidebar .quarto-alternate-formats .h2>ul a{border-left:none;padding-left:.6rem}.sidebar .quarto-alternate-notebooks ul a:empty,.sidebar .quarto-alternate-formats ul a:empty,.sidebar nav[role=doc-toc]>ul a:empty{display:none}.sidebar .quarto-alternate-notebooks ul,.sidebar .quarto-alternate-formats ul,.sidebar nav[role=doc-toc] ul{padding-left:0;list-style:none;font-size:.875rem;font-weight:300}.sidebar .quarto-alternate-notebooks ul li a,.sidebar .quarto-alternate-formats ul li a,.sidebar nav[role=doc-toc]>ul li a{line-height:1.1rem;padding-bottom:.2rem;padding-top:.2rem;color:inherit}.sidebar nav[role=doc-toc] ul>li>ul>li>a{padding-left:1.2em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>a{padding-left:2.4em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>a{padding-left:3.6em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:4.8em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:6em}.sidebar nav[role=doc-toc] ul>li>a.active,.sidebar nav[role=doc-toc] ul>li>ul>li>a.active{border-left:1px solid #93c54b;color:#93c54b !important}.sidebar nav[role=doc-toc] ul>li>a:hover,.sidebar nav[role=doc-toc] ul>li>ul>li>a:hover{color:#93c54b !important}kbd,.kbd{color:#3e3f3a;background-color:#f8f9fa;border:1px solid;border-radius:5px;border-color:#dee2e6}div.hanging-indent{margin-left:1em;text-indent:-1em}.citation a,.footnote-ref{text-decoration:none}.footnotes ol{padding-left:1em}.tippy-content>*{margin-bottom:.7em}.tippy-content>*:last-child{margin-bottom:0}.table a{word-break:break-word}.table>thead{border-top-width:1px;border-top-color:#dee2e6;border-bottom:1px solid #bebfb9}.callout{margin-top:1.25rem;margin-bottom:1.25rem;border-radius:.25rem;overflow-wrap:break-word}.callout .callout-title-container{overflow-wrap:anywhere}.callout.callout-style-simple{padding:.4em .7em;border-left:5px solid;border-right:1px solid #dee2e6;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.callout.callout-style-default{border-left:5px solid;border-right:1px solid #dee2e6;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.callout .callout-body-container{flex-grow:1}.callout.callout-style-simple .callout-body{font-size:.9rem;font-weight:400}.callout.callout-style-default .callout-body{font-size:.9rem;font-weight:400}.callout.callout-titled .callout-body{margin-top:.2em}.callout:not(.no-icon).callout-titled.callout-style-simple .callout-body{padding-left:1.6em}.callout.callout-titled>.callout-header{padding-top:.2em;margin-bottom:-0.2em}.callout.callout-style-simple>div.callout-header{border-bottom:none;font-size:.9rem;font-weight:600;opacity:75%}.callout.callout-style-default>div.callout-header{border-bottom:none;font-weight:600;opacity:85%;font-size:.9rem;padding-left:.5em;padding-right:.5em}.callout.callout-style-default div.callout-body{padding-left:.5em;padding-right:.5em}.callout.callout-style-default div.callout-body>:first-child{margin-top:.5em}.callout>div.callout-header[data-bs-toggle=collapse]{cursor:pointer}.callout.callout-style-default .callout-header[aria-expanded=false],.callout.callout-style-default .callout-header[aria-expanded=true]{padding-top:0px;margin-bottom:0px;align-items:center}.callout.callout-titled .callout-body>:last-child:not(.sourceCode),.callout.callout-titled .callout-body>div>:last-child:not(.sourceCode){margin-bottom:.5rem}.callout:not(.callout-titled) .callout-body>:first-child,.callout:not(.callout-titled) .callout-body>div>:first-child{margin-top:.25rem}.callout:not(.callout-titled) .callout-body>:last-child,.callout:not(.callout-titled) .callout-body>div>:last-child{margin-bottom:.2rem}.callout.callout-style-simple .callout-icon::before,.callout.callout-style-simple .callout-toggle::before{height:1rem;width:1rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.callout.callout-style-default .callout-icon::before,.callout.callout-style-default .callout-toggle::before{height:.9rem;width:.9rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:.9rem .9rem}.callout.callout-style-default .callout-toggle::before{margin-top:5px}.callout .callout-btn-toggle .callout-toggle::before{transition:transform .2s linear}.callout .callout-header[aria-expanded=false] .callout-toggle::before{transform:rotate(-90deg)}.callout .callout-header[aria-expanded=true] .callout-toggle::before{transform:none}.callout.callout-style-simple:not(.no-icon) div.callout-icon-container{padding-top:.2em;padding-right:.55em}.callout.callout-style-default:not(.no-icon) div.callout-icon-container{padding-top:.1em;padding-right:.35em}.callout.callout-style-default:not(.no-icon) div.callout-title-container{margin-top:-1px}.callout.callout-style-default.callout-caution:not(.no-icon) div.callout-icon-container{padding-top:.3em;padding-right:.35em}.callout>.callout-body>.callout-icon-container>.no-icon,.callout>.callout-header>.callout-icon-container>.no-icon{display:none}div.callout.callout{border-left-color:#6c757d}div.callout.callout-style-default>.callout-header{background-color:#6c757d}div.callout-note.callout{border-left-color:#325d88}div.callout-note.callout-style-default>.callout-header{background-color:#ebeff3}div.callout-note:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-tip.callout{border-left-color:#93c54b}div.callout-tip.callout-style-default>.callout-header{background-color:#f4f9ed}div.callout-tip:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-warning.callout{border-left-color:#ffc107}div.callout-warning.callout-style-default>.callout-header{background-color:#fff9e6}div.callout-warning:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-caution.callout{border-left-color:#f47c3c}div.callout-caution.callout-style-default>.callout-header{background-color:#fef2ec}div.callout-caution:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-important.callout{border-left-color:#d9534f}div.callout-important.callout-style-default>.callout-header{background-color:#fbeeed}div.callout-important:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important .callout-toggle::before{background-image:url('data:image/svg+xml,')}.quarto-toggle-container{display:flex;align-items:center}.quarto-reader-toggle .bi::before,.quarto-color-scheme-toggle .bi::before{display:inline-block;height:1rem;width:1rem;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.sidebar-navigation{padding-left:20px}.navbar .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.navbar .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.quarto-sidebar-toggle{border-color:#dee2e6;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem;border-style:solid;border-width:1px;overflow:hidden;border-top-width:0px;padding-top:0px !important}.quarto-sidebar-toggle-title{cursor:pointer;padding-bottom:2px;margin-left:.25em;text-align:center;font-weight:400;font-size:.775em}#quarto-content .quarto-sidebar-toggle{background:#fafafa}#quarto-content .quarto-sidebar-toggle-title{color:#3e3f3a}.quarto-sidebar-toggle-icon{color:#dee2e6;margin-right:.5em;float:right;transition:transform .2s ease}.quarto-sidebar-toggle-icon::before{padding-top:5px}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-icon{transform:rotate(-180deg)}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-title{border-bottom:solid #dee2e6 1px}.quarto-sidebar-toggle-contents{background-color:#fff;padding-right:10px;padding-left:10px;margin-top:0px !important;transition:max-height .5s ease}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-contents{padding-top:1em;padding-bottom:10px}.quarto-sidebar-toggle:not(.expanded) .quarto-sidebar-toggle-contents{padding-top:0px !important;padding-bottom:0px}nav[role=doc-toc]{z-index:1020}#quarto-sidebar>*,nav[role=doc-toc]>*{transition:opacity .1s ease,border .1s ease}#quarto-sidebar.slow>*,nav[role=doc-toc].slow>*{transition:opacity .4s ease,border .4s ease}.quarto-color-scheme-toggle:not(.alternate).top-right .bi::before{background-image:url('data:image/svg+xml,')}.quarto-color-scheme-toggle.alternate.top-right .bi::before{background-image:url('data:image/svg+xml,')}#quarto-appendix.default{border-top:1px solid #dee2e6}#quarto-appendix.default{background-color:#fff;padding-top:1.5em;margin-top:2em;z-index:998}#quarto-appendix.default .quarto-appendix-heading{margin-top:0;line-height:1.4em;font-weight:600;opacity:.9;border-bottom:none;margin-bottom:0}#quarto-appendix.default .footnotes ol,#quarto-appendix.default .footnotes ol li>p:last-of-type,#quarto-appendix.default .quarto-appendix-contents>p:last-of-type{margin-bottom:0}#quarto-appendix.default .quarto-appendix-secondary-label{margin-bottom:.4em}#quarto-appendix.default .quarto-appendix-bibtex{font-size:.7em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-bibtex code.sourceCode{white-space:pre-wrap}#quarto-appendix.default .quarto-appendix-citeas{font-size:.9em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-heading{font-size:1em !important}#quarto-appendix.default *[role=doc-endnotes]>ol,#quarto-appendix.default .quarto-appendix-contents>*:not(h2):not(.h2){font-size:.9em}#quarto-appendix.default section{padding-bottom:1.5em}#quarto-appendix.default section *[role=doc-endnotes],#quarto-appendix.default section>*:not(a){opacity:.9;word-wrap:break-word}.btn.btn-quarto,div.cell-output-display .btn-quarto{color:#fefefe;background-color:#6c757d;border-color:#6c757d}.btn.btn-quarto:hover,div.cell-output-display .btn-quarto:hover{color:#fefefe;background-color:#828a91;border-color:#7b838a}.btn-check:focus+.btn.btn-quarto,.btn.btn-quarto:focus,.btn-check:focus+div.cell-output-display .btn-quarto,div.cell-output-display .btn-quarto:focus{color:#fefefe;background-color:#828a91;border-color:#7b838a;box-shadow:0 0 0 .25rem rgba(130,138,144,.5)}.btn-check:checked+.btn.btn-quarto,.btn-check:active+.btn.btn-quarto,.btn.btn-quarto:active,.btn.btn-quarto.active,.show>.btn.btn-quarto.dropdown-toggle,.btn-check:checked+div.cell-output-display .btn-quarto,.btn-check:active+div.cell-output-display .btn-quarto,div.cell-output-display .btn-quarto:active,div.cell-output-display .btn-quarto.active,.show>div.cell-output-display .btn-quarto.dropdown-toggle{color:#fff;background-color:#899197;border-color:#7b838a}.btn-check:checked+.btn.btn-quarto:focus,.btn-check:active+.btn.btn-quarto:focus,.btn.btn-quarto:active:focus,.btn.btn-quarto.active:focus,.show>.btn.btn-quarto.dropdown-toggle:focus,.btn-check:checked+div.cell-output-display .btn-quarto:focus,.btn-check:active+div.cell-output-display .btn-quarto:focus,div.cell-output-display .btn-quarto:active:focus,div.cell-output-display .btn-quarto.active:focus,.show>div.cell-output-display .btn-quarto.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(130,138,144,.5)}.btn.btn-quarto:disabled,.btn.btn-quarto.disabled,div.cell-output-display .btn-quarto:disabled,div.cell-output-display .btn-quarto.disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}nav.quarto-secondary-nav.color-navbar{background-color:#325d88;color:rgba(255,255,255,.7)}nav.quarto-secondary-nav.color-navbar h1,nav.quarto-secondary-nav.color-navbar .h1,nav.quarto-secondary-nav.color-navbar .quarto-btn-toggle{color:rgba(255,255,255,.7)}@media(max-width: 991.98px){body.nav-sidebar .quarto-title-banner{margin-bottom:0;padding-bottom:0}body.nav-sidebar #title-block-header{margin-block-end:0}}p.subtitle{margin-top:.25em;margin-bottom:.5em}code a:any-link{color:inherit;text-decoration-color:#6c757d}/*! light */div.observablehq table thead tr th{background-color:var(--bs-body-bg)}input,button,select,optgroup,textarea{background-color:var(--bs-body-bg)}.code-annotated .code-copy-button{margin-right:1.25em;margin-top:0;padding-bottom:0;padding-top:3px}.code-annotation-gutter-bg{background-color:#fff}.code-annotation-gutter{background-color:#f8f5f0}.code-annotation-gutter,.code-annotation-gutter-bg{height:100%;width:calc(20px + .5em);position:absolute;top:0;right:0}dl.code-annotation-container-grid dt{margin-right:1em;margin-top:.25rem}dl.code-annotation-container-grid dt{font-family:var(--bs-font-monospace);color:#585a52;border:solid #585a52 1px;border-radius:50%;height:22px;width:22px;line-height:22px;font-size:11px;text-align:center;vertical-align:middle;text-decoration:none}dl.code-annotation-container-grid dt[data-target-cell]{cursor:pointer}dl.code-annotation-container-grid dt[data-target-cell].code-annotation-active{color:#fff;border:solid #aaa 1px;background-color:#aaa}pre.code-annotation-code{padding-top:0;padding-bottom:0}pre.code-annotation-code code{z-index:3}#code-annotation-line-highlight-gutter{width:100%;border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}#code-annotation-line-highlight{margin-left:-4em;width:calc(100% + 4em);border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}code.sourceCode .code-annotation-anchor.code-annotation-active{background-color:var(--quarto-hl-normal-color, #aaaaaa);border:solid var(--quarto-hl-normal-color, #aaaaaa) 1px;color:#f8f5f0;font-weight:bolder}code.sourceCode .code-annotation-anchor{font-family:var(--bs-font-monospace);color:var(--quarto-hl-co-color);border:solid var(--quarto-hl-co-color) 1px;border-radius:50%;height:18px;width:18px;font-size:9px;margin-top:2px}code.sourceCode button.code-annotation-anchor{padding:2px}code.sourceCode a.code-annotation-anchor{line-height:18px;text-align:center;vertical-align:middle;cursor:default;text-decoration:none}@media print{.page-columns .column-screen-inset{grid-column:page-start-inset/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset table{background:#fff}.page-columns .column-screen-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-left table{background:#fff}.page-columns .column-screen-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-right table{background:#fff}.page-columns .column-screen{grid-column:page-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen table{background:#fff}.page-columns .column-screen-left{grid-column:page-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-left table{background:#fff}.page-columns .column-screen-right{grid-column:body-content-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-right table{background:#fff}.page-columns .column-screen-inset-shaded{grid-column:page-start-inset/page-end-inset;padding:1em;background:#f8f5f0;z-index:998;transform:translate3d(0, 0, 0);margin-bottom:1em}}.quarto-video{margin-bottom:1em}.table>thead{border-top-width:0}.table>:not(caption)>*:not(:last-child)>*{border-bottom-color:#eff0ee;border-bottom-style:solid;border-bottom-width:1px}.table>:not(:first-child){border-top:1px solid #bebfb9;border-bottom:1px solid inherit}.table tbody{border-bottom-color:#bebfb9}a.external:after{display:inline-block;height:.75rem;width:.75rem;margin-bottom:.15em;margin-left:.25em;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:.75rem .75rem}div.sourceCode code a.external:after{content:none}a.external:after:hover{cursor:pointer}.quarto-ext-icon{display:inline-block;font-size:.75em;padding-left:.3em}.code-with-filename .code-with-filename-file{margin-bottom:0;padding-bottom:2px;padding-top:2px;padding-left:.7em;border:var(--quarto-border-width) solid var(--quarto-border-color);border-radius:var(--quarto-border-radius);border-bottom:0;border-bottom-left-radius:0%;border-bottom-right-radius:0%}.code-with-filename div.sourceCode,.reveal .code-with-filename div.sourceCode{margin-top:0;border-top-left-radius:0%;border-top-right-radius:0%}.code-with-filename .code-with-filename-file pre{margin-bottom:0}.code-with-filename .code-with-filename-file,.code-with-filename .code-with-filename-file pre{background-color:rgba(219,219,219,.8)}.quarto-dark .code-with-filename .code-with-filename-file,.quarto-dark .code-with-filename .code-with-filename-file pre{background-color:#555}.code-with-filename .code-with-filename-file strong{font-weight:400}.quarto-title-banner{margin-bottom:1em;color:rgba(255,255,255,.7);background:#325d88}.quarto-title-banner .code-tools-button{color:rgba(204,204,204,.7)}.quarto-title-banner .code-tools-button:hover{color:rgba(255,255,255,.7)}.quarto-title-banner .code-tools-button>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .quarto-title .title{font-weight:600}.quarto-title-banner .quarto-categories{margin-top:.75em}@media(min-width: 992px){.quarto-title-banner{padding-top:2.5em;padding-bottom:2.5em}}@media(max-width: 991.98px){.quarto-title-banner{padding-top:1em;padding-bottom:1em}}main.quarto-banner-title-block>section:first-child>h2,main.quarto-banner-title-block>section:first-child>.h2,main.quarto-banner-title-block>section:first-child>h3,main.quarto-banner-title-block>section:first-child>.h3,main.quarto-banner-title-block>section:first-child>h4,main.quarto-banner-title-block>section:first-child>.h4{margin-top:0}.quarto-title .quarto-categories{display:flex;flex-wrap:wrap;row-gap:.5em;column-gap:.4em;padding-bottom:.5em;margin-top:.75em}.quarto-title .quarto-categories .quarto-category{padding:.25em .75em;font-size:.65em;text-transform:uppercase;border:solid 1px;border-radius:.25rem;opacity:.6}.quarto-title .quarto-categories .quarto-category a{color:inherit}#title-block-header.quarto-title-block.default .quarto-title-meta{display:grid;grid-template-columns:repeat(2, 1fr)}#title-block-header.quarto-title-block.default .quarto-title .title{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-author-orcid img{margin-top:-5px}#title-block-header.quarto-title-block.default .quarto-description p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p,#title-block-header.quarto-title-block.default .quarto-title-authors p,#title-block-header.quarto-title-block.default .quarto-title-affiliations p{margin-bottom:.1em}#title-block-header.quarto-title-block.default .quarto-title-meta-heading{text-transform:uppercase;margin-top:1em;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-contents{font-size:.9em}#title-block-header.quarto-title-block.default .quarto-title-meta-contents a{color:#3e3f3a}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p.affiliation:last-of-type{margin-bottom:.7em}#title-block-header.quarto-title-block.default p.affiliation{margin-bottom:.1em}#title-block-header.quarto-title-block.default .description,#title-block-header.quarto-title-block.default .abstract{margin-top:0}#title-block-header.quarto-title-block.default .description>p,#title-block-header.quarto-title-block.default .abstract>p{font-size:.9em}#title-block-header.quarto-title-block.default .description>p:last-of-type,#title-block-header.quarto-title-block.default .abstract>p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .description .abstract-title,#title-block-header.quarto-title-block.default .abstract .abstract-title{margin-top:1em;text-transform:uppercase;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-author{display:grid;grid-template-columns:1fr 1fr}.quarto-title-tools-only{display:flex;justify-content:right}.bg-primary{background-color:#3e3f3a !important}.bg-dark{background-color:#6c757d !important}.bg-light{background-color:#f8f5f0 !important}.sandstone,.tooltip,.dropdown-menu .dropdown-item,.pagination,.breadcrumb,.nav-pills .nav-link,.nav-tabs .nav-link,.btn,.navbar .nav-link{font-size:13px;line-height:22px;font-weight:500;text-transform:uppercase}.navbar-form input,.navbar-form .form-control{border:none}.btn:hover{border-color:rgba(0,0,0,0)}.btn-success,.btn-warning{color:#fff}.table .thead-dark th{background-color:#3e3f3a}.nav-tabs .nav-link{background-color:#f8f5f0;border-color:#dee2e6}.nav-tabs .nav-link,.nav-tabs .nav-link:hover,.nav-tabs .nav-link:focus{color:#6c757d}.nav-tabs .nav-link.disabled,.nav-tabs .nav-link.disabled:hover,.nav-tabs .nav-link.disabled:focus{background-color:#f8f5f0;border-color:#dee2e6;color:#dee2e6}.nav-pills .nav-link{border:1px solid rgba(0,0,0,0);color:#6c757d}.nav-pills .nav-link.active,.nav-pills .nav-link:hover,.nav-pills .nav-link:focus{background-color:#f8f5f0;border-color:#dee2e6}.nav-pills .nav-link.disabled,.nav-pills .nav-link.disabled:hover{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0);color:#dee2e6}.breadcrumb{border:1px solid #dee2e6}.pagination a:hover{text-decoration:none}.alert{color:#fff}.alert a,.alert .alert-link{color:#fff;text-decoration:underline}.alert-primary,.alert-primary>th,.alert-primary>td{background-color:#325d88}.alert-secondary,.alert-secondary>th,.alert-secondary>td{background-color:#6c757d}.alert-success,.alert-success>th,.alert-success>td{background-color:#93c54b}.alert-info,.alert-info>th,.alert-info>td{background-color:#29abe0}.alert-danger,.alert-danger>th,.alert-danger>td{background-color:#d9534f}.alert-warning,.alert-warning>th,.alert-warning>td{background-color:#f47c3c}.alert-dark,.alert-dark>th,.alert-dark>td{background-color:#3e3f3a}.alert-light,.alert-light>th,.alert-light>td{background-color:#f8f5f0}.alert-light,.alert-light a:not(.btn),.alert-light .alert-link{color:#3e3f3a}.badge.bg-light{color:#3e3f3a}.modal .btn-close,.toast .btn-close{background-image:url("data:image/svg+xml,")}/*# sourceMappingURL=9161419e6f82ea4435380a70856fa72b.css.map */ +*/.ansi-black-fg{color:#3e424d}.ansi-black-bg{background-color:#3e424d}.ansi-black-intense-fg{color:#282c36}.ansi-black-intense-bg{background-color:#282c36}.ansi-red-fg{color:#e75c58}.ansi-red-bg{background-color:#e75c58}.ansi-red-intense-fg{color:#b22b31}.ansi-red-intense-bg{background-color:#b22b31}.ansi-green-fg{color:#00a250}.ansi-green-bg{background-color:#00a250}.ansi-green-intense-fg{color:#007427}.ansi-green-intense-bg{background-color:#007427}.ansi-yellow-fg{color:#ddb62b}.ansi-yellow-bg{background-color:#ddb62b}.ansi-yellow-intense-fg{color:#b27d12}.ansi-yellow-intense-bg{background-color:#b27d12}.ansi-blue-fg{color:#208ffb}.ansi-blue-bg{background-color:#208ffb}.ansi-blue-intense-fg{color:#0065ca}.ansi-blue-intense-bg{background-color:#0065ca}.ansi-magenta-fg{color:#d160c4}.ansi-magenta-bg{background-color:#d160c4}.ansi-magenta-intense-fg{color:#a03196}.ansi-magenta-intense-bg{background-color:#a03196}.ansi-cyan-fg{color:#60c6c8}.ansi-cyan-bg{background-color:#60c6c8}.ansi-cyan-intense-fg{color:#258f8f}.ansi-cyan-intense-bg{background-color:#258f8f}.ansi-white-fg{color:#c5c1b4}.ansi-white-bg{background-color:#c5c1b4}.ansi-white-intense-fg{color:#a1a6b2}.ansi-white-intense-bg{background-color:#a1a6b2}.ansi-default-inverse-fg{color:#fff}.ansi-default-inverse-bg{background-color:#000}.ansi-bold{font-weight:bold}.ansi-underline{text-decoration:underline}:root{--quarto-body-bg: #fff;--quarto-body-color: #3e3f3a;--quarto-text-muted: #6c757d;--quarto-border-color: #dee2e6;--quarto-border-width: 1px;--quarto-border-radius: 0.25rem}table.gt_table{color:var(--quarto-body-color);font-size:1em;width:100%;background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_column_spanner_outer{color:var(--quarto-body-color);background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_col_heading{color:var(--quarto-body-color);font-weight:bold;background-color:rgba(0,0,0,0)}table.gt_table thead.gt_col_headings{border-bottom:1px solid currentColor;border-top-width:inherit;border-top-color:var(--quarto-border-color)}table.gt_table thead.gt_col_headings:not(:first-child){border-top-width:1px;border-top-color:var(--quarto-border-color)}table.gt_table td.gt_row{border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-width:0px}table.gt_table tbody.gt_table_body{border-top-width:1px;border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-color:currentColor}div.columns{display:initial;gap:initial}div.column{display:inline-block;overflow-x:initial;vertical-align:top;width:50%}.code-annotation-tip-content{word-wrap:break-word}.code-annotation-container-hidden{display:none !important}dl.code-annotation-container-grid{display:grid;grid-template-columns:min-content auto}dl.code-annotation-container-grid dt{grid-column:1}dl.code-annotation-container-grid dd{grid-column:2}pre.sourceCode.code-annotation-code{padding-right:0}code.sourceCode .code-annotation-anchor{z-index:100;position:absolute;right:.5em;left:inherit;background-color:rgba(0,0,0,0)}:root{--mermaid-bg-color: #fff;--mermaid-edge-color: #6c757d;--mermaid-node-fg-color: #3e3f3a;--mermaid-fg-color: #3e3f3a;--mermaid-fg-color--lighter: #585a52;--mermaid-fg-color--lightest: #72746b;--mermaid-font-family: Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;--mermaid-label-bg-color: #fff;--mermaid-label-fg-color: #325d88;--mermaid-node-bg-color: rgba(50, 93, 136, 0.1);--mermaid-node-fg-color: #3e3f3a}@media print{:root{font-size:11pt}#quarto-sidebar,#TOC,.nav-page{display:none}.page-columns .content{grid-column-start:page-start}.fixed-top{position:relative}.panel-caption,.figure-caption,figcaption{color:#666}}.code-copy-button{position:absolute;top:0;right:0;border:0;margin-top:5px;margin-right:5px;background-color:rgba(0,0,0,0);z-index:3}.code-copy-button:focus{outline:none}.code-copy-button-tooltip{font-size:.75em}pre.sourceCode:hover>.code-copy-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}pre.sourceCode:hover>.code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button-checked:hover>.bi::before{background-image:url('data:image/svg+xml,')}main ol ol,main ul ul,main ol ul,main ul ol{margin-bottom:1em}ul>li:not(:has(>p))>ul,ol>li:not(:has(>p))>ul,ul>li:not(:has(>p))>ol,ol>li:not(:has(>p))>ol{margin-bottom:0}ul>li:not(:has(>p))>ul>li:has(>p),ol>li:not(:has(>p))>ul>li:has(>p),ul>li:not(:has(>p))>ol>li:has(>p),ol>li:not(:has(>p))>ol>li:has(>p){margin-top:1rem}body{margin:0}main.page-columns>header>h1.title,main.page-columns>header>.title.h1{margin-bottom:0}@media(min-width: 992px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] 35px [page-end-inset page-end] 5fr [screen-end-inset] 1.5em}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 850px - 3em )) [body-content-end] 3em [body-end] 50px [body-end-outset] minmax(0px, 250px) [page-end-inset] minmax(50px, 100px) [page-end] 1fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 100px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 150px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 991.98px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc( 1250px - 3em )) [body-content-end body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1.5em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 1000px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 800px - 3em )) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc( 750px - 3em )) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 767.98px){body .page-columns,body.fullcontent:not(.floating):not(.docked) .page-columns,body.slimcontent:not(.floating):not(.docked) .page-columns,body.docked .page-columns,body.docked.slimcontent .page-columns,body.docked.fullcontent .page-columns,body.floating .page-columns,body.floating.slimcontent .page-columns,body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}nav[role=doc-toc]{display:none}}body,.page-row-navigation{grid-template-rows:[page-top] max-content [contents-top] max-content [contents-bottom] max-content [page-bottom]}.page-rows-contents{grid-template-rows:[content-top] minmax(max-content, 1fr) [content-bottom] minmax(60px, max-content) [page-bottom]}.page-full{grid-column:screen-start/screen-end !important}.page-columns>*{grid-column:body-content-start/body-content-end}.page-columns.column-page>*{grid-column:page-start/page-end}.page-columns.column-page-left>*{grid-column:page-start/body-content-end}.page-columns.column-page-right>*{grid-column:body-content-start/page-end}.page-rows{grid-auto-rows:auto}.header{grid-column:screen-start/screen-end;grid-row:page-top/contents-top}#quarto-content{padding:0;grid-column:screen-start/screen-end;grid-row:contents-top/contents-bottom}body.floating .sidebar.sidebar-navigation{grid-column:page-start/body-start;grid-row:content-top/page-bottom}body.docked .sidebar.sidebar-navigation{grid-column:screen-start/body-start;grid-row:content-top/page-bottom}.sidebar.toc-left{grid-column:page-start/body-start;grid-row:content-top/page-bottom}.sidebar.margin-sidebar{grid-column:body-end/page-end;grid-row:content-top/page-bottom}.page-columns .content{grid-column:body-content-start/body-content-end;grid-row:content-top/content-bottom;align-content:flex-start}.page-columns .page-navigation{grid-column:body-content-start/body-content-end;grid-row:content-bottom/page-bottom}.page-columns .footer{grid-column:screen-start/screen-end;grid-row:contents-bottom/page-bottom}.page-columns .column-body{grid-column:body-content-start/body-content-end}.page-columns .column-body-fullbleed{grid-column:body-start/body-end}.page-columns .column-body-outset{grid-column:body-start-outset/body-end-outset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset table{background:#fff}.page-columns .column-body-outset-left{grid-column:body-start-outset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset-left table{background:#fff}.page-columns .column-body-outset-right{grid-column:body-content-start/body-end-outset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-body-outset-right table{background:#fff}.page-columns .column-page{grid-column:page-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page table{background:#fff}.page-columns .column-page-inset{grid-column:page-start-inset/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset table{background:#fff}.page-columns .column-page-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset-left table{background:#fff}.page-columns .column-page-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-inset-right figcaption table{background:#fff}.page-columns .column-page-left{grid-column:page-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-left table{background:#fff}.page-columns .column-page-right{grid-column:body-content-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-page-right figcaption table{background:#fff}#quarto-content.page-columns #quarto-margin-sidebar,#quarto-content.page-columns #quarto-sidebar{z-index:1}@media(max-width: 991.98px){#quarto-content.page-columns #quarto-margin-sidebar.collapse,#quarto-content.page-columns #quarto-sidebar.collapse,#quarto-content.page-columns #quarto-margin-sidebar.collapsing,#quarto-content.page-columns #quarto-sidebar.collapsing{z-index:1055}}#quarto-content.page-columns main.column-page,#quarto-content.page-columns main.column-page-right,#quarto-content.page-columns main.column-page-left{z-index:0}.page-columns .column-screen-inset{grid-column:screen-start-inset/screen-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset table{background:#fff}.page-columns .column-screen-inset-left{grid-column:screen-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-left table{background:#fff}.page-columns .column-screen-inset-right{grid-column:body-content-start/screen-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-right table{background:#fff}.page-columns .column-screen{grid-column:screen-start/screen-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen table{background:#fff}.page-columns .column-screen-left{grid-column:screen-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-left table{background:#fff}.page-columns .column-screen-right{grid-column:body-content-start/screen-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-right table{background:#fff}.page-columns .column-screen-inset-shaded{grid-column:screen-start/screen-end;padding:1em;background:#f8f5f0;z-index:998;transform:translate3d(0, 0, 0);margin-bottom:1em}.zindex-content{z-index:998;transform:translate3d(0, 0, 0)}.zindex-modal{z-index:1055;transform:translate3d(0, 0, 0)}.zindex-over-content{z-index:999;transform:translate3d(0, 0, 0)}img.img-fluid.column-screen,img.img-fluid.column-screen-inset-shaded,img.img-fluid.column-screen-inset,img.img-fluid.column-screen-inset-left,img.img-fluid.column-screen-inset-right,img.img-fluid.column-screen-left,img.img-fluid.column-screen-right{width:100%}@media(min-width: 992px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-end/page-end !important;z-index:998}.column-sidebar{grid-column:page-start/body-start !important;z-index:998}.column-leftmargin{grid-column:screen-start-inset/body-start !important;z-index:998}.no-row-height{height:1em;overflow:visible}}@media(max-width: 991.98px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-end/page-end !important;z-index:998}.no-row-height{height:1em;overflow:visible}.page-columns.page-full{overflow:visible}.page-columns.toc-left .margin-caption,.page-columns.toc-left div.aside,.page-columns.toc-left aside,.page-columns.toc-left .column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;transform:translate3d(0, 0, 0)}.page-columns.toc-left .no-row-height{height:initial;overflow:initial}}@media(max-width: 767.98px){.margin-caption,div.aside,aside,.column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;transform:translate3d(0, 0, 0)}.no-row-height{height:initial;overflow:initial}#quarto-margin-sidebar{display:none}#quarto-sidebar-toc-left{display:none}.hidden-sm{display:none}}.panel-grid{display:grid;grid-template-rows:repeat(1, 1fr);grid-template-columns:repeat(24, 1fr);gap:1em}.panel-grid .g-col-1{grid-column:auto/span 1}.panel-grid .g-col-2{grid-column:auto/span 2}.panel-grid .g-col-3{grid-column:auto/span 3}.panel-grid .g-col-4{grid-column:auto/span 4}.panel-grid .g-col-5{grid-column:auto/span 5}.panel-grid .g-col-6{grid-column:auto/span 6}.panel-grid .g-col-7{grid-column:auto/span 7}.panel-grid .g-col-8{grid-column:auto/span 8}.panel-grid .g-col-9{grid-column:auto/span 9}.panel-grid .g-col-10{grid-column:auto/span 10}.panel-grid .g-col-11{grid-column:auto/span 11}.panel-grid .g-col-12{grid-column:auto/span 12}.panel-grid .g-col-13{grid-column:auto/span 13}.panel-grid .g-col-14{grid-column:auto/span 14}.panel-grid .g-col-15{grid-column:auto/span 15}.panel-grid .g-col-16{grid-column:auto/span 16}.panel-grid .g-col-17{grid-column:auto/span 17}.panel-grid .g-col-18{grid-column:auto/span 18}.panel-grid .g-col-19{grid-column:auto/span 19}.panel-grid .g-col-20{grid-column:auto/span 20}.panel-grid .g-col-21{grid-column:auto/span 21}.panel-grid .g-col-22{grid-column:auto/span 22}.panel-grid .g-col-23{grid-column:auto/span 23}.panel-grid .g-col-24{grid-column:auto/span 24}.panel-grid .g-start-1{grid-column-start:1}.panel-grid .g-start-2{grid-column-start:2}.panel-grid .g-start-3{grid-column-start:3}.panel-grid .g-start-4{grid-column-start:4}.panel-grid .g-start-5{grid-column-start:5}.panel-grid .g-start-6{grid-column-start:6}.panel-grid .g-start-7{grid-column-start:7}.panel-grid .g-start-8{grid-column-start:8}.panel-grid .g-start-9{grid-column-start:9}.panel-grid .g-start-10{grid-column-start:10}.panel-grid .g-start-11{grid-column-start:11}.panel-grid .g-start-12{grid-column-start:12}.panel-grid .g-start-13{grid-column-start:13}.panel-grid .g-start-14{grid-column-start:14}.panel-grid .g-start-15{grid-column-start:15}.panel-grid .g-start-16{grid-column-start:16}.panel-grid .g-start-17{grid-column-start:17}.panel-grid .g-start-18{grid-column-start:18}.panel-grid .g-start-19{grid-column-start:19}.panel-grid .g-start-20{grid-column-start:20}.panel-grid .g-start-21{grid-column-start:21}.panel-grid .g-start-22{grid-column-start:22}.panel-grid .g-start-23{grid-column-start:23}@media(min-width: 576px){.panel-grid .g-col-sm-1{grid-column:auto/span 1}.panel-grid .g-col-sm-2{grid-column:auto/span 2}.panel-grid .g-col-sm-3{grid-column:auto/span 3}.panel-grid .g-col-sm-4{grid-column:auto/span 4}.panel-grid .g-col-sm-5{grid-column:auto/span 5}.panel-grid .g-col-sm-6{grid-column:auto/span 6}.panel-grid .g-col-sm-7{grid-column:auto/span 7}.panel-grid .g-col-sm-8{grid-column:auto/span 8}.panel-grid .g-col-sm-9{grid-column:auto/span 9}.panel-grid .g-col-sm-10{grid-column:auto/span 10}.panel-grid .g-col-sm-11{grid-column:auto/span 11}.panel-grid .g-col-sm-12{grid-column:auto/span 12}.panel-grid .g-col-sm-13{grid-column:auto/span 13}.panel-grid .g-col-sm-14{grid-column:auto/span 14}.panel-grid .g-col-sm-15{grid-column:auto/span 15}.panel-grid .g-col-sm-16{grid-column:auto/span 16}.panel-grid .g-col-sm-17{grid-column:auto/span 17}.panel-grid .g-col-sm-18{grid-column:auto/span 18}.panel-grid .g-col-sm-19{grid-column:auto/span 19}.panel-grid .g-col-sm-20{grid-column:auto/span 20}.panel-grid .g-col-sm-21{grid-column:auto/span 21}.panel-grid .g-col-sm-22{grid-column:auto/span 22}.panel-grid .g-col-sm-23{grid-column:auto/span 23}.panel-grid .g-col-sm-24{grid-column:auto/span 24}.panel-grid .g-start-sm-1{grid-column-start:1}.panel-grid .g-start-sm-2{grid-column-start:2}.panel-grid .g-start-sm-3{grid-column-start:3}.panel-grid .g-start-sm-4{grid-column-start:4}.panel-grid .g-start-sm-5{grid-column-start:5}.panel-grid .g-start-sm-6{grid-column-start:6}.panel-grid .g-start-sm-7{grid-column-start:7}.panel-grid .g-start-sm-8{grid-column-start:8}.panel-grid .g-start-sm-9{grid-column-start:9}.panel-grid .g-start-sm-10{grid-column-start:10}.panel-grid .g-start-sm-11{grid-column-start:11}.panel-grid .g-start-sm-12{grid-column-start:12}.panel-grid .g-start-sm-13{grid-column-start:13}.panel-grid .g-start-sm-14{grid-column-start:14}.panel-grid .g-start-sm-15{grid-column-start:15}.panel-grid .g-start-sm-16{grid-column-start:16}.panel-grid .g-start-sm-17{grid-column-start:17}.panel-grid .g-start-sm-18{grid-column-start:18}.panel-grid .g-start-sm-19{grid-column-start:19}.panel-grid .g-start-sm-20{grid-column-start:20}.panel-grid .g-start-sm-21{grid-column-start:21}.panel-grid .g-start-sm-22{grid-column-start:22}.panel-grid .g-start-sm-23{grid-column-start:23}}@media(min-width: 768px){.panel-grid .g-col-md-1{grid-column:auto/span 1}.panel-grid .g-col-md-2{grid-column:auto/span 2}.panel-grid .g-col-md-3{grid-column:auto/span 3}.panel-grid .g-col-md-4{grid-column:auto/span 4}.panel-grid .g-col-md-5{grid-column:auto/span 5}.panel-grid .g-col-md-6{grid-column:auto/span 6}.panel-grid .g-col-md-7{grid-column:auto/span 7}.panel-grid .g-col-md-8{grid-column:auto/span 8}.panel-grid .g-col-md-9{grid-column:auto/span 9}.panel-grid .g-col-md-10{grid-column:auto/span 10}.panel-grid .g-col-md-11{grid-column:auto/span 11}.panel-grid .g-col-md-12{grid-column:auto/span 12}.panel-grid .g-col-md-13{grid-column:auto/span 13}.panel-grid .g-col-md-14{grid-column:auto/span 14}.panel-grid .g-col-md-15{grid-column:auto/span 15}.panel-grid .g-col-md-16{grid-column:auto/span 16}.panel-grid .g-col-md-17{grid-column:auto/span 17}.panel-grid .g-col-md-18{grid-column:auto/span 18}.panel-grid .g-col-md-19{grid-column:auto/span 19}.panel-grid .g-col-md-20{grid-column:auto/span 20}.panel-grid .g-col-md-21{grid-column:auto/span 21}.panel-grid .g-col-md-22{grid-column:auto/span 22}.panel-grid .g-col-md-23{grid-column:auto/span 23}.panel-grid .g-col-md-24{grid-column:auto/span 24}.panel-grid .g-start-md-1{grid-column-start:1}.panel-grid .g-start-md-2{grid-column-start:2}.panel-grid .g-start-md-3{grid-column-start:3}.panel-grid .g-start-md-4{grid-column-start:4}.panel-grid .g-start-md-5{grid-column-start:5}.panel-grid .g-start-md-6{grid-column-start:6}.panel-grid .g-start-md-7{grid-column-start:7}.panel-grid .g-start-md-8{grid-column-start:8}.panel-grid .g-start-md-9{grid-column-start:9}.panel-grid .g-start-md-10{grid-column-start:10}.panel-grid .g-start-md-11{grid-column-start:11}.panel-grid .g-start-md-12{grid-column-start:12}.panel-grid .g-start-md-13{grid-column-start:13}.panel-grid .g-start-md-14{grid-column-start:14}.panel-grid .g-start-md-15{grid-column-start:15}.panel-grid .g-start-md-16{grid-column-start:16}.panel-grid .g-start-md-17{grid-column-start:17}.panel-grid .g-start-md-18{grid-column-start:18}.panel-grid .g-start-md-19{grid-column-start:19}.panel-grid .g-start-md-20{grid-column-start:20}.panel-grid .g-start-md-21{grid-column-start:21}.panel-grid .g-start-md-22{grid-column-start:22}.panel-grid .g-start-md-23{grid-column-start:23}}@media(min-width: 992px){.panel-grid .g-col-lg-1{grid-column:auto/span 1}.panel-grid .g-col-lg-2{grid-column:auto/span 2}.panel-grid .g-col-lg-3{grid-column:auto/span 3}.panel-grid .g-col-lg-4{grid-column:auto/span 4}.panel-grid .g-col-lg-5{grid-column:auto/span 5}.panel-grid .g-col-lg-6{grid-column:auto/span 6}.panel-grid .g-col-lg-7{grid-column:auto/span 7}.panel-grid .g-col-lg-8{grid-column:auto/span 8}.panel-grid .g-col-lg-9{grid-column:auto/span 9}.panel-grid .g-col-lg-10{grid-column:auto/span 10}.panel-grid .g-col-lg-11{grid-column:auto/span 11}.panel-grid .g-col-lg-12{grid-column:auto/span 12}.panel-grid .g-col-lg-13{grid-column:auto/span 13}.panel-grid .g-col-lg-14{grid-column:auto/span 14}.panel-grid .g-col-lg-15{grid-column:auto/span 15}.panel-grid .g-col-lg-16{grid-column:auto/span 16}.panel-grid .g-col-lg-17{grid-column:auto/span 17}.panel-grid .g-col-lg-18{grid-column:auto/span 18}.panel-grid .g-col-lg-19{grid-column:auto/span 19}.panel-grid .g-col-lg-20{grid-column:auto/span 20}.panel-grid .g-col-lg-21{grid-column:auto/span 21}.panel-grid .g-col-lg-22{grid-column:auto/span 22}.panel-grid .g-col-lg-23{grid-column:auto/span 23}.panel-grid .g-col-lg-24{grid-column:auto/span 24}.panel-grid .g-start-lg-1{grid-column-start:1}.panel-grid .g-start-lg-2{grid-column-start:2}.panel-grid .g-start-lg-3{grid-column-start:3}.panel-grid .g-start-lg-4{grid-column-start:4}.panel-grid .g-start-lg-5{grid-column-start:5}.panel-grid .g-start-lg-6{grid-column-start:6}.panel-grid .g-start-lg-7{grid-column-start:7}.panel-grid .g-start-lg-8{grid-column-start:8}.panel-grid .g-start-lg-9{grid-column-start:9}.panel-grid .g-start-lg-10{grid-column-start:10}.panel-grid .g-start-lg-11{grid-column-start:11}.panel-grid .g-start-lg-12{grid-column-start:12}.panel-grid .g-start-lg-13{grid-column-start:13}.panel-grid .g-start-lg-14{grid-column-start:14}.panel-grid .g-start-lg-15{grid-column-start:15}.panel-grid .g-start-lg-16{grid-column-start:16}.panel-grid .g-start-lg-17{grid-column-start:17}.panel-grid .g-start-lg-18{grid-column-start:18}.panel-grid .g-start-lg-19{grid-column-start:19}.panel-grid .g-start-lg-20{grid-column-start:20}.panel-grid .g-start-lg-21{grid-column-start:21}.panel-grid .g-start-lg-22{grid-column-start:22}.panel-grid .g-start-lg-23{grid-column-start:23}}@media(min-width: 1200px){.panel-grid .g-col-xl-1{grid-column:auto/span 1}.panel-grid .g-col-xl-2{grid-column:auto/span 2}.panel-grid .g-col-xl-3{grid-column:auto/span 3}.panel-grid .g-col-xl-4{grid-column:auto/span 4}.panel-grid .g-col-xl-5{grid-column:auto/span 5}.panel-grid .g-col-xl-6{grid-column:auto/span 6}.panel-grid .g-col-xl-7{grid-column:auto/span 7}.panel-grid .g-col-xl-8{grid-column:auto/span 8}.panel-grid .g-col-xl-9{grid-column:auto/span 9}.panel-grid .g-col-xl-10{grid-column:auto/span 10}.panel-grid .g-col-xl-11{grid-column:auto/span 11}.panel-grid .g-col-xl-12{grid-column:auto/span 12}.panel-grid .g-col-xl-13{grid-column:auto/span 13}.panel-grid .g-col-xl-14{grid-column:auto/span 14}.panel-grid .g-col-xl-15{grid-column:auto/span 15}.panel-grid .g-col-xl-16{grid-column:auto/span 16}.panel-grid .g-col-xl-17{grid-column:auto/span 17}.panel-grid .g-col-xl-18{grid-column:auto/span 18}.panel-grid .g-col-xl-19{grid-column:auto/span 19}.panel-grid .g-col-xl-20{grid-column:auto/span 20}.panel-grid .g-col-xl-21{grid-column:auto/span 21}.panel-grid .g-col-xl-22{grid-column:auto/span 22}.panel-grid .g-col-xl-23{grid-column:auto/span 23}.panel-grid .g-col-xl-24{grid-column:auto/span 24}.panel-grid .g-start-xl-1{grid-column-start:1}.panel-grid .g-start-xl-2{grid-column-start:2}.panel-grid .g-start-xl-3{grid-column-start:3}.panel-grid .g-start-xl-4{grid-column-start:4}.panel-grid .g-start-xl-5{grid-column-start:5}.panel-grid .g-start-xl-6{grid-column-start:6}.panel-grid .g-start-xl-7{grid-column-start:7}.panel-grid .g-start-xl-8{grid-column-start:8}.panel-grid .g-start-xl-9{grid-column-start:9}.panel-grid .g-start-xl-10{grid-column-start:10}.panel-grid .g-start-xl-11{grid-column-start:11}.panel-grid .g-start-xl-12{grid-column-start:12}.panel-grid .g-start-xl-13{grid-column-start:13}.panel-grid .g-start-xl-14{grid-column-start:14}.panel-grid .g-start-xl-15{grid-column-start:15}.panel-grid .g-start-xl-16{grid-column-start:16}.panel-grid .g-start-xl-17{grid-column-start:17}.panel-grid .g-start-xl-18{grid-column-start:18}.panel-grid .g-start-xl-19{grid-column-start:19}.panel-grid .g-start-xl-20{grid-column-start:20}.panel-grid .g-start-xl-21{grid-column-start:21}.panel-grid .g-start-xl-22{grid-column-start:22}.panel-grid .g-start-xl-23{grid-column-start:23}}@media(min-width: 1400px){.panel-grid .g-col-xxl-1{grid-column:auto/span 1}.panel-grid .g-col-xxl-2{grid-column:auto/span 2}.panel-grid .g-col-xxl-3{grid-column:auto/span 3}.panel-grid .g-col-xxl-4{grid-column:auto/span 4}.panel-grid .g-col-xxl-5{grid-column:auto/span 5}.panel-grid .g-col-xxl-6{grid-column:auto/span 6}.panel-grid .g-col-xxl-7{grid-column:auto/span 7}.panel-grid .g-col-xxl-8{grid-column:auto/span 8}.panel-grid .g-col-xxl-9{grid-column:auto/span 9}.panel-grid .g-col-xxl-10{grid-column:auto/span 10}.panel-grid .g-col-xxl-11{grid-column:auto/span 11}.panel-grid .g-col-xxl-12{grid-column:auto/span 12}.panel-grid .g-col-xxl-13{grid-column:auto/span 13}.panel-grid .g-col-xxl-14{grid-column:auto/span 14}.panel-grid .g-col-xxl-15{grid-column:auto/span 15}.panel-grid .g-col-xxl-16{grid-column:auto/span 16}.panel-grid .g-col-xxl-17{grid-column:auto/span 17}.panel-grid .g-col-xxl-18{grid-column:auto/span 18}.panel-grid .g-col-xxl-19{grid-column:auto/span 19}.panel-grid .g-col-xxl-20{grid-column:auto/span 20}.panel-grid .g-col-xxl-21{grid-column:auto/span 21}.panel-grid .g-col-xxl-22{grid-column:auto/span 22}.panel-grid .g-col-xxl-23{grid-column:auto/span 23}.panel-grid .g-col-xxl-24{grid-column:auto/span 24}.panel-grid .g-start-xxl-1{grid-column-start:1}.panel-grid .g-start-xxl-2{grid-column-start:2}.panel-grid .g-start-xxl-3{grid-column-start:3}.panel-grid .g-start-xxl-4{grid-column-start:4}.panel-grid .g-start-xxl-5{grid-column-start:5}.panel-grid .g-start-xxl-6{grid-column-start:6}.panel-grid .g-start-xxl-7{grid-column-start:7}.panel-grid .g-start-xxl-8{grid-column-start:8}.panel-grid .g-start-xxl-9{grid-column-start:9}.panel-grid .g-start-xxl-10{grid-column-start:10}.panel-grid .g-start-xxl-11{grid-column-start:11}.panel-grid .g-start-xxl-12{grid-column-start:12}.panel-grid .g-start-xxl-13{grid-column-start:13}.panel-grid .g-start-xxl-14{grid-column-start:14}.panel-grid .g-start-xxl-15{grid-column-start:15}.panel-grid .g-start-xxl-16{grid-column-start:16}.panel-grid .g-start-xxl-17{grid-column-start:17}.panel-grid .g-start-xxl-18{grid-column-start:18}.panel-grid .g-start-xxl-19{grid-column-start:19}.panel-grid .g-start-xxl-20{grid-column-start:20}.panel-grid .g-start-xxl-21{grid-column-start:21}.panel-grid .g-start-xxl-22{grid-column-start:22}.panel-grid .g-start-xxl-23{grid-column-start:23}}main{margin-top:1em;margin-bottom:1em}h1,.h1,h2,.h2{opacity:.9;margin-top:2rem;margin-bottom:1rem;font-weight:600}h1.title,.title.h1{margin-top:0}h2,.h2{border-bottom:1px solid #dee2e6;padding-bottom:.5rem}h3,.h3{font-weight:600}h3,.h3,h4,.h4{opacity:.9;margin-top:1.5rem}h5,.h5,h6,.h6{opacity:.9}.header-section-number{color:#7f8177}.nav-link.active .header-section-number{color:inherit}mark,.mark{padding:0em}.panel-caption,caption,.figure-caption{font-size:.9rem}.panel-caption,.figure-caption,figcaption{color:#7f8177}.table-caption,caption{color:#3e3f3a}.quarto-layout-cell[data-ref-parent] caption{color:#7f8177}.column-margin figcaption,.margin-caption,div.aside,aside,.column-margin{color:#7f8177;font-size:.825rem}.panel-caption.margin-caption{text-align:inherit}.column-margin.column-container p{margin-bottom:0}.column-margin.column-container>*:not(.collapse){padding-top:.5em;padding-bottom:.5em;display:block}.column-margin.column-container>*.collapse:not(.show){display:none}@media(min-width: 768px){.column-margin.column-container .callout-margin-content:first-child{margin-top:4.5em}.column-margin.column-container .callout-margin-content-simple:first-child{margin-top:3.5em}}.margin-caption>*{padding-top:.5em;padding-bottom:.5em}@media(max-width: 767.98px){.quarto-layout-row{flex-direction:column}}.nav-tabs .nav-item{margin-top:1px;cursor:pointer}.tab-content{margin-top:0px;border-left:#dee2e6 1px solid;border-right:#dee2e6 1px solid;border-bottom:#dee2e6 1px solid;margin-left:0;padding:1em;margin-bottom:1em}@media(max-width: 767.98px){.layout-sidebar{margin-left:0;margin-right:0}}.panel-sidebar,.panel-sidebar .form-control,.panel-input,.panel-input .form-control,.selectize-dropdown{font-size:.9rem}.panel-sidebar .form-control,.panel-input .form-control{padding-top:.1rem}.tab-pane div.sourceCode{margin-top:0px}.tab-pane>p{padding-top:1em}.tab-content>.tab-pane:not(.active){display:none !important}div.sourceCode{background-color:#f8f5f0;border:1px solid #f8f5f0;border-radius:.25rem}pre.sourceCode{background-color:rgba(0,0,0,0)}pre.sourceCode{border:none;font-size:.875em;overflow:visible !important;padding:.4em}.callout pre.sourceCode{padding-left:0}div.sourceCode{overflow-y:hidden}.callout div.sourceCode{margin-left:initial}.blockquote{font-size:inherit;padding-left:1rem;padding-right:1.5rem;color:#7f8177}.blockquote h1:first-child,.blockquote .h1:first-child,.blockquote h2:first-child,.blockquote .h2:first-child,.blockquote h3:first-child,.blockquote .h3:first-child,.blockquote h4:first-child,.blockquote .h4:first-child,.blockquote h5:first-child,.blockquote .h5:first-child{margin-top:0}pre{background-color:initial;padding:initial;border:initial}p code:not(.sourceCode),li code:not(.sourceCode),td code:not(.sourceCode){background-color:#f8f5f0;padding:.2em}nav p code:not(.sourceCode),nav li code:not(.sourceCode),nav td code:not(.sourceCode){background-color:rgba(0,0,0,0);padding:0}td code:not(.sourceCode){white-space:pre-wrap}#quarto-embedded-source-code-modal>.modal-dialog{max-width:1000px;padding-left:1.75rem;padding-right:1.75rem}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body{padding:0}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body div.sourceCode{margin:0;padding:.2rem .2rem;border-radius:0px;border:none}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-header{padding:.7rem}.code-tools-button{font-size:1rem;padding:.15rem .15rem;margin-left:5px;color:#6c757d;background-color:rgba(0,0,0,0);transition:initial;cursor:pointer}.code-tools-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}.code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}.sidebar{will-change:top;transition:top 200ms linear;position:sticky;overflow-y:auto;padding-top:1.2em;max-height:100vh}.sidebar.toc-left,.sidebar.margin-sidebar{top:0px;padding-top:1em}.sidebar.toc-left>*,.sidebar.margin-sidebar>*{padding-top:.5em}.sidebar.quarto-banner-title-block-sidebar>*{padding-top:1.65em}figure .quarto-notebook-link{margin-top:.5em}.quarto-notebook-link{font-size:.75em;color:#6c757d;margin-bottom:1em;text-decoration:none;display:block}.quarto-notebook-link:hover{text-decoration:underline;color:#93c54b}.quarto-notebook-link::before{display:inline-block;height:.75rem;width:.75rem;margin-bottom:0em;margin-right:.25em;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:.75rem .75rem}.quarto-alternate-notebooks i.bi,.quarto-alternate-formats i.bi{margin-right:.4em}.quarto-notebook .cell-container{display:flex}.quarto-notebook .cell-container .cell{flex-grow:4}.quarto-notebook .cell-container .cell-decorator{padding-top:1.5em;padding-right:1em;text-align:right}.quarto-notebook h2,.quarto-notebook .h2{border-bottom:none}.sidebar .quarto-alternate-formats a,.sidebar .quarto-alternate-notebooks a{text-decoration:none}.sidebar .quarto-alternate-formats a:hover,.sidebar .quarto-alternate-notebooks a:hover{color:#93c54b}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2,.sidebar nav[role=doc-toc]>h2,.sidebar nav[role=doc-toc]>.h2{font-size:.875rem;font-weight:400;margin-bottom:.5rem;margin-top:.3rem;font-family:inherit;border-bottom:0;padding-bottom:0;padding-top:0px}.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2{margin-top:1rem}.sidebar nav[role=doc-toc]>ul a{border-left:1px solid #f8f5f0;padding-left:.6rem}.sidebar .quarto-alternate-notebooks h2>ul a,.sidebar .quarto-alternate-notebooks .h2>ul a,.sidebar .quarto-alternate-formats h2>ul a,.sidebar .quarto-alternate-formats .h2>ul a{border-left:none;padding-left:.6rem}.sidebar .quarto-alternate-notebooks ul a:empty,.sidebar .quarto-alternate-formats ul a:empty,.sidebar nav[role=doc-toc]>ul a:empty{display:none}.sidebar .quarto-alternate-notebooks ul,.sidebar .quarto-alternate-formats ul,.sidebar nav[role=doc-toc] ul{padding-left:0;list-style:none;font-size:.875rem;font-weight:300}.sidebar .quarto-alternate-notebooks ul li a,.sidebar .quarto-alternate-formats ul li a,.sidebar nav[role=doc-toc]>ul li a{line-height:1.1rem;padding-bottom:.2rem;padding-top:.2rem;color:inherit}.sidebar nav[role=doc-toc] ul>li>ul>li>a{padding-left:1.2em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>a{padding-left:2.4em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>a{padding-left:3.6em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:4.8em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:6em}.sidebar nav[role=doc-toc] ul>li>a.active,.sidebar nav[role=doc-toc] ul>li>ul>li>a.active{border-left:1px solid #93c54b;color:#93c54b !important}.sidebar nav[role=doc-toc] ul>li>a:hover,.sidebar nav[role=doc-toc] ul>li>ul>li>a:hover{color:#93c54b !important}kbd,.kbd{color:#3e3f3a;background-color:#f8f9fa;border:1px solid;border-radius:5px;border-color:#dee2e6}div.hanging-indent{margin-left:1em;text-indent:-1em}.citation a,.footnote-ref{text-decoration:none}.footnotes ol{padding-left:1em}.tippy-content>*{margin-bottom:.7em}.tippy-content>*:last-child{margin-bottom:0}.table a{word-break:break-word}.table>thead{border-top-width:1px;border-top-color:#dee2e6;border-bottom:1px solid #bebfb9}.callout{margin-top:1.25rem;margin-bottom:1.25rem;border-radius:.25rem;overflow-wrap:break-word}.callout .callout-title-container{overflow-wrap:anywhere}.callout.callout-style-simple{padding:.4em .7em;border-left:5px solid;border-right:1px solid #dee2e6;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.callout.callout-style-default{border-left:5px solid;border-right:1px solid #dee2e6;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.callout .callout-body-container{flex-grow:1}.callout.callout-style-simple .callout-body{font-size:.9rem;font-weight:400}.callout.callout-style-default .callout-body{font-size:.9rem;font-weight:400}.callout.callout-titled .callout-body{margin-top:.2em}.callout:not(.no-icon).callout-titled.callout-style-simple .callout-body{padding-left:1.6em}.callout.callout-titled>.callout-header{padding-top:.2em;margin-bottom:-0.2em}.callout.callout-style-simple>div.callout-header{border-bottom:none;font-size:.9rem;font-weight:600;opacity:75%}.callout.callout-style-default>div.callout-header{border-bottom:none;font-weight:600;opacity:85%;font-size:.9rem;padding-left:.5em;padding-right:.5em}.callout.callout-style-default div.callout-body{padding-left:.5em;padding-right:.5em}.callout.callout-style-default div.callout-body>:first-child{margin-top:.5em}.callout>div.callout-header[data-bs-toggle=collapse]{cursor:pointer}.callout.callout-style-default .callout-header[aria-expanded=false],.callout.callout-style-default .callout-header[aria-expanded=true]{padding-top:0px;margin-bottom:0px;align-items:center}.callout.callout-titled .callout-body>:last-child:not(.sourceCode),.callout.callout-titled .callout-body>div>:last-child:not(.sourceCode){margin-bottom:.5rem}.callout:not(.callout-titled) .callout-body>:first-child,.callout:not(.callout-titled) .callout-body>div>:first-child{margin-top:.25rem}.callout:not(.callout-titled) .callout-body>:last-child,.callout:not(.callout-titled) .callout-body>div>:last-child{margin-bottom:.2rem}.callout.callout-style-simple .callout-icon::before,.callout.callout-style-simple .callout-toggle::before{height:1rem;width:1rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.callout.callout-style-default .callout-icon::before,.callout.callout-style-default .callout-toggle::before{height:.9rem;width:.9rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:.9rem .9rem}.callout.callout-style-default .callout-toggle::before{margin-top:5px}.callout .callout-btn-toggle .callout-toggle::before{transition:transform .2s linear}.callout .callout-header[aria-expanded=false] .callout-toggle::before{transform:rotate(-90deg)}.callout .callout-header[aria-expanded=true] .callout-toggle::before{transform:none}.callout.callout-style-simple:not(.no-icon) div.callout-icon-container{padding-top:.2em;padding-right:.55em}.callout.callout-style-default:not(.no-icon) div.callout-icon-container{padding-top:.1em;padding-right:.35em}.callout.callout-style-default:not(.no-icon) div.callout-title-container{margin-top:-1px}.callout.callout-style-default.callout-caution:not(.no-icon) div.callout-icon-container{padding-top:.3em;padding-right:.35em}.callout>.callout-body>.callout-icon-container>.no-icon,.callout>.callout-header>.callout-icon-container>.no-icon{display:none}div.callout.callout{border-left-color:#6c757d}div.callout.callout-style-default>.callout-header{background-color:#6c757d}div.callout-note.callout{border-left-color:#325d88}div.callout-note.callout-style-default>.callout-header{background-color:#ebeff3}div.callout-note:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-tip.callout{border-left-color:#93c54b}div.callout-tip.callout-style-default>.callout-header{background-color:#f4f9ed}div.callout-tip:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-warning.callout{border-left-color:#ffc107}div.callout-warning.callout-style-default>.callout-header{background-color:#fff9e6}div.callout-warning:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-caution.callout{border-left-color:#f47c3c}div.callout-caution.callout-style-default>.callout-header{background-color:#fef2ec}div.callout-caution:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-important.callout{border-left-color:#d9534f}div.callout-important.callout-style-default>.callout-header{background-color:#fbeeed}div.callout-important:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important .callout-toggle::before{background-image:url('data:image/svg+xml,')}.quarto-toggle-container{display:flex;align-items:center}.quarto-reader-toggle .bi::before,.quarto-color-scheme-toggle .bi::before{display:inline-block;height:1rem;width:1rem;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.sidebar-navigation{padding-left:20px}.navbar .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.navbar .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.quarto-sidebar-toggle{border-color:#dee2e6;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem;border-style:solid;border-width:1px;overflow:hidden;border-top-width:0px;padding-top:0px !important}.quarto-sidebar-toggle-title{cursor:pointer;padding-bottom:2px;margin-left:.25em;text-align:center;font-weight:400;font-size:.775em}#quarto-content .quarto-sidebar-toggle{background:#fafafa}#quarto-content .quarto-sidebar-toggle-title{color:#3e3f3a}.quarto-sidebar-toggle-icon{color:#dee2e6;margin-right:.5em;float:right;transition:transform .2s ease}.quarto-sidebar-toggle-icon::before{padding-top:5px}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-icon{transform:rotate(-180deg)}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-title{border-bottom:solid #dee2e6 1px}.quarto-sidebar-toggle-contents{background-color:#fff;padding-right:10px;padding-left:10px;margin-top:0px !important;transition:max-height .5s ease}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-contents{padding-top:1em;padding-bottom:10px}.quarto-sidebar-toggle:not(.expanded) .quarto-sidebar-toggle-contents{padding-top:0px !important;padding-bottom:0px}nav[role=doc-toc]{z-index:1020}#quarto-sidebar>*,nav[role=doc-toc]>*{transition:opacity .1s ease,border .1s ease}#quarto-sidebar.slow>*,nav[role=doc-toc].slow>*{transition:opacity .4s ease,border .4s ease}.quarto-color-scheme-toggle:not(.alternate).top-right .bi::before{background-image:url('data:image/svg+xml,')}.quarto-color-scheme-toggle.alternate.top-right .bi::before{background-image:url('data:image/svg+xml,')}#quarto-appendix.default{border-top:1px solid #dee2e6}#quarto-appendix.default{background-color:#fff;padding-top:1.5em;margin-top:2em;z-index:998}#quarto-appendix.default .quarto-appendix-heading{margin-top:0;line-height:1.4em;font-weight:600;opacity:.9;border-bottom:none;margin-bottom:0}#quarto-appendix.default .footnotes ol,#quarto-appendix.default .footnotes ol li>p:last-of-type,#quarto-appendix.default .quarto-appendix-contents>p:last-of-type{margin-bottom:0}#quarto-appendix.default .quarto-appendix-secondary-label{margin-bottom:.4em}#quarto-appendix.default .quarto-appendix-bibtex{font-size:.7em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-bibtex code.sourceCode{white-space:pre-wrap}#quarto-appendix.default .quarto-appendix-citeas{font-size:.9em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-heading{font-size:1em !important}#quarto-appendix.default *[role=doc-endnotes]>ol,#quarto-appendix.default .quarto-appendix-contents>*:not(h2):not(.h2){font-size:.9em}#quarto-appendix.default section{padding-bottom:1.5em}#quarto-appendix.default section *[role=doc-endnotes],#quarto-appendix.default section>*:not(a){opacity:.9;word-wrap:break-word}.btn.btn-quarto,div.cell-output-display .btn-quarto{color:#fefefe;background-color:#6c757d;border-color:#6c757d}.btn.btn-quarto:hover,div.cell-output-display .btn-quarto:hover{color:#fefefe;background-color:#828a91;border-color:#7b838a}.btn-check:focus+.btn.btn-quarto,.btn.btn-quarto:focus,.btn-check:focus+div.cell-output-display .btn-quarto,div.cell-output-display .btn-quarto:focus{color:#fefefe;background-color:#828a91;border-color:#7b838a;box-shadow:0 0 0 .25rem rgba(130,138,144,.5)}.btn-check:checked+.btn.btn-quarto,.btn-check:active+.btn.btn-quarto,.btn.btn-quarto:active,.btn.btn-quarto.active,.show>.btn.btn-quarto.dropdown-toggle,.btn-check:checked+div.cell-output-display .btn-quarto,.btn-check:active+div.cell-output-display .btn-quarto,div.cell-output-display .btn-quarto:active,div.cell-output-display .btn-quarto.active,.show>div.cell-output-display .btn-quarto.dropdown-toggle{color:#fff;background-color:#899197;border-color:#7b838a}.btn-check:checked+.btn.btn-quarto:focus,.btn-check:active+.btn.btn-quarto:focus,.btn.btn-quarto:active:focus,.btn.btn-quarto.active:focus,.show>.btn.btn-quarto.dropdown-toggle:focus,.btn-check:checked+div.cell-output-display .btn-quarto:focus,.btn-check:active+div.cell-output-display .btn-quarto:focus,div.cell-output-display .btn-quarto:active:focus,div.cell-output-display .btn-quarto.active:focus,.show>div.cell-output-display .btn-quarto.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(130,138,144,.5)}.btn.btn-quarto:disabled,.btn.btn-quarto.disabled,div.cell-output-display .btn-quarto:disabled,div.cell-output-display .btn-quarto.disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}nav.quarto-secondary-nav.color-navbar{background-color:#325d88;color:rgba(255,255,255,.7)}nav.quarto-secondary-nav.color-navbar h1,nav.quarto-secondary-nav.color-navbar .h1,nav.quarto-secondary-nav.color-navbar .quarto-btn-toggle{color:rgba(255,255,255,.7)}@media(max-width: 991.98px){body.nav-sidebar .quarto-title-banner{margin-bottom:0;padding-bottom:0}body.nav-sidebar #title-block-header{margin-block-end:0}}p.subtitle{margin-top:.25em;margin-bottom:.5em}code a:any-link{color:inherit;text-decoration-color:#6c757d}/*! light */div.observablehq table thead tr th{background-color:var(--bs-body-bg)}input,button,select,optgroup,textarea{background-color:var(--bs-body-bg)}.code-annotated .code-copy-button{margin-right:1.25em;margin-top:0;padding-bottom:0;padding-top:3px}.code-annotation-gutter-bg{background-color:#fff}.code-annotation-gutter{background-color:#f8f5f0}.code-annotation-gutter,.code-annotation-gutter-bg{height:100%;width:calc(20px + .5em);position:absolute;top:0;right:0}dl.code-annotation-container-grid dt{margin-right:1em;margin-top:.25rem}dl.code-annotation-container-grid dt{font-family:var(--bs-font-monospace);color:#585a52;border:solid #585a52 1px;border-radius:50%;height:22px;width:22px;line-height:22px;font-size:11px;text-align:center;vertical-align:middle;text-decoration:none}dl.code-annotation-container-grid dt[data-target-cell]{cursor:pointer}dl.code-annotation-container-grid dt[data-target-cell].code-annotation-active{color:#fff;border:solid #aaa 1px;background-color:#aaa}pre.code-annotation-code{padding-top:0;padding-bottom:0}pre.code-annotation-code code{z-index:3}#code-annotation-line-highlight-gutter{width:100%;border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}#code-annotation-line-highlight{margin-left:-4em;width:calc(100% + 4em);border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}code.sourceCode .code-annotation-anchor.code-annotation-active{background-color:var(--quarto-hl-normal-color, #aaaaaa);border:solid var(--quarto-hl-normal-color, #aaaaaa) 1px;color:#f8f5f0;font-weight:bolder}code.sourceCode .code-annotation-anchor{font-family:var(--bs-font-monospace);color:var(--quarto-hl-co-color);border:solid var(--quarto-hl-co-color) 1px;border-radius:50%;height:18px;width:18px;font-size:9px;margin-top:2px}code.sourceCode button.code-annotation-anchor{padding:2px}code.sourceCode a.code-annotation-anchor{line-height:18px;text-align:center;vertical-align:middle;cursor:default;text-decoration:none}@media print{.page-columns .column-screen-inset{grid-column:page-start-inset/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset table{background:#fff}.page-columns .column-screen-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-left table{background:#fff}.page-columns .column-screen-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-inset-right table{background:#fff}.page-columns .column-screen{grid-column:page-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen table{background:#fff}.page-columns .column-screen-left{grid-column:page-start/body-content-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-left table{background:#fff}.page-columns .column-screen-right{grid-column:body-content-start/page-end;z-index:998;transform:translate3d(0, 0, 0)}.page-columns .column-screen-right table{background:#fff}.page-columns .column-screen-inset-shaded{grid-column:page-start-inset/page-end-inset;padding:1em;background:#f8f5f0;z-index:998;transform:translate3d(0, 0, 0);margin-bottom:1em}}.quarto-video{margin-bottom:1em}.table>thead{border-top-width:0}.table>:not(caption)>*:not(:last-child)>*{border-bottom-color:#eff0ee;border-bottom-style:solid;border-bottom-width:1px}.table>:not(:first-child){border-top:1px solid #bebfb9;border-bottom:1px solid inherit}.table tbody{border-bottom-color:#bebfb9}a.external:after{display:inline-block;height:.75rem;width:.75rem;margin-bottom:.15em;margin-left:.25em;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:.75rem .75rem}div.sourceCode code a.external:after{content:none}a.external:after:hover{cursor:pointer}.quarto-ext-icon{display:inline-block;font-size:.75em;padding-left:.3em}.code-with-filename .code-with-filename-file{margin-bottom:0;padding-bottom:2px;padding-top:2px;padding-left:.7em;border:var(--quarto-border-width) solid var(--quarto-border-color);border-radius:var(--quarto-border-radius);border-bottom:0;border-bottom-left-radius:0%;border-bottom-right-radius:0%}.code-with-filename div.sourceCode,.reveal .code-with-filename div.sourceCode{margin-top:0;border-top-left-radius:0%;border-top-right-radius:0%}.code-with-filename .code-with-filename-file pre{margin-bottom:0}.code-with-filename .code-with-filename-file,.code-with-filename .code-with-filename-file pre{background-color:rgba(219,219,219,.8)}.quarto-dark .code-with-filename .code-with-filename-file,.quarto-dark .code-with-filename .code-with-filename-file pre{background-color:#555}.code-with-filename .code-with-filename-file strong{font-weight:400}.quarto-title-banner{margin-bottom:1em;color:rgba(255,255,255,.7);background:#325d88}.quarto-title-banner .code-tools-button{color:rgba(204,204,204,.7)}.quarto-title-banner .code-tools-button:hover{color:rgba(255,255,255,.7)}.quarto-title-banner .code-tools-button>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .quarto-title .title{font-weight:600}.quarto-title-banner .quarto-categories{margin-top:.75em}@media(min-width: 992px){.quarto-title-banner{padding-top:2.5em;padding-bottom:2.5em}}@media(max-width: 991.98px){.quarto-title-banner{padding-top:1em;padding-bottom:1em}}main.quarto-banner-title-block>section:first-child>h2,main.quarto-banner-title-block>section:first-child>.h2,main.quarto-banner-title-block>section:first-child>h3,main.quarto-banner-title-block>section:first-child>.h3,main.quarto-banner-title-block>section:first-child>h4,main.quarto-banner-title-block>section:first-child>.h4{margin-top:0}.quarto-title .quarto-categories{display:flex;flex-wrap:wrap;row-gap:.5em;column-gap:.4em;padding-bottom:.5em;margin-top:.75em}.quarto-title .quarto-categories .quarto-category{padding:.25em .75em;font-size:.65em;text-transform:uppercase;border:solid 1px;border-radius:.25rem;opacity:.6}.quarto-title .quarto-categories .quarto-category a{color:inherit}#title-block-header.quarto-title-block.default .quarto-title-meta{display:grid;grid-template-columns:repeat(2, 1fr)}#title-block-header.quarto-title-block.default .quarto-title .title{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-author-orcid img{margin-top:-5px}#title-block-header.quarto-title-block.default .quarto-description p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p,#title-block-header.quarto-title-block.default .quarto-title-authors p,#title-block-header.quarto-title-block.default .quarto-title-affiliations p{margin-bottom:.1em}#title-block-header.quarto-title-block.default .quarto-title-meta-heading{text-transform:uppercase;margin-top:1em;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-contents{font-size:.9em}#title-block-header.quarto-title-block.default .quarto-title-meta-contents a{color:#3e3f3a}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p.affiliation:last-of-type{margin-bottom:.7em}#title-block-header.quarto-title-block.default p.affiliation{margin-bottom:.1em}#title-block-header.quarto-title-block.default .description,#title-block-header.quarto-title-block.default .abstract{margin-top:0}#title-block-header.quarto-title-block.default .description>p,#title-block-header.quarto-title-block.default .abstract>p{font-size:.9em}#title-block-header.quarto-title-block.default .description>p:last-of-type,#title-block-header.quarto-title-block.default .abstract>p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .description .abstract-title,#title-block-header.quarto-title-block.default .abstract .abstract-title{margin-top:1em;text-transform:uppercase;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-author{display:grid;grid-template-columns:1fr 1fr}.quarto-title-tools-only{display:flex;justify-content:right}.bg-primary{background-color:#3e3f3a !important}.bg-dark{background-color:#6c757d !important}.bg-light{background-color:#f8f5f0 !important}.sandstone,.tooltip,.dropdown-menu .dropdown-item,.pagination,.breadcrumb,.nav-pills .nav-link,.nav-tabs .nav-link,.btn,.navbar .nav-link{font-size:13px;line-height:22px;font-weight:500;text-transform:uppercase}.navbar-form input,.navbar-form .form-control{border:none}.btn:hover{border-color:rgba(0,0,0,0)}.btn-success,.btn-warning{color:#fff}.table .thead-dark th{background-color:#3e3f3a}.nav-tabs .nav-link{background-color:#f8f5f0;border-color:#dee2e6}.nav-tabs .nav-link,.nav-tabs .nav-link:hover,.nav-tabs .nav-link:focus{color:#6c757d}.nav-tabs .nav-link.disabled,.nav-tabs .nav-link.disabled:hover,.nav-tabs .nav-link.disabled:focus{background-color:#f8f5f0;border-color:#dee2e6;color:#dee2e6}.nav-pills .nav-link{border:1px solid rgba(0,0,0,0);color:#6c757d}.nav-pills .nav-link.active,.nav-pills .nav-link:hover,.nav-pills .nav-link:focus{background-color:#f8f5f0;border-color:#dee2e6}.nav-pills .nav-link.disabled,.nav-pills .nav-link.disabled:hover{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0);color:#dee2e6}.breadcrumb{border:1px solid #dee2e6}.pagination a:hover{text-decoration:none}.alert{color:#fff}.alert a,.alert .alert-link{color:#fff;text-decoration:underline}.alert-primary,.alert-primary>th,.alert-primary>td{background-color:#325d88}.alert-secondary,.alert-secondary>th,.alert-secondary>td{background-color:#6c757d}.alert-success,.alert-success>th,.alert-success>td{background-color:#93c54b}.alert-info,.alert-info>th,.alert-info>td{background-color:#29abe0}.alert-danger,.alert-danger>th,.alert-danger>td{background-color:#d9534f}.alert-warning,.alert-warning>th,.alert-warning>td{background-color:#f47c3c}.alert-dark,.alert-dark>th,.alert-dark>td{background-color:#3e3f3a}.alert-light,.alert-light>th,.alert-light>td{background-color:#f8f5f0}.alert-light,.alert-light a:not(.btn),.alert-light .alert-link{color:#3e3f3a}.badge.bg-light{color:#3e3f3a}.modal .btn-close,.toast .btn-close{background-image:url("data:image/svg+xml,")}/*# sourceMappingURL=d6b77e37a12f878a50f9f8a85e535bdc.css.map */ diff --git a/sitemap.xml b/sitemap.xml index d60cec1..88a53da 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,86 +2,86 @@ https://RePsychLing.github.io/SMLP2023/useful_packages.html - 2023-09-11T14:03:56.559Z + 2023-09-11T16:00:31.209Z https://RePsychLing.github.io/SMLP2023/sleepstudy.html - 2023-09-11T14:03:54.971Z + 2023-09-11T16:00:29.344Z https://RePsychLing.github.io/SMLP2023/selection.html - 2023-09-11T14:03:52.775Z + 2023-09-11T16:00:26.966Z https://RePsychLing.github.io/SMLP2023/pkg.html - 2023-09-11T14:03:51.507Z + 2023-09-11T16:00:25.491Z https://RePsychLing.github.io/SMLP2023/kwdyz11.html - 2023-09-11T14:03:47.487Z + 2023-09-11T16:00:21.111Z https://RePsychLing.github.io/SMLP2023/kb07.html - 2023-09-11T14:03:44.479Z + 2023-09-11T16:00:17.873Z https://RePsychLing.github.io/SMLP2023/glmm.html - 2023-09-11T14:03:43.104Z + 2023-09-11T16:00:16.309Z https://RePsychLing.github.io/SMLP2023/contrasts_kwdyz11.html - 2023-09-11T14:03:34.832Z + 2023-09-11T16:00:07.532Z https://RePsychLing.github.io/SMLP2023/check_emotikon_transform.html - 2023-09-11T14:03:27.636Z + 2023-09-11T15:59:59.768Z https://RePsychLing.github.io/SMLP2023/arrow.html - 2023-09-11T14:03:25.492Z + 2023-09-11T15:59:57.617Z https://RePsychLing.github.io/SMLP2023/about.html - 2023-09-11T14:03:21.484Z + 2023-09-11T15:59:53.345Z https://RePsychLing.github.io/SMLP2023/AoGPlots.html - 2023-09-11T14:03:22.592Z + 2023-09-11T15:59:54.477Z https://RePsychLing.github.io/SMLP2023/bootstrap.html - 2023-09-11T14:03:26.736Z + 2023-09-11T15:59:58.841Z https://RePsychLing.github.io/SMLP2023/contrasts_fggk21.html - 2023-09-11T14:03:33.252Z + 2023-09-11T16:00:05.925Z https://RePsychLing.github.io/SMLP2023/fggk21.html - 2023-09-11T14:03:41.364Z + 2023-09-11T16:00:14.473Z https://RePsychLing.github.io/SMLP2023/index.html - 2023-09-11T14:03:43.632Z + 2023-09-11T16:00:16.921Z https://RePsychLing.github.io/SMLP2023/kkl15.html - 2023-09-11T14:03:46.199Z + 2023-09-11T16:00:19.751Z https://RePsychLing.github.io/SMLP2023/largescaledesigned.html - 2023-09-11T14:03:51.063Z + 2023-09-11T16:00:25.016Z https://RePsychLing.github.io/SMLP2023/profiling.html - 2023-09-11T14:03:52.279Z + 2023-09-11T16:00:26.371Z https://RePsychLing.github.io/SMLP2023/shrinkageplot.html - 2023-09-11T14:03:53.983Z + 2023-09-11T16:00:28.271Z https://RePsychLing.github.io/SMLP2023/sleepstudy_speed.html - 2023-09-11T14:03:56.011Z + 2023-09-11T16:00:30.532Z diff --git a/sleepstudy.html b/sleepstudy.html index 907f071..1985004 100644 --- a/sleepstudy.html +++ b/sleepstudy.html @@ -398,7 +398,7 @@

    Analysis of the sleepstudy data

    1 Loading the data

    First attach the MixedModels package and other packages for plotting. The CairoMakie package allows the Makie graphics system (Danisch & Krumbiegel, 2021) to generate high quality static images. Activate that package with the SVG (Scalable Vector Graphics) backend.

    -
    +
    Code
    using CairoMakie       # graphics back-end
    @@ -417,7 +417,7 @@ 

    1 Loading the dat

    The sleepstudy data are one of the datasets available with the MixedModels package. It is re-exported by the SMLP2023 package’s dataset function.

    -
    +
    sleepstudy = dataset("sleepstudy")
    Arrow.Table with 180 rows, 3 columns, and schema:
    @@ -427,7 +427,7 @@ 

    1 Loading the dat

    Figure 1 displays the data in a multi-panel plot created with the lattice package in R (Sarkar, 2008), using RCall.jl.

    -
    +
    Code
    RCall.ijulia_setdevice(MIME("image/svg+xml"); width=10, height=4.5)
    @@ -458,14 +458,11 @@ 

    1 Loading the dat

    2 Fitting an initial model

    -
    +
    contrasts = Dict{Symbol,Any}(:subj => Grouping())
     m1 = let f = @formula(reaction ~ 1 + days + (1 + days | subj))
       fit(MixedModel, f, sleepstudy; contrasts)
     end
    -
    -
    Minimizing 57    Time: 0:00:00 ( 4.14 ms/it)
    -

    1131.284130.126 2928637.128695.128854.328696.128638.028696.028855.228697.0
    2
    @@ -510,8 +507,8 @@

    2 Fitting an init

    This model includes fixed effects for the intercept, representing the typical reaction time at the beginning of the experiment with zero days of sleep deprivation, and the slope w.r.t. days of sleep deprivation. The parameter estimates are about 250 ms. typical reaction time without deprivation and a typical increase of 10.5 ms. per day of sleep deprivation.

    The random effects represent shifts from the typical behavior for each subject. The shift in the intercept has a standard deviation of about 24 ms. which would suggest a range of about 200 ms. to 300 ms. in the intercepts. Similarly within-subject slopes would be expected to have a range of about 0 ms./day up to 20 ms./day.

    The random effects for the slope and for the intercept are allowed to be correlated within subject. The estimated correlation, 0.08, is small. This estimate is not shown in the default display above but is shown in the output from VarCorr (variance components and correlations).

    -
    -
    VarCorr(m1)
    +
    +
    VarCorr(m1)

    @@ -527,7 +524,7 @@

    2 Fitting an init

    - + @@ -551,10 +548,10 @@

    2 Fitting an init

    Technically, the random effects for each subject are unobserved random variables and are not “parameters” in the model per se. Hence we do not report standard errors or confidence intervals for these deviations. However, we can produce prediction intervals on the random effects for each subject. Because the experimental design is balanced, these intervals will have the same width for all subjects.

    A plot of the prediction intervals versus the level of the grouping factor (subj, in this case) is sometimes called a caterpillar plot because it can look like a fuzzy caterpillar if there are many levels of the grouping factor. By default, the levels of the grouping factor are sorted by increasing value of the first random effect.

    -
    +
    Code -
    caterpillar(m1; vline_at_zero=true)
    +
    caterpillar(m1)
    @@ -570,7 +567,7 @@

    2 Fitting an init

    3 A model with uncorrelated random effects

    The zerocorr function applied to a random-effects term creates uncorrelated vector-valued per-subject random effects.

    -
    +
    m2 = let f = @formula reaction ~ 1 + days + zerocorr(1 + days | subj)
       fit(MixedModel, f, sleepstudy; contrasts)
     end
    @@ -616,8 +613,8 @@

    3 A model with un

    Again, the default display doesn’t show that there is no correlation parameter to be estimated in this model, but the VarCorr display does.

    -
    -
    VarCorr(m2)
    +
    +
    VarCorr(m2)

    subj (Intercept)565.51066565.51068 23.78047
    @@ -656,8 +653,8 @@

    3 A model with un

    This model has a slightly lower log-likelihood than does m1 and one fewer parameter than m1. A likelihood-ratio test can be used to compare these nested models.

    -
    -
    MixedModels.likelihoodratiotest(m2, m1)
    +
    +
    MixedModels.likelihoodratiotest(m2, m1)

    @@ -700,19 +697,19 @@

    3 A model with un

    Alternatively, the AIC or BIC values can be compared.

    -
    +
    Code -
    let mods = [m2, m1]
    -  Table(;
    -    model=[:m2, :m1],
    -    pars=dof.(mods),
    -    geomdof=(sum  leverage).(mods),
    -    AIC=aic.(mods),
    -    BIC=bic.(mods),
    -    AICc=aicc.(mods),
    -  )
    -end
    +
    let mods = [m2, m1]
    +  Table(;
    +    model=[:m2, :m1],
    +    pars=dof.(mods),
    +    geomdof=(sum  leverage).(mods),
    +    AIC=aic.(mods),
    +    BIC=bic.(mods),
    +    AICc=aicc.(mods),
    +  )
    +end
    Table with 6 columns and 2 rows:
    @@ -746,10 +743,10 @@ 

    3 A model with un

    4 Some diagnostic plots

    In mixed-effects models the linear predictor expression incorporates fixed-effects parameters, which summarize trends for the population or certain well-defined subpopulations, and random effects which represent deviations associated with the experimental units or observational units - individual subjects, in this case. The random effects are modeled as unobserved random variables.

    The conditional means of these random variables, sometimes called the BLUPs or Best Linear Unbiased Predictors, are not simply the least squares estimates. They are attenuated or shrunk towards zero to reflect the fact that the individuals are assumed to come from a population. A shrinkage plot, Figure 3, shows the BLUPs from the model fit compared to the values without any shrinkage. If the BLUPs are similar to the unshrunk values then the more complicated model accounting for individual differences is supported. If the BLUPs are strongly shrunk towards zero then the additional complexity in the model to account for individual differences is not providing sufficient increase in fidelity to the data to warrant inclusion.

    -
    +
    Code -
    shrinkageplot!(Figure(; resolution=(500, 500)), m1)
    +
    shrinkageplot!(Figure(; resolution=(500, 500)), m1)
    @@ -781,55 +778,55 @@

    4 Some diagnostic

    5 Assessing variability by bootstrapping

    The speed of fitting linear mixed-effects models using MixedModels.jl allows for using simulation-based approaches to inference instead of relying on approximate standard errors. A parametric bootstrap sample for model m is a collection of models of the same form as m fit to data values simulated from m. That is, we pretend that m and its parameter values are the true parameter values, simulate data from these values, and estimate parameters from the simulated data.

    Simulating and fitting a substantial number of model fits, 5000 in this case, takes only a few seconds, following which we extract a data frame of the parameter estimates and plot densities of some of these estimates.

    -
    -
    rng = Random.seed!(42)    # initialize a random number generator
    -m1bstp = parametricbootstrap(rng, 5000, m1; hide_progress=true)
    -tbl = m1bstp.tbl
    +
    +
    rng = Random.seed!(42)    # initialize a random number generator
    +m1bstp = parametricbootstrap(rng, 5000, m1; hide_progress=true)
    +tbl = m1bstp.tbl
    Table with 10 columns and 5000 rows:
           obj      β1       β2       σ        σ1       σ2       ρ1          ⋯
         ┌────────────────────────────────────────────────────────────────────
    - 1  │ 1717.29  260.712  9.84975  23.4092  15.3314  6.40292  -0.0259483  ⋯
    - 2  │ 1744.06  262.253  12.3008  25.7047  16.3183  5.54687  0.552609    ⋯
    - 3  │ 1714.16  253.149  12.879   22.2753  25.4787  6.1444   0.0691544   ⋯
    - 4  │ 1711.54  263.376  11.5798  23.3128  18.8039  4.65569  0.103361    ⋯
    - 5  │ 1741.66  248.429  9.39444  25.4355  20.1412  5.27358  -0.163606   ⋯
    - 6  │ 1754.81  256.794  8.024    26.5089  10.6769  7.14153  0.335544    ⋯
    - 7  │ 1777.73  253.388  8.83556  27.8623  17.8322  7.17385  0.00379492  ⋯
    - 8  │ 1768.59  254.441  11.4479  27.4034  16.2487  6.67041  0.725384    ⋯
    + 1  │ 1717.29  260.712  9.84975  23.4092  15.3314  6.40292  -0.0259482  ⋯
    + 2  │ 1744.06  262.253  12.3008  25.7047  16.3183  5.54688  0.552607    ⋯
    + 3  │ 1714.16  253.149  12.879   22.2753  25.4787  6.1444   0.0691545   ⋯
    + 4  │ 1711.54  263.376  11.5798  23.3128  18.8039  4.6557   0.103361    ⋯
    + 5  │ 1741.66  248.429  9.39444  25.4355  20.141   5.27357  -0.163607   ⋯
    + 6  │ 1754.81  256.794  8.024    26.5088  10.6776  7.14168  0.335501    ⋯
    + 7  │ 1777.73  253.388  8.83556  27.8623  17.8321  7.17386  0.00379771  ⋯
    + 8  │ 1768.59  254.441  11.4479  27.4034  16.2483  6.67044  0.725389    ⋯
      9  │ 1753.56  244.906  11.3423  25.6046  25.3607  5.98654  -0.171821   ⋯
      10 │ 1722.61  257.088  9.18397  23.3386  24.9274  5.18012  0.181143    ⋯
    - 11 │ 1738.16  251.262  11.6568  25.7823  17.6665  4.07214  0.258136    ⋯
    - 12 │ 1747.76  258.302  12.8015  26.1085  19.2398  5.06067  0.879704    ⋯
    - 13 │ 1745.91  254.57   11.8062  24.8863  24.2513  6.14642  0.0126995   ⋯
    + 11 │ 1738.16  251.262  11.6568  25.7822  17.6669  4.07207  0.258267    ⋯
    + 12 │ 1747.76  258.302  12.8015  26.1085  19.2398  5.06066  0.879712    ⋯
    + 13 │ 1745.91  254.57   11.8062  24.8863  24.2513  6.14642  0.0126996   ⋯
      14 │ 1738.8   251.179  10.3226  24.2672  23.7195  6.32645  0.368592    ⋯
    - 15 │ 1724.76  238.603  11.5045  25.2301  19.026   3.64035  -0.346558   ⋯
    + 15 │ 1724.76  238.603  11.5045  25.23    19.0264  3.6404   -0.346579   ⋯
      16 │ 1777.7   254.133  8.26397  26.9846  26.3715  7.8283   -0.288773   ⋯
      17 │ 1748.33  251.571  9.5294   26.2927  21.9611  4.31316  -0.150104   ⋯
      18 │ 1708.99  245.607  12.8175  24.4135  12.494   5.11304  -0.694452   ⋯
    - 19 │ 1732.8   256.87   12.2719  23.9952  20.2663  6.58464  0.147647    ⋯
    + 19 │ 1732.8   256.87   12.2719  23.9952  20.2665  6.58464  0.147646    ⋯
      20 │ 1746.12  247.428  10.4695  24.319   32.9351  5.78109  0.0337611   ⋯
      21 │ 1788.6   254.067  9.11893  27.8716  29.9888  6.74499  -0.0317739  ⋯
    - 22 │ 1772.12  245.629  10.4063  28.3482  17.6055  5.14085  -0.0573809  ⋯
    + 22 │ 1772.12  245.629  10.4063  28.3482  17.6055  5.14085  -0.0573815  ⋯
      23 │ 1749.18  245.683  11.673   25.3641  26.4956  5.18958  0.469144    ⋯
      ⋮  │    ⋮        ⋮        ⋮        ⋮        ⋮        ⋮         ⋮       ⋱

    An empirical density plot of the estimates for the fixed-effects coefficients, Figure 4, shows the normal distribution, “bell-curve”, shape as we might expect.

    -
    +
    Code -
    begin
    -  f1 = Figure(; resolution=(1000, 400))
    -  CairoMakie.density!(
    -    Axis(f1[1, 1]; xlabel="Intercept [ms]"), tbl.β1
    -  )
    -  CairoMakie.density!(
    -    Axis(f1[1, 2]; xlabel="Coefficient of days [ms/day]"),
    -    tbl.β2
    -  )
    -  f1
    -end
    +
    begin
    +  f1 = Figure(; resolution=(1000, 400))
    +  CairoMakie.density!(
    +    Axis(f1[1, 1]; xlabel="Intercept [ms]"), tbl.β1
    +  )
    +  CairoMakie.density!(
    +    Axis(f1[1, 2]; xlabel="Coefficient of days [ms/day]"),
    +    tbl.β2
    +  )
    +  f1
    +end
    @@ -841,31 +838,31 @@

    5 Assessing varia

    It is also possible to create interval estimates of the parameters from the bootstrap replicates. We define the 1-α shortestcovint to be the shortest interval that contains a proportion 1-α (defaults to 95%) of the bootstrap estimates of the parameter.

    -
    -
    Table(shortestcovint(m1bstp))
    +
    +
    Table(shortestcovint(m1bstp))
    Table with 5 columns and 6 rows:
    -     type  group     names              lower     upper
    -   ┌─────────────────────────────────────────────────────
    - 1 │ β     missing   (Intercept)        239.64    265.228
    - 2 │ β     missing   days               7.42347   13.1607
    - 3 │ σ     subj      (Intercept)        10.1722   33.0876
    - 4 │ σ     subj      days               2.9948    7.66117
    - 5 │ ρ     subj      (Intercept), days  -0.40135  1.0
    - 6 │ σ     residual  missing            22.701    28.5016
    + type group names lower upper + ┌────────────────────────────────────────────────────── + 1 │ β missing (Intercept) 239.64 265.228 + 2 │ β missing days 7.42347 13.1607 + 3 │ σ subj (Intercept) 10.1722 33.0875 + 4 │ σ subj days 2.99496 7.66115 + 5 │ ρ subj (Intercept), days -0.401354 1.0 + 6 │ σ residual missing 22.701 28.5016

    The intervals look reasonable except that the upper end point of the interval for ρ1, the correlation coefficient, is 1.0 . It turns out that the estimates of ρ have a great deal of variability.

    Because there are several values on the boundary (ρ = 1.0) and a pulse like this is not handled well by a density plot, we plot this sample as a histogram, Figure 5.

    -
    +
    Code -
    hist(
    -  tbl.ρ1;
    -  bins=40,
    -  axis=(; xlabel="Estimated correlation of the random effects"),
    -  figure=(; resolution=(500, 500)),
    -)
    +
    hist(
    +  tbl.ρ1;
    +  bins=40,
    +  axis=(; xlabel="Estimated correlation of the random effects"),
    +  figure=(; resolution=(500, 500)),
    +)
    @@ -877,25 +874,25 @@

    5 Assessing varia

    Finally, density plots for the variance components (but on the scale of the standard deviation), Figure 6, show reasonable symmetry.

    -
    +
    Code -
    begin
    -  f2 = Figure(; resolution=(1000, 300))
    -  CairoMakie.density!(
    -    Axis(f2[1, 1]; xlabel="Residual σ"),
    -    tbl.σ,
    -  )
    -  CairoMakie.density!(
    -    Axis(f2[1, 2]; xlabel="subj-Intercept σ"),
    -    tbl.σ1,
    -  )
    -  CairoMakie.density!(
    -    Axis(f2[1, 3]; xlabel="subj-slope σ"),
    -    tbl.σ2,
    -  )
    -  f2
    -end
    +
    begin
    +  f2 = Figure(; resolution=(1000, 300))
    +  CairoMakie.density!(
    +    Axis(f2[1, 1]; xlabel="Residual σ"),
    +    tbl.σ,
    +  )
    +  CairoMakie.density!(
    +    Axis(f2[1, 2]; xlabel="subj-Intercept σ"),
    +    tbl.σ1,
    +  )
    +  CairoMakie.density!(
    +    Axis(f2[1, 3]; xlabel="subj-slope σ"),
    +    tbl.σ2,
    +  )
    +  f2
    +end
    @@ -907,27 +904,27 @@

    5 Assessing varia

    The estimates of the coefficients, β₁ and β₂, are not highly correlated as shown in a scatterplot of the bootstrap estimates, Figure 7 .

    -
    -
    vcov(m1; corr=true)  # correlation estimate from the model
    +
    +
    vcov(m1; corr=true)  # correlation estimate from the model
    2×2 Matrix{Float64}:
       1.0       -0.137545
      -0.137545   1.0
    -
    +
    Code -
    let
    -  scatter(
    -    tbl.β1, tbl.β2,
    -    color=(:blue, 0.20),
    -    axis=(; xlabel="Intercept", ylabel="Coefficient of days"),
    -    figure=(; resolution=(500, 500)),
    -  )
    -  contour!(kde((tbl.β1, tbl.β2)))
    -  current_figure()
    -end
    +
    let
    +  scatter(
    +    tbl.β1, tbl.β2,
    +    color=(:blue, 0.20),
    +    axis=(; xlabel="Intercept", ylabel="Coefficient of days"),
    +    figure=(; resolution=(500, 500)),
    +  )
    +  contour!(kde((tbl.β1, tbl.β2)))
    +  current_figure()
    +end
    diff --git a/sleepstudy_files/figure-html/fig-bsbetacontours-output-1.svg b/sleepstudy_files/figure-html/fig-bsbetacontours-output-1.svg index 14e8aae..399ece4 100644 --- a/sleepstudy_files/figure-html/fig-bsbetacontours-output-1.svg +++ b/sleepstudy_files/figure-html/fig-bsbetacontours-output-1.svg @@ -2,141 +2,141 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -146,130 +146,130 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1131,7 +1131,7 @@ - + @@ -1435,7 +1435,7 @@ - + @@ -2988,7 +2988,7 @@ - + @@ -4378,7 +4378,7 @@ - + @@ -5271,1440 +5271,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/sleepstudy_files/figure-html/fig-bsbetadensity-output-1.svg b/sleepstudy_files/figure-html/fig-bsbetadensity-output-1.svg index ea08e3c..a8ad755 100644 --- a/sleepstudy_files/figure-html/fig-bsbetadensity-output-1.svg +++ b/sleepstudy_files/figure-html/fig-bsbetadensity-output-1.svg @@ -2,282 +2,282 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -298,286 +298,286 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/sleepstudy_files/figure-html/fig-bssigmadensity-output-1.svg b/sleepstudy_files/figure-html/fig-bssigmadensity-output-1.svg index 0ec445b..d5387b1 100644 --- a/sleepstudy_files/figure-html/fig-bssigmadensity-output-1.svg +++ b/sleepstudy_files/figure-html/fig-bssigmadensity-output-1.svg @@ -2,246 +2,237 @@ - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + + + + - + - + - + - + + + + - + - + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - - - - + - + - + - + - + - + - + - + - - - - - + + - + - + - + - + - - - - - - - - - - - - - + @@ -251,309 +242,309 @@ - - + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + diff --git a/sleepstudy_files/figure-html/fig-correlationhist-output-1.svg b/sleepstudy_files/figure-html/fig-correlationhist-output-1.svg index 3215e5b..37b5d75 100644 --- a/sleepstudy_files/figure-html/fig-correlationhist-output-1.svg +++ b/sleepstudy_files/figure-html/fig-correlationhist-output-1.svg @@ -2,153 +2,153 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -160,218 +160,218 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + @@ -389,8 +389,8 @@ - - + + diff --git a/sleepstudy_files/figure-html/fig-m1caterpillar-output-1.svg b/sleepstudy_files/figure-html/fig-m1caterpillar-output-1.svg index e6b5187..f10b91f 100644 --- a/sleepstudy_files/figure-html/fig-m1caterpillar-output-1.svg +++ b/sleepstudy_files/figure-html/fig-m1caterpillar-output-1.svg @@ -2,219 +2,213 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + @@ -261,271 +255,271 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -599,38 +593,35 @@ - - - - + - + - + - + - + - + - + - + - + - + @@ -704,9 +695,6 @@ - - - diff --git a/sleepstudy_files/figure-html/fig-m1shrinkage-output-1.svg b/sleepstudy_files/figure-html/fig-m1shrinkage-output-1.svg index d4bf138..b16c770 100644 --- a/sleepstudy_files/figure-html/fig-m1shrinkage-output-1.svg +++ b/sleepstudy_files/figure-html/fig-m1shrinkage-output-1.svg @@ -2,254 +2,230 @@ - + - + - - - - - - - + - + - + - + - + - + - + - + - + - + - + + + + - + - - - - + - + - + - + - + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + - + - + - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -286,50 +262,50 @@ - - - + + + - - - - - + + + + + - - + + - - - + + + - - - - - + + + + + - + - - - + + + - - + + - + - + diff --git a/sleepstudy_files/figure-html/fig-reaction_vs_days_by_subject-output-1.svg b/sleepstudy_files/figure-html/fig-reaction_vs_days_by_subject-output-1.svg index a79ac14..e588627 100644 --- a/sleepstudy_files/figure-html/fig-reaction_vs_days_by_subject-output-1.svg +++ b/sleepstudy_files/figure-html/fig-reaction_vs_days_by_subject-output-1.svg @@ -1,2361 +1,2357 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - - - - + + - - + + + + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - + + - - + + + + + + + + + + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - - - - + + - - - - - + + + + + - - + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sleepstudy_speed.html b/sleepstudy_speed.html index d1b58cb..573608d 100644 --- a/sleepstudy_speed.html +++ b/sleepstudy_speed.html @@ -422,7 +422,7 @@

    2 Setup

    First we attach the various packages needed, define a few helper functions, read the data, and get everything in the desired shape.

    -
    +
    Code
    using CairoMakie         # device driver for static (SVG, PDF, PNG) plots
    @@ -447,7 +447,7 @@ 

    3 PreprocessingCompute speed as an alternative dependent variable from reaction, warranted by a ‘boxcox’ check of residuals.
  • Create a GroupedDataFrame by levels of Subj (the original dataframe is available as gdf.parent, which we name df)
  • -
    +
    gdf = @chain MixedModels.dataset(:sleepstudy) begin
       DataFrame
       rename!(:subj => :Subj, :days => :day)
    @@ -650,7 +650,7 @@ 

    3 Preprocessing

    -
    +
    df = gdf.parent
     describe(df)
    @@ -728,10 +728,10 @@

    3 Preprocessing

    4 Estimates for pooled data

    In the first analysis we ignore the dependency of observations due to repeated measures from the same subjects. We pool all the data and estimate the regression of 180 speed scores on the nine days of the experiment.

    -
    +
    pooledcoef = simplelinreg(df.day, df.speed)  # produces a Tuple
    -
    (3.965811974783149, -0.11099359232199696)
    +
    (3.965811974783146, -0.1109935923219964)
    @@ -741,7 +741,7 @@

    5 Within-subject

    5.1 Within-subject simple regressions

    Applying combine to a grouped data frame like gdf produces a DataFrame with a row for each group. The permutation ord provides an ordering for the groups by increasing intercept (predicted response at day 0).

    -
    +
    within = combine(gdf, [:day, :speed] => simplelinreg => :coef)
    18×2 DataFrame
    @@ -855,7 +855,7 @@

    Figure 1 shows the reaction speed versus days of sleep deprivation by subject. The panels are arranged by increasing initial reaction speed starting at the lower left and proceeding across rows.

    -
    +
    Code
    let
    @@ -888,7 +888,7 @@ 

    6 Basic LMM

    -
    +
    contrasts = Dict(:Subj => Grouping())
     m1 = let
       form = @formula speed ~ 1 + day + (1 + day | Subj)
    @@ -942,7 +942,7 @@ 

    6 Basic LMM

    7 No correlation parameter: zcp LMM

    The zerocorr function applied to a random-effects term estimates one parameter less than LMM m1– the CP is now fixed to zero.

    -
    +
    m2 = let
       form = @formula speed ~ 1 + day + zerocorr(1 + day | Subj)
       fit(MixedModel, form, df; contrasts)
    @@ -989,7 +989,7 @@ 

    7 No correlation

    LMM m2 has a slghtly lower log-likelihood than LMM m1 but also one fewer parameters. A likelihood-ratio test is used to compare these nested models.

    -
    +
    Code
    MixedModels.likelihoodratiotest(m2, m1)
    @@ -1036,7 +1036,7 @@

    7 No correlation

    Alternatively, the AIC, AICc, and BIC values can be compared. They are on a scale where “smaller is better”. All three model-fit statistics prefer the zcpLMM m2.

    -
    +
    Code
    let
    @@ -1100,7 +1100,7 @@ 

    8 Conditional mod

    9 Caterpillar plots (effect profiles)

    -
    +
    Code
    caterpillar(m2)
    @@ -1117,7 +1117,7 @@

    9 Caterpillar plo

    10 Shrinkage plot

    -
    +
    Code
    shrinkageplot!(Figure(; resolution=(500, 500)), m2)
    diff --git a/sleepstudy_speed_files/figure-html/fig-shrinkagem2-output-1.svg b/sleepstudy_speed_files/figure-html/fig-shrinkagem2-output-1.svg index 63db028..416c670 100644 --- a/sleepstudy_speed_files/figure-html/fig-shrinkagem2-output-1.svg +++ b/sleepstudy_speed_files/figure-html/fig-shrinkagem2-output-1.svg @@ -2,251 +2,239 @@ - + - + - + + + + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -266,67 +254,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + +