diff --git a/.nojekyll b/.nojekyll index a7041b0..9e95037 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -d021dfbc \ No newline at end of file +922b5b57 \ No newline at end of file diff --git a/AoGPlots.html b/AoGPlots.html index a1a28e7..e9e9b89 100644 --- a/AoGPlots.html +++ b/AoGPlots.html @@ -2,14 +2,14 @@ - + - + -SMLP2023: Advanced Frequentist Track - Creating multi-panel plots +Creating multi-panel plots – SMLP2023: Advanced Frequentist Track - + @@ -106,7 +107,13 @@ "collapse-after": 3, "panel-placement": "end", "type": "overlay", - "limit": 20, + "limit": 50, + "keyboard-shortcut": [ + "f", + "/", + "s" + ], + "show-item-context": false, "language": { "search-no-results-text": "No results", "search-matching-documents-text": "matching documents", @@ -115,13 +122,14 @@ "search-more-match-text": "more match in this document", "search-more-matches-text": "more matches in this document", "search-clear-button-title": "Clear", + "search-text-placeholder": "", "search-detached-cancel-button-title": "Cancel", "search-submit-button-title": "Submit", "search-label": "Search" } } - + @@ -131,40 +139,40 @@
-
+

Begin by loading the packages to be used.

-
-
+
+
Code
using AlgebraOfGraphics
 using CairoMakie
@@ -415,7 +458,7 @@ 

Bootstrapping a fitted model

1 Data set and model

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:
@@ -429,13 +472,13 @@ 

1 Data set and mo

Convert the table to a DataFrame for summary.

-
+
describe(DataFrame(kb07))
7×7 DataFrame
- +
- + @@ -534,14 +577,14 @@

1 Data set and mo

The experimental factors; spkr, prec, and load, are two-level factors. The EffectsCoding contrast is used with these to create a \(\pm1\) encoding. Furthermore, Grouping contrasts 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.

-
+
contrasts = merge(
   Dict(nm => EffectsCoding() for nm in (:spkr, :prec, :load)),
   Dict(nm => Grouping() for nm in (:subj, :item)),
 )

The display of an initial model fit

-
+
kbm01 = let
   form = @formula(
     rt_trunc ~
@@ -553,11 +596,11 @@ 

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

-
Minimizing 799    Time: 0:00:01 ( 1.84 ms/it)
-  objective:  28637.123623229592
+
Minimizing 874    Time: 0:00:01 ( 1.38 ms/it)
+  objective:  28637.971010073215
-
-

Row variable mean
+
+
@@ -581,79 +624,79 @@

1 Data set and mo

- - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - + - - + + - + - - + + - + - - + + - + - + @@ -666,10 +709,10 @@

1 Data set and mo

does not include the estimated correlations of the random effects.

The VarCorr extractor displays these.

-
+
VarCorr(kbm01)
-
-

(Intercept)2181.672977.313628.222181.642477.351528.20 <1e-99301.8062362.2579301.8721362.4695
spkr: old67.749118.26643.7167.749617.96073.77 0.000242.379540.680733.058841.1159
prec: maintain-333.920547.1558-333.920047.1563 -7.08 <1e-1161.9630246.915858.8512247.3299
load: yes78.770219.52984.0378.800719.72693.99 <1e-0464.975142.389066.952643.3991
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.0515
+
+
@@ -694,8 +737,8 @@

1 Data set and mo

- - + + @@ -703,35 +746,35 @@

1 Data set and mo

- - - + + + - - - - + + + + - - + + - - + + - - + + @@ -739,35 +782,35 @@

1 Data set and mo

- - - + + + - - + + - + - - - - - + + + + + - - + + @@ -777,7 +820,7 @@

1 Data set and mo

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

-
+
kbm02 = let
   form = @formula(
     rt_trunc ~
@@ -785,8 +828,8 @@ 

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

-
-

subj (Intercept)91087.0055301.806291126.7545301.8721
spkr: old1796.022142.3795+0.791092.886233.0588+1.00
prec: maintain3839.412661.9630-0.59+0.023463.460358.8512-0.62-0.62
load: yes4221.763864.97514482.649366.9526 +0.36+0.85+0.54+0.36+0.51
item (Intercept)131230.7914362.2579131384.1084362.4695
spkr: old1654.923240.6807+0.441690.521041.1159+0.42
prec: maintain60967.4037246.915861172.0781247.3299 -0.69+0.35+0.37
load: yes1796.828442.3890+0.32+0.16-0.141883.478543.3991+0.29+0.14-0.13
Residual 446964.7062668.5542447629.9270669.0515
+
+
@@ -857,10 +900,10 @@

1 Data set and mo

-
+
VarCorr(kbm02)
-
- +
+
@@ -874,7 +917,7 @@

1 Data set and mo

- + @@ -888,7 +931,7 @@

1 Data set and mo

- + @@ -904,10 +947,10 @@

1 Data set and mo

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

-
+
MixedModels.likelihoodratiotest(kbm02, kbm01)
-
-

item (Intercept)133015.242133015.244 364.713
subj (Intercept)88819.43888819.437 298.026
+
+
@@ -938,10 +981,10 @@

1 Data set and mo

- - + + - +
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
@@ -952,7 +995,7 @@

1 Data set and mo

2 A bootstrap sample

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

-
+
Random.seed!(1234321)
 kbm02samp = parametricbootstrap(2000, kbm02)
 kbm02tbl = kbm02samp.tbl
@@ -960,34 +1003,34 @@

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.681  212.916  ⋯
+ 2  │ 28775.3  2221.81  61.7318  -349.417  71.1992  697.028  442.812  278.931  ⋯
  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  ⋯
+ 4  │ 28682.9  2274.65  52.9438  -384.66   69.6788  682.801  398.901  319.725  ⋯
+ 5  │ 28616.1  2191.34  54.7785  -357.919  111.829  673.878  253.244  235.912  ⋯
  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  ⋯
  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  ⋯
+ 11 │ 28686.8  2034.11  59.9149  -224.859  59.5448  682.433  308.677  272.183  ⋯
+ 12 │ 28702.2  2130.98  83.3953  -271.61   79.974   689.679  401.98   264.258  ⋯
+ 13 │ 28625.0  2055.35  55.3526  -363.937  67.7128  676.817  309.149  265.788  ⋯
+ 14 │ 28570.3  2160.73  81.5575  -321.913  108.979  661.525  426.862  259.819  ⋯
+ 15 │ 28613.6  2237.73  36.9996  -362.443  82.1812  673.873  312.859  241.592  ⋯
  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  ⋯
+ 17 │ 28577.2  2143.78  66.2959  -373.598  93.157   668.15   321.469  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  ⋯
+ 21 │ 28677.6  2129.89  72.7198  -245.006  84.7693  681.415  359.093  287.654  ⋯
+ 22 │ 28582.1  2179.8   74.8364  -405.798  68.2978  664.168  357.696  231.402  ⋯
  23 │ 28714.9  2326.34  74.7091  -400.441  67.79    692.381  354.032  259.052  ⋯
  ⋮  │    ⋮        ⋮        ⋮        ⋮         ⋮        ⋮        ⋮        ⋮     ⋱

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

-
+
confint(kbm02samp)
DictTable with 2 columns and 9 rows:
@@ -997,16 +1040,16 @@ 

2 A bootstrap sam β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 + ρ1 │ -0.897984 -0.445605 + σ │ 655.25 701.497 + σ1 │ 261.196 448.51 + σ2 │ 175.489 312.045 σ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.

-
-
+

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.

+
+
Code
draw(
   data(kbm02samp.β) * mapping(:β; color=:coefname) * AlgebraOfGraphics.density();
@@ -1014,16 +1057,20 @@ 

2 A bootstrap sam )

-
-
-

-
Figure 1: Comparative densities of the fixed-effects coefficients in kbm02samp
+
+
+
+ +
+
+Figure 1: Comparative densities of the fixed-effects coefficients in kbm02samp +
-
-
+
+
Code
let pars = ["σ1", "σ2", "σ3"]
   draw(
@@ -1035,16 +1082,20 @@ 

2 A bootstrap sam end

-
-
-

-
Figure 2: Density plot of bootstrap samples standard deviation of random effects
+
+
+
+ +
+
+Figure 2: Density plot of bootstrap samples standard deviation of random effects +
-
-
+
+
Code
draw(
   data(kbm02tbl) *
@@ -1054,10 +1105,14 @@ 

2 A bootstrap sam )

-
-
-

-
Figure 3: Density plot of correlation parameters in bootstrap sample from model kbm02
+
+
+
+ +
+
+Figure 3: Density plot of correlation parameters in bootstrap sample from model kbm02 +
@@ -1065,7 +1120,7 @@

2 A bootstrap sam

3 References

-
+
Kronmü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
@@ -1118,6 +1173,33 @@

3 References

} } } + const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => { + const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light'; + const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark'; + let newTheme = ''; + if(darkModeDefault) { + newTheme = isAlternate ? baseTheme : alternateTheme; + } else { + newTheme = isAlternate ? alternateTheme : baseTheme; + } + const changeGiscusTheme = () => { + // From: https://github.com/giscus/giscus/issues/336 + const sendMessage = (message) => { + const iframe = document.querySelector('iframe.giscus-frame'); + if (!iframe) return; + iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app'); + } + sendMessage({ + setConfig: { + theme: newTheme + } + }); + } + const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null; + if (isGiscussLoaded) { + changeGiscusTheme(); + } + } const toggleColorMode = (alternate) => { // Switch the stylesheets const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate'); @@ -1184,13 +1266,15 @@

3 References

return localAlternateSentinel; } } - let localAlternateSentinel = 'default'; + const darkModeDefault = false; + let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default'; // Dark / light mode switch window.quartoToggleColorScheme = () => { // Read the current dark / light value let toAlternate = !hasAlternateSentinel(); toggleColorMode(toAlternate); setStyleSentinel(toAlternate); + toggleGiscusIfUsed(toAlternate, darkModeDefault); }; // Ensure there is a toggle, if there isn't float one in the top right if (window.document.querySelector('.quarto-color-scheme-toggle') === null) { @@ -1225,18 +1309,7 @@

3 References

} return false; } - const clipboard = new window.ClipboardJS('.code-copy-button', { - text: function(trigger) { - const codeEl = trigger.previousElementSibling.cloneNode(true); - for (const childEl of codeEl.children) { - if (isCodeAnnotation(childEl)) { - childEl.remove(); - } - } - return codeEl.innerText; - } - }); - clipboard.on('success', function(e) { + const onCopySuccess = function(e) { // button target const button = e.trigger; // don't keep focus @@ -1268,11 +1341,50 @@

3 References

}, 1000); // clear code selection e.clearSelection(); + } + const getTextToCopy = function(trigger) { + const codeEl = trigger.previousElementSibling.cloneNode(true); + for (const childEl of codeEl.children) { + if (isCodeAnnotation(childEl)) { + childEl.remove(); + } + } + return codeEl.innerText; + } + const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', { + text: getTextToCopy }); - function tippyHover(el, contentFn) { + clipboard.on('success', onCopySuccess); + if (window.document.getElementById('quarto-embedded-source-code-modal')) { + // For code content inside modals, clipBoardJS needs to be initialized with a container option + // TODO: Check when it could be a function (https://github.com/zenorocha/clipboard.js/issues/860) + const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', { + text: getTextToCopy, + container: window.document.getElementById('quarto-embedded-source-code-modal') + }); + clipboardModal.on('success', onCopySuccess); + } + var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); + var mailtoRegex = new RegExp(/^mailto:/); + var filterRegex = new RegExp("https:\/\/RePsychLing\.github\.io\/SMLP2023"); + var isInternal = (href) => { + return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); + } + // Inspect non-navigation links and adorn them if external + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)'); + for (var i=0; i3 References

interactive: true, interactiveBorder: 10, theme: 'quarto', - placement: 'bottom-start' + placement: 'bottom-start', }; + if (contentFn) { + config.content = contentFn; + } + if (onTriggerFn) { + config.onTrigger = onTriggerFn; + } + if (onUntriggerFn) { + config.onUntrigger = onUntriggerFn; + } window.tippy(el, config); } const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]'); @@ -1295,7 +1416,130 @@

3 References

try { href = new URL(href).hash; } catch {} const id = href.replace(/^#\/?/, ""); const note = window.document.getElementById(id); - return note.innerHTML; + if (note) { + return note.innerHTML; + } else { + return ""; + } + }); + } + const xrefs = window.document.querySelectorAll('a.quarto-xref'); + const processXRef = (id, note) => { + // Strip column container classes + const stripColumnClz = (el) => { + el.classList.remove("page-full", "page-columns"); + if (el.children) { + for (const child of el.children) { + stripColumnClz(child); + } + } + } + stripColumnClz(note) + if (id === null || id.startsWith('sec-')) { + // Special case sections, only their first couple elements + const container = document.createElement("div"); + if (note.children && note.children.length > 2) { + container.appendChild(note.children[0].cloneNode(true)); + for (let i = 1; i < note.children.length; i++) { + const child = note.children[i]; + if (child.tagName === "P" && child.innerText === "") { + continue; + } else { + container.appendChild(child.cloneNode(true)); + break; + } + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(container); + } + return container.innerHTML + } else { + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + return note.innerHTML; + } + } else { + // Remove any anchor links if they are present + const anchorLink = note.querySelector('a.anchorjs-link'); + if (anchorLink) { + anchorLink.remove(); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + // TODO in 1.5, we should make sure this works without a callout special case + if (note.classList.contains("callout")) { + return note.outerHTML; + } else { + return note.innerHTML; + } + } + } + for (var i=0; i res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.getElementById(id); + if (note !== null) { + const html = processXRef(id, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + } else { + // See if we can fetch a full url (with no hash to target) + // This is a special case and we should probably do some content thinning / targeting + fetch(url) + .then(res => res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.querySelector('main.content'); + if (note !== null) { + // This should only happen for chapter cross references + // (since there is no id in the URL) + // remove the first header + if (note.children.length > 0 && note.children[0].tagName === "HEADER") { + note.children[0].remove(); + } + const html = processXRef(null, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + }, function(instance) { }); } let selectedAnnoteEl; @@ -1339,6 +1583,7 @@

3 References

} div.style.top = top - 2 + "px"; div.style.height = height + 4 + "px"; + div.style.left = 0; let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter"); if (gutterDiv === null) { gutterDiv = window.document.createElement("div"); @@ -1364,6 +1609,32 @@

3 References

}); selectedAnnoteEl = undefined; }; + // Handle positioning of the toggle + window.addEventListener( + "resize", + throttle(() => { + elRect = undefined; + if (selectedAnnoteEl) { + selectCodeLines(selectedAnnoteEl); + } + }, 10) + ); + function throttle(fn, ms) { + let throttle = false; + let timer; + return (...args) => { + if(!throttle) { // first call gets through + fn.apply(this, args); + throttle = true; + } else { // all the others get throttled + if(timer) clearTimeout(timer); // cancel #2 + timer = setTimeout(() => { + fn.apply(this, args); + timer = throttle = false; + }, ms); + } + }; + } // Attach click handler to the DT const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); for (const annoteDlNode of annoteDls) { @@ -1425,12 +1696,12 @@

3 References

+ +

1 Background

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

@@ -449,8 +492,8 @@

1 Background

2 Packages

-
-
+
+
Code
using Arrow
 using AlgebraOfGraphics
@@ -475,14 +518,14 @@ 

2 Packages

3 Read data, compute and plot means

-
+
dat = DataFrame(dataset(:kkl15))
 describe(dat)
5×7 DataFrame
- +
- + @@ -559,7 +602,7 @@

3 Read data, comp -
+
dat_subj = combine(
   groupby(dat, [:Subj, :CTR]),
   nrow => :n,
@@ -570,9 +613,9 @@ 

3 Read data, comp describe(dat_subj)

5×7 DataFrame
-

Row variable mean
+
- + @@ -649,8 +692,8 @@

3 Read data, comp -
-
+
+
Code
boxplot(
   dat_subj.CTR.refs,
@@ -672,18 +715,22 @@ 

3 Read data, comp )

-
-
-

-
Figure 1: Comparative boxplots of mean log response time by subject under different conditions
+
+
+
+ +
+
+Figure 1: Comparative boxplots of mean log response time by subject under different conditions +

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)
   boxplot(
@@ -707,10 +754,14 @@ 

3 Read data, comp end

-
-
-

-
Figure 2: Comparative boxplots of mean log response time by subject under different conditions without outlier
+
+
+
+ +
+
+Figure 2: Comparative boxplots of mean log response time by subject under different conditions without outlier +
@@ -720,7 +771,7 @@

3 Read data, comp

4 Setup of linear mixed model

4.1 Contrasts

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

-
+
m_max_rt = let
   form = @formula rt ~ 1 + CTR * size * cardinal + 
                            (1 + CTR * size * cardinal | Subj)
   fit(MixedModel, form, dat; contrasts)
 end
-
Minimizing 3379    Time: 0:00:05 ( 1.53 ms/it)
-  objective:  599297.6599718278
+
Minimizing 3872    Time: 0:00:06 ( 1.59 ms/it)
+  objective:  599297.6610000695
-
-

Row variable mean
+
+
@@ -769,130 +820,130 @@

- - + + - - - + + + - + - - - + + + - + - - - - + + + + - - + + - + - + - + - - + + - + - - + + - - + + - - + + - + - - - + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - - + + + - + - - + + - + @@ -906,17 +957,17 @@

+
m_cpx_rt = let
   form = @formula rt ~ 1 + CTR * size * cardinal + 
                            (1 + CTR + size + cardinal | Subj)
   fit(MixedModel, form, dat; contrasts)
 end
-
Minimizing 917    Time: 0:00:00 ( 0.16 ms/it)
+
Minimizing 770    Time: 0:00:00 ( 0.25 ms/it)
-
-

(Intercept) 308.40785.842852.785.836552.84 <1e-99 0.0000
CTR: sod23.26862.56659.0723.26852.56769.06 <1e-185.34679.9631
CTR: dos13.08001.54348.4713.08021.54338.48 <1e-166.58045.0118
CTR: dod 2.77242.09281.320.185312.39562.09211.330.185113.1147
size: small 26.41305.84284.525.83654.53 <1e-0554.068354.0095
cardinal: diagonal 6.67491.78861.7890 3.73 0.000210.64079.7692
CTR: sod & size: small 8.79242.56653.432.56763.42 0.000621.567419.8731
CTR: dos & size: small-0.70591.5434-0.70611.5433 -0.460.64745.86730.64737.2502
CTR: dod & size: small7.49772.09287.49802.0921 3.58 0.00039.74508.7387
CTR: sod & cardinal: diagonal3.63161.10213.303.63151.10223.29 0.00103.16654.2292
CTR: dos & cardinal: diagonal1.33461.24491.33441.2450 1.070.28371.75610.28381.7717
CTR: dod & cardinal: diagonal-0.22511.3223-0.22471.3224 -0.170.86483.27840.86514.0782
size: small & cardinal: diagonal2.05011.78862.05021.7890 1.150.251712.21980.251812.9327
CTR: sod & size: small & cardinal: diagonal-0.76391.1021-0.76381.1022 -0.69 0.48834.65703.7198
CTR: dos & size: small & cardinal: diagonal-0.15571.2449-0.13-0.15561.2450-0.12 0.90051.74611.7390
CTR: dod & size: small & cardinal: diagonal4.17701.32234.17681.3224 3.16 0.00163.40782.3972
Residual
+
+
@@ -938,79 +989,79 @@

- - - + + + - + - - + + - + - - - + + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - + - - + + - + @@ -1018,7 +1069,7 @@

- + @@ -1026,18 +1077,18 @@

- + - + - - + + - + @@ -1058,7 +1109,7 @@

- + @@ -1066,7 +1117,7 @@

- + @@ -1079,18 +1130,18 @@

4.2 Box-Cox

-
+
bc1 = fit(BoxCoxTransformation, m_max_rt)
-
+
bc2 = fit(BoxCoxTransformation, m_cpx_rt)
-
Minimizing 1286    Time: 0:00:00 ( 0.14 ms/it)
+
Minimizing 1191    Time: 0:00:00 ( 0.14 ms/it)
Box-Cox transformation
 
-estimated λ: -0.7015
+estimated λ: -0.7062
 resultant transformation:
 
  y^-0.7 - 1
@@ -1098,7 +1149,7 @@ 

+
boxcoxplot(bc2; conf_level=0.95)

Clear evidence for skew. Traditionally, we used log transforms for reaction times. even stronger than log. We stay with log for now. Could try 1/sqrt(rt).

@@ -1107,18 +1158,18 @@

5 Maximum LMM

This is the maximum LMM for the design.

-
+
m_max = let
   form = @formula log(rt) ~ 1 + CTR * size * cardinal + 
                            (1 + CTR * size * cardinal | Subj)
   fit(MixedModel, form, dat; contrasts)
 end
-
Minimizing 7051    Time: 0:00:10 ( 1.56 ms/it)
-  objective:  -24691.24304873087
+
Minimizing 8282    Time: 0:00:13 ( 1.63 ms/it)
+  objective:  -24691.24618930951
-
-

(Intercept)308.40756.063150.87308.40746.052750.95 <1e-9940.404640.4433
CTR: sod 23.27232.47649.402.47399.41 <1e-2021.317621.2925
CTR: dos13.11001.46278.9613.10991.46218.97 <1e-187.51607.5060
CTR: dod2.71411.91812.71401.9182 1.41 0.157113.711513.7125
size: small 26.38656.06314.356.05274.36 <1e-0438.940838.7600
cardinal: diagonal6.65051.73206.65061.7311 3.84 0.000115.665115.6567
CTR: sod & size: small 8.79562.47643.552.47393.56 0.0004
CTR: dos & size: small-0.72311.4627-0.72301.4621 -0.490.62110.6209
CTR: dod & size: small7.41891.91817.41911.9182 3.87 0.0001
CTR: sod & cardinal: diagonal3.64133.6414 0.9210 3.95 <1e-04CTR: dos & cardinal: diagonal1.32771.3276 1.2176 1.09 0.2755CTR: dod & cardinal: diagonal-0.3145-0.3142 1.2217 -0.260.79690.7970
size: small & cardinal: diagonal2.04711.73202.04701.7311 1.180.23720.2370
CTR: dod & size: small & cardinal: diagonal4.11174.1115 1.2217 3.37 0.0008Residual63.101063.1011
+
+
@@ -1142,7 +1193,7 @@

5 Maximum LMM

(Intercept)
- + @@ -1150,9 +1201,9 @@

5 Maximum LMM

CTR: sod
- + - + @@ -1160,21 +1211,21 @@

5 Maximum LMM

0.0047
- + - - + + - + @@ -1184,7 +1235,7 @@

5 Maximum LMM

0.0052
- + @@ -1192,23 +1243,23 @@

5 Maximum LMM

0.0078
- + - - + + - + - + @@ -1216,7 +1267,7 @@

5 Maximum LMM

0.0032
- + @@ -1224,7 +1275,7 @@

5 Maximum LMM

0.0037
- + @@ -1232,15 +1283,15 @@

5 Maximum LMM

0.0039
- + - - + + @@ -1248,15 +1299,15 @@

5 Maximum LMM

0.0032
- + - - + + @@ -1264,7 +1315,7 @@

5 Maximum LMM

0.0039
- + @@ -1278,13 +1329,13 @@

5 Maximum LMM

-
+
issingular(m_max)
true
-
+
only(MixedModels.PCA(m_max))

@@ -1301,38 +1352,38 @@ 

5 Maximum LMM

-
-
-
+ (Intercept) -0.0 -0.0 0.0 -1.0 + CTR: sod -0.03 0.07 -0.02 0.0 + CTR: dos 0.41 0.2 0.12 -0.0 + CTR: dod -0.02 -0.25 0.29 0.0 + size: small … 0.06 -0.26 -0.47 -0.0 + CTR: sod & size: small 0.15 0.49 -0.11 -0.0 + CTR: dos & size: small 0.41 0.36 0.24 -0.0 + CTR: dod & size: small -0.16 -0.35 0.47 0.0 + cardinal: diagonal -0.3 0.16 0.1 0.0 + CTR: sod & cardinal: diagonal … 0.11 -0.06 0.04 -0.0 + CTR: dos & cardinal: diagonal -0.04 -0.33 -0.17 0.0 + CTR: dod & cardinal: diagonal -0.32 0.11 -0.05 0.0 + size: small & cardinal: diagonal -0.37 0.26 0.11 -0.0 + CTR: sod & size: small & cardinal: diagonal 0.21 -0.14 0.16 -0.0 + CTR: dos & size: small & cardinal: diagonal … 0.35 -0.2 -0.4 0.0 + CTR: dod & size: small & cardinal: diagonal -0.32 0.22 -0.39 0.0 +
+
+
VarCorr(m_max)
-
-
5.6911 0.0174327.76327.65 <1e-99 0.0000
0.0744 0.00789.539.52 <1e-200.01620.0096
CTR: dos8.75 <1e-170.02040.0135
CTR: dod 0.0018 0.0056 0.310.75510.02340.75530.0233
size: small 0.0921 0.01745.315.30 <1e-06 0.1607
3.91 <1e-040.03890.0261
CTR: sod & size: small3.12 0.00180.06580.0671
CTR: dos & size: small -0.0054 0.0047 -1.150.24910.01730.24920.0231
CTR: dod & size: small 0.0183 0.00563.263.25 0.00110.03190.0320
CTR: sod & cardinal: diagonal3.12 0.00180.01080.0074
CTR: dos & cardinal: diagonal1.24 0.21490.00450.0039
CTR: dod & cardinal: diagonal-1.39 0.16480.00720.0082
size: small & cardinal: diagonal 0.0042 0.0052 0.800.42630.02700.42640.0395
CTR: sod & size: small & cardinal: diagonal-0.98 0.32870.01090.0135
CTR: dos & size: small & cardinal: diagonal -0.0005 0.0037 -0.140.89240.00240.89250.0033
CTR: dod & size: small & cardinal: diagonal2.85 0.00440.00910.0082
Residual
+
+
@@ -1402,8 +1453,8 @@

5 Maximum LMM

- - + + @@ -1423,10 +1474,10 @@

5 Maximum LMM

- - + + - + @@ -1444,11 +1495,11 @@

5 Maximum LMM

- - + + - - + + @@ -1465,11 +1516,11 @@

5 Maximum LMM

- - + + - - + + @@ -1486,13 +1537,13 @@

5 Maximum LMM

- - + + - - - - + + + + @@ -1507,14 +1558,14 @@

5 Maximum LMM

- - + + - - - - - + + + + + @@ -1528,15 +1579,15 @@

5 Maximum LMM

- - + + - - + + - - + + @@ -1549,16 +1600,16 @@

5 Maximum LMM

- - + + - - - - - - - + + + + + + + @@ -1570,17 +1621,17 @@

5 Maximum LMM

- - + + - - - + + + - - - - + + + + @@ -1591,18 +1642,18 @@

5 Maximum LMM

- - + + - - - + + + + + + + + - - - - - @@ -1612,19 +1663,19 @@

5 Maximum LMM

- - + + - - - - - - - - - + + + + + + + + + @@ -1633,20 +1684,20 @@

5 Maximum LMM

- - + + - - - - + - + + - - - - + + + + + + @@ -1654,71 +1705,71 @@

5 Maximum LMM

- - + + - - - - - - - - - - - - + + + + + + + + + + + + - - + + + + + + - - - - - - - - - - - - + + + + + + + + - - + + - - + + + + - - - - - - - - - - - + + + + + + + + + - - + + @@ -1745,17 +1796,18 @@

6 Reduction strat

6.1 Zero-correlation parameter LMM (1)

Force CPs to zero.

-
+
m_zcp1 = let
   form = @formula log(rt) ~ 1 + CTR * size * cardinal + 
                    zerocorr(1 + CTR * size * cardinal | Subj)
   fit(MixedModel, form, dat; contrasts)
 end
-
Minimizing 657    Time: 0:00:00 ( 0.22 ms/it)
+
Minimizing 637    Time: 0:00:00 ( 0.32 ms/it)
+  objective:  -24588.607469898558
-
-

CTR: sod0.000262000.016186370.000092800.00963318 +NaN CTR: dos0.000415580.020385850.000182970.01352646 +NaN+0.52-0.01 CTR: dod0.000547390.023396440.000542150.02328402 +NaN+0.16+0.41+0.51-0.35 size: small0.025814500.160668930.025830990.16072022 +NaN+0.53+0.13+0.90+0.19 +0.67 CTR: sod & size: small0.004325450.065768130.004496510.06705605 +NaN+0.05+0.33+0.41+0.51+0.10+0.32+0.55+0.50 CTR: dos & size: small0.000298230.017269310.000531880.02306260 +NaN-0.31-0.65+0.34+0.25-0.28+0.26-0.74+0.66+0.19-0.09 CTR: dod & size: small0.001014680.031854000.001022510.03197673 +NaN+0.67+0.63+0.40+0.45 +0.49 +0.68+0.74-0.34+0.70+0.15 cardinal: diagonal0.001513100.038898570.000683210.02613836 +NaN-0.35-0.16+0.22-0.05-0.12+0.31-0.38+0.14-0.55+0.06-0.07-0.23+0.14-0.49 CTR: sod & cardinal: diagonal0.000116940.010813860.000055430.00744533 +NaN+0.24+0.31+0.14+0.25-0.30-0.25 -0.01-0.33-0.14-0.15+0.28-0.43+0.05-0.32+0.25 CTR: dos & cardinal: diagonal0.000020130.004486680.000015020.00387533 +NaN-0.38+0.55+0.14-0.79+0.30-0.18-0.48+0.40-0.31+0.02-0.34 -0.42+0.41-0.49+0.12+0.04-0.02 CTR: dod & cardinal: diagonal0.000052370.007236910.000067820.00823543 +NaN+0.50+0.26+0.36+0.16-0.57+0.29-0.01+0.06+0.56+0.35-0.55+0.34+0.14 -0.36+0.83+0.17+0.02+0.24-0.59 size: small & cardinal: diagonal0.000730950.027036020.001561100.03951070 +NaN-0.27-0.17+0.23+0.10-0.02 +0.06+0.33+0.09+0.07 -0.06-0.48-0.07+0.08-0.03+0.24+0.09-0.49+0.10+0.29+0.03 CTR: sod & size: small & cardinal: diagonal0.000119400.010926870.000180920.01345048 +NaN+0.34+0.09+0.09+0.33+0.02-0.06+0.21-0.06-0.11-0.34+0.18-0.26+0.28-0.08+0.15+0.26+0.04+0.28+0.35-0.21-0.13-0.33+0.44-0.02
CTR: dos & size: small & cardinal: diagonal0.000005900.002429720.000010900.00330194 +NaN+0.09-0.75+0.38-0.06 -0.36-0.46+0.24-0.09-0.52+0.83-0.55+0.62+0.15-0.26+0.43+0.07-0.25+0.91-0.10+0.26+0.20-0.23+0.75+0.36+0.10
CTR: dod & size: small & cardinal: diagonal0.000082070.009059110.000066490.00815442 +NaN+0.61+0.87+0.23+0.34+0.37+0.47 +0.55+0.42+0.46-0.44+0.80-0.29+0.08+0.31+0.29-0.11+0.45-0.49+0.17+0.87-0.56-0.43-0.01+0.28-0.05+0.67-0.13
Residual 0.036175930.190199720.036175870.19019955
+
+
@@ -1779,9 +1831,9 @@

(Intercept)

- + - + @@ -1789,7 +1841,7 @@

0.0077

- + @@ -1797,7 +1849,7 @@

0.0045

- + @@ -1805,7 +1857,7 @@

0.0053

- + @@ -1813,7 +1865,7 @@

0.0173

- + @@ -1821,7 +1873,7 @@

0.0052

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

0.0077

- + @@ -1837,7 +1889,7 @@

0.0045

- + @@ -1845,7 +1897,7 @@

0.0053

- + @@ -1853,7 +1905,7 @@

0.0033

- + @@ -1869,15 +1921,15 @@

0.0037

- + - - + + @@ -1885,7 +1937,7 @@

0.0033

- + @@ -1901,7 +1953,7 @@

0.0037

- + @@ -1915,13 +1967,13 @@

+
issingular(m_zcp1)
true
-
+
only(MixedModels.PCA(m_zcp1))

@@ -1955,24 +2007,24 @@ 

+
VarCorr(m_zcp1)
-
-

5.6910 0.0173329.53329.51 <1e-990.15980.0151
CTR: sod9.66 <1e-210.04790.0109
CTR: dos9.09 <1e-190.00240.0240
CTR: dod0.29 0.77490.03060.0299
size: small5.33 <1e-070.00180.1591
cardinal: diagonal3.92 <1e-040.04080.0312
CTR: sod & size: small3.17 0.00150.04630.0657
CTR: dos & size: small-1.19 0.23440.02390.0010
CTR: dod & size: small3.39 0.00070.01850.0196
CTR: sod & cardinal: diagonal3.03 0.00250.00680.0172
CTR: dos & cardinal: diagonal-1.49 0.13580.00120.0033
size: small & cardinal: diagonal 0.0041 0.0052 0.790.42900.02370.42910.0354
CTR: sod & size: small & cardinal: diagonal-0.95 0.34270.01580.0008
CTR: dos & size: small & cardinal: diagonal2.94 0.00330.00330.0010
Residual
+
+
-+@@ -2018,8 +2070,8 @@

- - + + @@ -2039,8 +2091,8 @@

- - + + @@ -2060,8 +2112,8 @@

- - + + @@ -2081,8 +2133,8 @@

- - + + @@ -2102,8 +2154,8 @@

- - + + @@ -2123,8 +2175,8 @@

- - + + @@ -2144,8 +2196,8 @@

- - + + @@ -2165,8 +2217,8 @@

- - + + @@ -2186,8 +2238,8 @@

- - + + @@ -2207,8 +2259,8 @@

- - + + @@ -2228,8 +2280,8 @@

- - + + @@ -2249,8 +2301,8 @@

- - + + @@ -2270,8 +2322,8 @@

- - + + @@ -2291,8 +2343,8 @@

- - + + @@ -2312,8 +2364,8 @@

- - + + @@ -2333,8 +2385,8 @@

- - + + @@ -2354,8 +2406,8 @@

- - + + @@ -2380,14 +2432,14 @@

6.2 Reduced zcp LMM

Take out VC for interactions.

-
+
m_zcp1_rdc = let
   form = @formula log(rt) ~ 1 + CTR * size * cardinal + 
                    zerocorr(1 + CTR + size + cardinal | Subj)
   fit(MixedModel, form, dat; contrasts)
 end
-
-
Subj (Intercept)0.025532510.159788950.0002281190.015103595 CTR: sod0.002293300.047888430.0001181840.010871228 . CTR: dos0.000005740.002395460.0005771450.024023842 . . CTR: dod0.000935320.030582970.0008943640.029905924 . . . size: small0.000003170.001780680.0253106090.159093081 . . . CTR: sod & size: small0.002141770.046279220.0043167470.065701959 . . . CTR: dos & size: small0.000572530.023927520.0000009260.000962365 . . . CTR: dod & size: small0.000341760.018486640.0003830550.019571794 . . . cardinal: diagonal0.001665480.040810330.0009723180.031182012 . . . CTR: sod & cardinal: diagonal0.000046360.006808750.0002944480.017159499 . . . CTR: dos & cardinal: diagonal0.000000000.000000000.0000000000.000000000 . . . CTR: dod & cardinal: diagonal0.000001340.001157650.0000109750.003312812 . . . size: small & cardinal: diagonal0.000560440.023673540.0012540940.035413184 . . . CTR: sod & size: small & cardinal: diagonal0.000248840.015774510.0000007190.000847671 . . . CTR: dos & size: small & cardinal: diagonal0.000000000.000000000.0000000000.000000000 . . . CTR: dod & size: small & cardinal: diagonal0.000010780.003283640.0000010380.001019064 . . .Residual 0.036196640.190254140.0361966310.190254123
+
+
@@ -2413,13 +2465,13 @@

0.0173

- + - + @@ -2445,7 +2497,7 @@

0.0173

- + @@ -2547,13 +2599,13 @@

-
+
issingular(m_zcp1_rdc)
false
-
+
only(MixedModels.PCA(m_zcp1_rdc))

@@ -2578,10 +2630,10 @@ 

-
+
VarCorr(m_zcp1_rdc)
-
-

329.28 <1e-990.03080.1569
CTR: sod 0.0745 0.00779.679.66 <1e-21 0.0666
5.33 <1e-060.15690.0312
cardinal: diagonal
+
+
@@ -2610,8 +2662,8 @@

- - + + @@ -2621,8 +2673,8 @@

- - + + @@ -2644,7 +2696,7 @@

- + @@ -2654,8 +2706,8 @@

- - + + @@ -2665,8 +2717,8 @@

- - + + @@ -2692,7 +2744,7 @@

6.3 Model comparison 1

Let’s compare the three models.

-
+
gof_summary = let
   nms = [:m_zcp1_rdc, :m_zcp1, :m_max]
   mods = eval.(nms)
@@ -2711,9 +2763,9 @@ 

end

3×9 DataFrame
-

Subj (Intercept)0.00095140.03084520.02460220.1568508 CTR: sod0.00444060.06663780.00444080.0666395 . CTR: dod 0.00127520.03571050.0357098 . . . size: small0.02462380.15691960.00097310.0311946 . . . cardinal: diagonal0.00226780.04762170.00226790.0476222 . . .
+
- + @@ -2784,14 +2836,17 @@

6.4 Parsimonious LMM (1)

Extend zcp-reduced LMM with CPs

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

Row name dof
+
+
Minimizing 801    Time: 0:00:00 ( 0.18 ms/it)
+
+
+
@@ -2815,9 +2870,9 @@

(Intercept)

- + - + @@ -2849,7 +2904,7 @@

0.0176

- + @@ -2951,41 +3006,41 @@

-
-
issingular(m_prm1)
+
+
issingular(m_prm1)
false
-
-
only(MixedModels.PCA(m_prm1))
+
+
only(MixedModels.PCA(m_prm1))

 Principal components based on correlation matrix
  (Intercept)          1.0     .      .      .      .      .
- CTR: sod             0.65   1.0     .      .      .      .
- CTR: dos             0.17  -0.08   1.0     .      .      .
- CTR: dod             0.81   0.6    0.28   1.0     .      .
- size: small         -0.42  -0.15  -0.11  -0.03   1.0     .
+ CTR: sod             0.64   1.0     .      .      .      .
+ CTR: dos             0.16  -0.08   1.0     .      .      .
+ CTR: dod             0.79   0.6    0.28   1.0     .      .
+ size: small         -0.42  -0.16  -0.12  -0.03   1.0     .
  cardinal: diagonal   0.05  -0.05  -0.02   0.05   0.08   1.0
 
 Normalized cumulative variances:
-[0.4176, 0.6001, 0.7753, 0.9296, 0.9851, 1.0]
+[0.414, 0.5967, 0.772, 0.926, 0.9822, 1.0]
 
 Component loadings
                        PC1    PC2    PC3    PC4    PC5    PC6
- (Intercept)         -0.6    0.0    0.02   0.12  -0.34  -0.71
- CTR: sod            -0.5   -0.27   0.31  -0.11   0.76   0.05
- CTR: dos            -0.16   0.53  -0.71  -0.23   0.35  -0.09
- CTR: dod            -0.55  -0.17  -0.2   -0.26  -0.42   0.62
- size: small          0.24  -0.58  -0.24  -0.66  -0.02  -0.32
- cardinal: diagonal  -0.01  -0.53  -0.54   0.64   0.12   0.03
-
-
-
-
VarCorr(m_prm1)
-
-

5.6911 0.0176323.60323.61 <1e-990.11520.1181
CTR: sod5.23 <1e-060.11490.1119
cardinal: diagonal
+ (Intercept) -0.6 0.0 0.03 0.12 -0.37 -0.7 + CTR: sod -0.5 -0.26 0.31 -0.11 0.76 0.02 + CTR: dos -0.16 0.52 -0.72 -0.23 0.34 -0.11 + CTR: dod -0.55 -0.18 -0.2 -0.27 -0.4 0.63 + size: small 0.25 -0.59 -0.23 -0.66 -0.03 -0.32 + cardinal: diagonal -0.0 -0.53 -0.54 0.64 0.12 0.03 + + +
+
VarCorr(m_prm1)
+
+
@@ -3014,8 +3069,8 @@

- - + + @@ -3025,9 +3080,9 @@

- - - + + + @@ -3037,8 +3092,8 @@

- - + + @@ -3047,9 +3102,9 @@

- - - + + + @@ -3058,19 +3113,19 @@

- - + + - - + + - - + + @@ -3096,28 +3151,28 @@

6.5 Model comparison 2

-
-
gof_summary = let
-  nms = [:m_zcp1_rdc, :m_prm1, :m_max]
-  mods = eval.(nms)
-  lrt = MixedModels.likelihoodratiotest(m_prm1, m_zcp1, m_max)
-  DataFrame(;
-    name = nms, 
-    dof=dof.(mods),
-    deviance=round.(deviance.(mods), digits=0),
-    AIC=round.(aic.(mods),digits=0),
-    AICc=round.(aicc.(mods),digits=0),
-     BIC=round.(bic.(mods),digits=0),
-    χ²=vcat(:., round.(lrt.tests.deviancediff, digits=0)),
-    χ²_dof=vcat(:., round.(lrt.tests.dofdiff, digits=0)),
-    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
-  )
-end
+
+
gof_summary = let
+  nms = [:m_zcp1_rdc, :m_prm1, :m_max]
+  mods = eval.(nms)
+  lrt = MixedModels.likelihoodratiotest(m_prm1, m_zcp1, m_max)
+  DataFrame(;
+    name = nms, 
+    dof=dof.(mods),
+    deviance=round.(deviance.(mods), digits=0),
+    AIC=round.(aic.(mods),digits=0),
+    AICc=round.(aicc.(mods),digits=0),
+     BIC=round.(bic.(mods),digits=0),
+    χ²=vcat(:., round.(lrt.tests.deviancediff, digits=0)),
+    χ²_dof=vcat(:., round.(lrt.tests.dofdiff, digits=0)),
+    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
+  )
+end
3×9 DataFrame
-

Subj (Intercept)0.01327360.11521100.01395680.1181388 CTR: sod0.00435580.0659988+0.650.00435560.0659971+0.64 CTR: dos 0.00045360.0212982+0.170.0212981+0.16 -0.08 CTR: dod0.00106420.0326215+0.810.00106400.0326186+0.79 +0.60 +0.28 size: small0.01321180.11494270.01252690.1119239 -0.42-0.15-0.11-0.16-0.12 -0.03
cardinal: diagonal0.00226870.04763070.00226900.0476336 +0.05 -0.05 -0.02
+
- + @@ -3191,14 +3246,17 @@

7 Reduction strat

7.1 Complex LMM

Take out interaction VCs.

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

Row name dof
+
+
m_cpx = let
+  form = @formula log(rt) ~ 1 + CTR * size * cardinal + 
+                           (1 + CTR + size + cardinal | Subj)
+  fit(MixedModel, form, dat; contrasts)
+end
+
+
Minimizing 801    Time: 0:00:00 ( 0.19 ms/it)
+
+
+
@@ -3222,9 +3280,9 @@

(Intercept)

- + - + @@ -3256,7 +3314,7 @@

0.0176

- + @@ -3362,14 +3420,14 @@

7.2 Zero-correlation parameter LMM (2)

Take out interaction VCs.

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

5.6911 0.0176323.60323.61 <1e-990.11520.1181
CTR: sod5.23 <1e-060.11490.1119
cardinal: diagonal
+
+
m_zcp2 = let
+  form = @formula log(rt) ~ 1 + CTR * size * cardinal + 
+                   zerocorr(1 + CTR + size + cardinal | Subj)
+  fit(MixedModel, form, dat; contrasts)
+end
+
+
@@ -3395,13 +3453,13 @@

0.0173

- + - + @@ -3427,7 +3485,7 @@

0.0173

- + @@ -3532,28 +3590,28 @@

7.3 Model comparison 3

-
-
gof_summary = let
-  nms = [:m_zcp2, :m_cpx, :m_max]
-  mods = eval.(nms)
-  lrt = MixedModels.likelihoodratiotest(m_zcp2, m_cpx, m_max)
-  DataFrame(;
-    name = nms, 
-    dof=dof.(mods),
-    deviance=round.(deviance.(mods), digits=0),
-    AIC=round.(aic.(mods),digits=0),
-    AICc=round.(aicc.(mods),digits=0),
-     BIC=round.(bic.(mods),digits=0),
-    χ²=vcat(:., round.(lrt.tests.deviancediff, digits=0)),
-    χ²_dof=vcat(:., round.(lrt.tests.dofdiff, digits=0)),
-    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
-  )
-end
+
+
gof_summary = let
+  nms = [:m_zcp2, :m_cpx, :m_max]
+  mods = eval.(nms)
+  lrt = MixedModels.likelihoodratiotest(m_zcp2, m_cpx, m_max)
+  DataFrame(;
+    name = nms, 
+    dof=dof.(mods),
+    deviance=round.(deviance.(mods), digits=0),
+    AIC=round.(aic.(mods),digits=0),
+    AICc=round.(aicc.(mods),digits=0),
+     BIC=round.(bic.(mods),digits=0),
+    χ²=vcat(:., round.(lrt.tests.deviancediff, digits=0)),
+    χ²_dof=vcat(:., round.(lrt.tests.dofdiff, digits=0)),
+    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
+  )
+end
3×9 DataFrame
-
329.28 <1e-990.03080.1569
CTR: sod 0.0745 0.00779.679.66 <1e-21 0.0666
5.33 <1e-060.15690.0312
cardinal: diagonal
+
- + @@ -3625,47 +3683,47 @@

8 Check LMM for untransformed reaction times

We see the model is singular.

-
-
issingular(m_cpx_rt)
+
+
issingular(m_cpx_rt)
false
-
-
MixedModels.PCA(m_cpx_rt)
+
+
MixedModels.PCA(m_cpx_rt)
(Subj = 
 Principal components based on correlation matrix
  (Intercept)          1.0     .      .      .      .     .
  CTR: sod             0.85   1.0     .      .      .     .
- CTR: dos             0.57   0.19   1.0     .      .     .
+ CTR: dos             0.56   0.19   1.0     .      .     .
  CTR: dod             0.69   0.54   0.3    1.0     .     .
- size: small         -0.45  -0.24  -0.2   -0.14   1.0    .
- cardinal: diagonal  -0.07  -0.05  -0.08   0.12   0.2   1.0
+ size: small         -0.45  -0.23  -0.2   -0.13   1.0    .
+ cardinal: diagonal  -0.07  -0.05  -0.08   0.13   0.2   1.0
 
 Normalized cumulative variances:
-[0.4663, 0.6647, 0.8026, 0.9255, 0.9972, 1.0]
+[0.465, 0.6637, 0.8016, 0.9245, 0.9964, 1.0]
 
 Component loadings
                        PC1    PC2    PC3    PC4    PC5    PC6
- (Intercept)         -0.59  -0.01   0.02  -0.02  -0.17  -0.79
- CTR: sod            -0.49  -0.12   0.43  -0.22  -0.51   0.5
- CTR: dos            -0.35   0.13  -0.87  -0.05  -0.15   0.27
- CTR: dod            -0.45  -0.36   0.05  -0.13   0.79   0.17
- size: small          0.29  -0.5   -0.17  -0.77  -0.14  -0.17
- cardinal: diagonal   0.05  -0.77  -0.12   0.59  -0.21   0.01,)
+ (Intercept) -0.59 -0.01 -0.02 -0.01 -0.18 -0.79 + CTR: sod -0.49 -0.12 -0.43 -0.22 -0.51 0.5 + CTR: dos -0.35 0.13 0.87 -0.05 -0.15 0.27 + CTR: dod -0.45 -0.36 -0.05 -0.14 0.79 0.17 + size: small 0.29 -0.5 0.17 -0.77 -0.15 -0.17 + cardinal: diagonal 0.05 -0.77 0.12 0.59 -0.21 0.01,)

9 Other checks

-
-
m_prm1.θ
-m_prm1.lowerbd
-m_prm1.λ
+
+
m_prm1.θ
+m_prm1.lowerbd
+m_prm1.λ
1-element Vector{LinearAlgebra.LowerTriangular{Float64, Matrix{Float64}}}:
- [0.6049838282195861 0.0 … 0.0 0.0; 0.2268824761798831 0.26197767411858386 … 0.0 0.0; … ; -0.25599568302282616 0.10000084224161038 … 0.43113965746231486 0.0; 0.011755323411981199 -0.02654443700293925 … 0.030108319857208844 0.2458433904409567]
+ [0.6203576608179638 0.0 … 0.0 0.0; 0.22119994699720608 0.26678153140929256 … 0.0 0.0; … ; -0.24965193868875257 0.087476294698932 … 0.4357585158840971 0.0; 0.011471533099315563 -0.0255708216618361 … 0.02800749689407972 0.2461637872603555]
@@ -3679,39 +3737,47 @@

10 Diagnostic pl

10.1 Residual-over-fitted plot

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

-
-
+
+
Code -
CairoMakie.activate!(; type="png")
-scatter(fitted(m_prm1), residuals(m_prm1); alpha=0.3)
+
CairoMakie.activate!(; type="png")
+scatter(fitted(m_prm1), residuals(m_prm1); alpha=0.3)
-
-
-

-
Figure 3: Residuals versus fitted values for model m1
+
+
+
+ +
+
+Figure 3: Residuals versus fitted values for model m1 +

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

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

-
Figure 4: Heatmap of residuals versus fitted values for model m1
+
+
+
+ +
+
+Figure 4: Heatmap of residuals versus fitted values for model m1 +
@@ -3720,24 +3786,28 @@

10.2 Q-Q plot

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

-
-
+
+
Code -
CairoMakie.activate!(; type="png")
-qqnorm(
-  residuals(m_prm1);
-  qqline=:none,
-  axis=(;
-    xlabel="Standard normal quantiles",
-    ylabel="Quantiles of the residuals from model m1",
-  ),
-)
+
CairoMakie.activate!(; type="png")
+qqnorm(
+  residuals(m_prm1);
+  qqline=:none,
+  axis=(;
+    xlabel="Standard normal quantiles",
+    ylabel="Quantiles of the residuals from model m1",
+  ),
+)
-
-
-

-
Figure 5: Quantile-quantile plot of the residuals for model m1 versus a standard normal
+
+
+
+ +
+
+Figure 5: Quantile-quantile plot of the residuals for model m1 versus a standard normal +
@@ -3746,28 +3816,32 @@

10.3 Observed and theoretical 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(m_prm1) ./ std(residuals(m_prm1)), 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(m_prm1) ./ std(residuals(m_prm1)), randn(n)),
+    curve=repeat(["residual", "normal"]; inner=n),
+  )
+  draw(
+    data(dat_rz) *
+    mapping(:value; color=:curve) *
+    density(; bandwidth=0.1);
+  )
+end
-
-
-

-
Figure 6: Kernel density plot of the standardized residuals for model m1 versus a standard normal
+
+
+
+ +
+
+Figure 6: Kernel density plot of the standardized residuals for model m1 versus a standard normal +
@@ -3778,17 +3852,21 @@

11 Conditional modes

11.1 Caterpillar plot

-
-
+
+
Code -
cm1 = only(ranefinfo(m_prm1))
-caterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=2)
+
cm1 = only(ranefinfo(m_prm1))
+caterpillar!(Figure(; resolution=(800, 1200)), cm1; orderby=2)
-
-
-

-
Figure 7: Prediction intervals of the subject random effects in model m1
+
+
+
+ +
+
+Figure 7: Prediction intervals of the subject random effects in model m1 +
@@ -3798,16 +3876,20 @@

11.2 Shrinkage plot

11.2.1 Log-transformed reaction times (LMM m_prm1)

-
-
+
+
Code -
shrinkageplot!(Figure(; resolution=(1000, 1200)), m_prm1)
+
shrinkageplot!(Figure(; resolution=(1000, 1200)), m_prm1)
-
-
-

-
Figure 8: Shrinkage plots of the subject random effects in model m1L
+
+
+
+ +
+
+Figure 8: Shrinkage plots of the subject random effects in model m1L +
@@ -3826,88 +3908,92 @@

12 Parametric bo

12.1 Generate a bootstrap sample

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

-
-
samp = parametricbootstrap(MersenneTwister(1234321), 2500, m_prm1;
-                           optsum_overrides=(; ftol_rel=1e-8));
+
+
samp = parametricbootstrap(MersenneTwister(1234321), 2500, m_prm1;
+                           optsum_overrides=(; ftol_rel=1e-8));
-
-
tbl = samp.tbl
+
+
tbl = samp.tbl
Table with 60 columns and 2500 rows:
       obj       β01      β02        β03        β04           β05        ⋯
     ┌────────────────────────────────────────────────────────────────────
- 1  │ -25127.6  5.68035  0.0688001  0.0392973  -0.00145663   0.0787668  ⋯
- 2  │ -24468.3  5.66034  0.0667012  0.0419099  -0.0030519    0.101304   ⋯
- 3  │ -24449.7  5.69174  0.0780382  0.0369839  0.00816495    0.0989127  ⋯
- 4  │ -24617.3  5.69638  0.0764423  0.0462439  -0.00308679   0.0637598  ⋯
- 5  │ -25167.0  5.68389  0.068439   0.0386046  0.00251638    0.118072   ⋯
- 6  │ -24728.1  5.69415  0.0843714  0.0442253  0.00185698    0.0939094  ⋯
- 7  │ -24428.1  5.67697  0.0706145  0.0418625  -0.00634554   0.076476   ⋯
- 8  │ -24805.8  5.69362  0.0765357  0.0458005  0.00313531    0.0850595  ⋯
- 9  │ -24400.7  5.68439  0.0817143  0.0496347  -0.00119184   0.0990601  ⋯
- 10 │ -24582.0  5.68727  0.0795533  0.0344762  0.00625507    0.0814397  ⋯
- 11 │ -25084.6  5.66647  0.0663197  0.0445303  -0.000770577  0.0943553  ⋯
- 12 │ -24359.4  5.67795  0.0698423  0.0446405  -0.000923597  0.102352   ⋯
- 13 │ -24972.7  5.69036  0.0731457  0.0421428  -0.00289982   0.0838288  ⋯
- 14 │ -24600.3  5.70243  0.077052   0.0432847  -0.00472417   0.0703121  ⋯
- 15 │ -24777.5  5.68292  0.0825502  0.0371673  0.00390284    0.0888287  ⋯
- 16 │ -24629.7  5.69743  0.0718797  0.0408727  0.000339444   0.0867852  ⋯
- 17 │ -24397.3  5.70718  0.0968228  0.0363888  0.00139831    0.0865995  ⋯
- 18 │ -24835.3  5.73078  0.0755976  0.0424913  0.00755783    0.0478996  ⋯
- 19 │ -24809.3  5.68501  0.0744206  0.03695    0.00608847    0.0528375  ⋯
- 20 │ -24235.8  5.68535  0.0690913  0.0481881  -0.000179217  0.0732135  ⋯
- 21 │ -24927.0  5.67932  0.0665278  0.0441583  0.000844678   0.0949294  ⋯
- 22 │ -24055.2  5.68235  0.0676653  0.0365035  0.0108546     0.096414   ⋯
- 23 │ -24802.3  5.72256  0.082965   0.0393546  0.00894391    0.0951108  ⋯
+ 1  │ -25123.8  5.68038  0.068683   0.039261   -0.00165125   0.0793335  ⋯
+ 2  │ -24465.9  5.66021  0.0667158  0.0418969  -0.00305185   0.100958   ⋯
+ 3  │ -24446.4  5.6924   0.0778707  0.0369443  0.00797653    0.100114   ⋯
+ 4  │ -24617.7  5.69562  0.0766171  0.0463011  -0.00297233   0.0639383  ⋯
+ 5  │ -25167.8  5.68415  0.0684032  0.0385817  0.00248626    0.118136   ⋯
+ 6  │ -24727.8  5.69527  0.0843717  0.0442493  0.00193816    0.0936532  ⋯
+ 7  │ -24512.0  5.67742  0.0707211  0.0418414  -0.00641572   0.076351   ⋯
+ 8  │ -24798.9  5.69362  0.0765456  0.0458011  0.00328823    0.084062   ⋯
+ 9  │ -24392.5  5.68477  0.0818642  0.0496969  -0.000832281  0.0977178  ⋯
+ 10 │ -24585.7  5.68801  0.0796325  0.0344963  0.00629559    0.081441   ⋯
+ 11 │ -25078.8  5.66697  0.0663796  0.0445354  -0.000736944  0.0943102  ⋯
+ 12 │ -24348.5  5.67785  0.0698993  0.0446523  -0.000859312  0.102561   ⋯
+ 13 │ -24973.2  5.68851  0.0732837  0.0421743  -0.00279674   0.0830709  ⋯
+ 14 │ -24617.9  5.70183  0.07733    0.0433379  -0.00455447   0.0694739  ⋯
+ 15 │ -24775.8  5.68347  0.0825422  0.0371819  0.00388279    0.0889206  ⋯
+ 16 │ -24628.0  5.69649  0.0718965  0.0408693  0.000221452   0.0878074  ⋯
+ 17 │ -24397.7  5.70743  0.0966594  0.0363991  0.00133149    0.087301   ⋯
+ 18 │ -24836.3  5.73132  0.0753929  0.0424585  0.00735246    0.0482915  ⋯
+ 19 │ -24806.7  5.68484  0.0744908  0.0369567  0.0060191     0.0529119  ⋯
+ 20 │ -24234.2  5.6857   0.0691212  0.0481745  -6.76522e-5   0.0718787  ⋯
+ 21 │ -24927.4  5.67965  0.066628   0.0441619  0.000997131   0.0939013  ⋯
+ 22 │ -24044.7  5.68194  0.0675943  0.0364103  0.0108015     0.096463   ⋯
+ 23 │ -24804.0  5.72333  0.0826845  0.0393307  0.00877465    0.0955252  ⋯
  ⋮  │    ⋮         ⋮         ⋮          ⋮           ⋮            ⋮      ⋱

12.2 Shortest coverage interval

-
-
confint(samp)
+
+
confint(samp)
DictTable with 2 columns and 38 rows:
  par   lower        upper
  ────┬────────────────────────
- β01 │ 5.65997      5.72809
- β02 │ 0.0598876    0.089922
- β03 │ 0.0326416    0.048975
- β04 │ -0.00822446  0.0115422
- β05 │ 0.0591123    0.125524
- β06 │ 0.0105076    0.0313854
- β07 │ 0.00966951   0.0388016
- β08 │ -0.0137103   0.0032854
- β09 │ 0.00787913   0.0275659
- β10 │ 0.00486878   0.0157214
- β11 │ -0.002493    0.0117915
- β12 │ -0.0124759   0.00201148
- β13 │ -0.00584269  0.0136539
- β14 │ -0.00829081  0.00227456
- β15 │ -0.00759625  0.0068184
- β16 │ 0.00368526   0.017989
- ρ01 │ 0.378934     1.0
- ρ02 │ -0.366611    0.999987
- ρ03 │ -0.559253    0.734999
- ρ04 │ 0.462208     0.993396
- ρ05 │ 0.333833     0.890025
- ρ06 │ -0.305646    0.902777
- ρ07 │ -0.737826    -0.0686956
+ β01 │ 5.65966      5.72791
+ β02 │ 0.0602683    0.0902347
+ β03 │ 0.0326438    0.0490006
+ β04 │ -0.00832038  0.0114628
+ β05 │ 0.0585181    0.124489
+ β06 │ 0.00932821   0.030229
+ β07 │ 0.00994937   0.0391542
+ β08 │ -0.0138358   0.00317468
+ β09 │ 0.00770406   0.0274789
+ β10 │ 0.00485596   0.0157058
+ β11 │ -0.00249685  0.0117935
+ β12 │ -0.0124823   0.00202088
+ β13 │ -0.00582681  0.0137215
+ β14 │ -0.00828443  0.00227533
+ β15 │ -0.00842329  0.00599236
+ β16 │ 0.00369609   0.0179879
+ ρ01 │ 0.380561     1.0
+ ρ02 │ -0.342485    0.999999
+ ρ03 │ -0.685044    0.682981
+ ρ04 │ 0.466487     0.989877
+ ρ05 │ 0.330399     0.883748
+ ρ06 │ -0.273379    0.932581
+ ρ07 │ -0.729693    -0.0549567
   ⋮  │      ⋮           ⋮

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)
-
-
-

-
Figure 9: Ridge plot of fixed-effects bootstrap samples from model m1L
+
+
+
+ +
+
+Figure 9: Ridge plot of fixed-effects bootstrap samples from model m1L +
@@ -3917,21 +4003,25 @@

12.3 Comparative density plots of bootstrapped parameter estimates

12.3.1 Residual

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

-
Figure 10: Kernel density estimate from bootstrap samples of the residual standard deviation for model m_prm1
+
+
+
+ +
+
+Figure 10: Kernel density estimate from bootstrap samples of the residual standard deviation for model m_prm1 +
@@ -3940,63 +4030,71 @@

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

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

-
-
+
+
Code -
rn = renamer([
-  "(Intercept)" => "GM",
-  "CTR: sod" => "spatial effect",
-  "CTR: dos" => "object effect",
-  "CTR: dod" => "attraction effect",
-  "(Intercept), CTR: sod" => "GM, spatial",
-  "(Intercept), CTR: dos" => "GM, object",
-  "CTR: sod, CTR: dos" => "spatial, object",
-  "(Intercept), CTR: dod" => "GM, attraction",
-  "CTR: sod, CTR: dod" => "spatial, attraction",
-  "CTR: dos, CTR: dod" => "object, attraction",
-])
-draw(
-  data(tbl) *
-  mapping(
-    [:β02, :β03, :β04] .=> "Experimental effect size [ms]";
-    color=dims(1) => 
-    renamer(["spatial effect", "object effect", "attraction effect"]) =>
-    "Experimental effects",
-  ) *
-  density();
-  figure=(; resolution=(800, 350)),
-)
+
rn = renamer([
+  "(Intercept)" => "GM",
+  "CTR: sod" => "spatial effect",
+  "CTR: dos" => "object effect",
+  "CTR: dod" => "attraction effect",
+  "(Intercept), CTR: sod" => "GM, spatial",
+  "(Intercept), CTR: dos" => "GM, object",
+  "CTR: sod, CTR: dos" => "spatial, object",
+  "(Intercept), CTR: dod" => "GM, attraction",
+  "CTR: sod, CTR: dod" => "spatial, attraction",
+  "CTR: dos, CTR: dod" => "object, attraction",
+])
+draw(
+  data(tbl) *
+  mapping(
+    [:β02, :β03, :β04] .=> "Experimental effect size [ms]";
+    color=dims(1) => 
+    renamer(["spatial effect", "object effect", "attraction effect"]) =>
+    "Experimental effects",
+  ) *
+  density();
+  figure=(; resolution=(800, 350)),
+)
-
-
-

-
Figure 11: Kernel density estimate from bootstrap samples of the fixed effects for model m_prm1
+
+
+
+ +
+
+Figure 11: Kernel density estimate from bootstrap samples of the fixed effects for model m_prm1 +

The densitiies correspond nicely with the shortest coverage intervals.

-
-
+
+
Code -
draw(
-  data(tbl) *
-  mapping(
-    [:σ2, :σ3, :σ4] .=> "Standard deviations [ms]";
-    color=dims(1) =>
-    renamer(["spatial effect", "object effect", "attraction effect"]) =>
-    "Variance components",
-  ) *
-  density();
-  figure=(; resolution=(800, 350)),
-)
+
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)),
+)
-
-
-

-
Figure 12: Kernel density estimate from bootstrap samples of the standard deviations for model m1L (excluding Grand Mean)
+
+
+
+ +
+
+Figure 12: Kernel density estimate from bootstrap samples of the standard deviations for model m1L (excluding Grand Mean) +
@@ -4005,27 +4103,31 @@

12.3.3 Correlation parameters (CPs)

-
-
+
+
Code -
draw(
-  data(tbl) *
-  mapping(
-    [:ρ01, :ρ02, :ρ03, :ρ04, :ρ05, :ρ06] .=> "Correlation";
-    color=dims(1) =>
-    renamer(["GM, spatial", "GM, object", "spatial, object",
-    "GM, attraction", "spatial, attraction", "object, attraction"]) =>
-    "Correlation parameters",
-  ) *
-  density();
-  figure=(; resolution=(800, 350)),
-)
+
draw(
+  data(tbl) *
+  mapping(
+    [:ρ01, :ρ02, :ρ03, :ρ04, :ρ05, :ρ06] .=> "Correlation";
+    color=dims(1) =>
+    renamer(["GM, spatial", "GM, object", "spatial, object",
+    "GM, attraction", "spatial, attraction", "object, attraction"]) =>
+    "Correlation parameters",
+  ) *
+  density();
+  figure=(; resolution=(800, 350)),
+)
-
-
-

-
Figure 13: Kernel density estimate from bootstrap samples of the standard deviations for model m1L
+
+
+
+ +
+
+Figure 13: Kernel density estimate from bootstrap samples of the standard deviations for model m1L +
@@ -4037,7 +4139,7 @@

13 References

-
+
Baayen, H., Vasishth, S., Kliegl, R., & Bates, D. (2017). The cave of shadows: Addressing the human factor with generalized additive mixed models. Journal of Memory and Language, 94, 206–234. https://doi.org/10.1016/j.jml.2016.11.006
@@ -4099,6 +4201,33 @@

13 References { + const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light'; + const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark'; + let newTheme = ''; + if(darkModeDefault) { + newTheme = isAlternate ? baseTheme : alternateTheme; + } else { + newTheme = isAlternate ? alternateTheme : baseTheme; + } + const changeGiscusTheme = () => { + // From: https://github.com/giscus/giscus/issues/336 + const sendMessage = (message) => { + const iframe = document.querySelector('iframe.giscus-frame'); + if (!iframe) return; + iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app'); + } + sendMessage({ + setConfig: { + theme: newTheme + } + }); + } + const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null; + if (isGiscussLoaded) { + changeGiscusTheme(); + } + } const toggleColorMode = (alternate) => { // Switch the stylesheets const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate'); @@ -4165,13 +4294,15 @@

13 References { // Read the current dark / light value let toAlternate = !hasAlternateSentinel(); toggleColorMode(toAlternate); setStyleSentinel(toAlternate); + toggleGiscusIfUsed(toAlternate, darkModeDefault); }; // Ensure there is a toggle, if there isn't float one in the top right if (window.document.querySelector('.quarto-color-scheme-toggle') === null) { @@ -4206,18 +4337,7 @@

13 References13 References { + return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); + } + // Inspect non-navigation links and adorn them if external + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)'); + for (var i=0; i13 References13 References { + // Strip column container classes + const stripColumnClz = (el) => { + el.classList.remove("page-full", "page-columns"); + if (el.children) { + for (const child of el.children) { + stripColumnClz(child); + } + } + } + stripColumnClz(note) + if (id === null || id.startsWith('sec-')) { + // Special case sections, only their first couple elements + const container = document.createElement("div"); + if (note.children && note.children.length > 2) { + container.appendChild(note.children[0].cloneNode(true)); + for (let i = 1; i < note.children.length; i++) { + const child = note.children[i]; + if (child.tagName === "P" && child.innerText === "") { + continue; + } else { + container.appendChild(child.cloneNode(true)); + break; + } + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(container); + } + return container.innerHTML + } else { + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + return note.innerHTML; + } + } else { + // Remove any anchor links if they are present + const anchorLink = note.querySelector('a.anchorjs-link'); + if (anchorLink) { + anchorLink.remove(); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + // TODO in 1.5, we should make sure this works without a callout special case + if (note.classList.contains("callout")) { + return note.outerHTML; + } else { + return note.innerHTML; + } + } + } + for (var i=0; i res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.getElementById(id); + if (note !== null) { + const html = processXRef(id, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + } else { + // See if we can fetch a full url (with no hash to target) + // This is a special case and we should probably do some content thinning / targeting + fetch(url) + .then(res => res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.querySelector('main.content'); + if (note !== null) { + // This should only happen for chapter cross references + // (since there is no id in the URL) + // remove the first header + if (note.children.length > 0 && note.children[0].tagName === "HEADER") { + note.children[0].remove(); + } + const html = processXRef(null, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + }, function(instance) { }); } let selectedAnnoteEl; @@ -4320,6 +4611,7 @@

13 References13 References { + elRect = undefined; + if (selectedAnnoteEl) { + selectCodeLines(selectedAnnoteEl); + } + }, 10) + ); + function throttle(fn, ms) { + let throttle = false; + let timer; + return (...args) => { + if(!throttle) { // first call gets through + fn.apply(this, args); + throttle = true; + } else { // all the others get throttled + if(timer) clearTimeout(timer); // cancel #2 + timer = setTimeout(() => { + fn.apply(this, args); + timer = throttle = false; + }, ms); + } + }; + } // Attach click handler to the DT const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); for (const annoteDlNode of annoteDls) { @@ -4406,12 +4724,12 @@

13 References

+ +

1 Background

We take the kwdyz11 dataset (Kliegl et al., 2011) from an experiment looking at three effects of visual cueing under four different cue-target relations (CTRs). Two horizontal rectangles are displayed above and below a central fixation point or they displayed in vertical orientation to the left and right of the fixation point. Subjects react to the onset of a small visual target occurring at one of the four ends of the two rectangles. The target is cued validly on 70% of trials by a brief flash of the corner of the rectangle at which it appears; it is cued invalidly at the three other locations 10% of the trials each.

@@ -428,8 +471,8 @@

1 Background

2 Packages

-
-
+
+
Code
using AlgebraOfGraphics
 using AlgebraOfGraphics: density
@@ -454,14 +497,14 @@ 

2 Packages

3 Read data, compute and plot densities and means

-
+
dat = DataFrame(dataset(:kwdyz11))
 describe(dat)
5×7 DataFrame
-

Row name dof
+
- + @@ -541,9 +584,9 @@

3 Read data, comp

We recommend to code the levels/units of random factor / grouping variable not as a number, but as a string starting with a letter and of the same length for all levels/units.

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.

-
-
+

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(
   data(dat) *
@@ -556,10 +599,14 @@ 

3 Read data, comp )

-
-
-

-
Figure 1: Comparative density plots of log reaction time for different cue-target relations.
+
+
+
+ +
+
+Figure 1: Comparative density plots of log reaction time for different cue-target relations. +
@@ -567,7 +614,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,
@@ -578,9 +625,9 @@ 

3 Read data, comp dat_subj

244×5 DataFrame
219 rows omitted
-

Row variable mean
+
- + @@ -811,8 +858,8 @@

3 Read data, comp -
-
+
+
Code
boxplot(
   dat_subj.CTR.refs,
@@ -834,10 +881,14 @@ 

3 Read data, comp )

-
-
-

-
Figure 2: Comparative boxplots of log response time by cue-target relation.
+
+
+
+ +
+
+Figure 2: Comparative boxplots of log response time by cue-target relation. +
@@ -848,7 +899,7 @@

3 Read data, comp

4 Linear mixed model

-
+
contrasts = Dict(
   :CTR => SeqDiffCoding(; levels=["val", "sod", "dos", "dod"]),
   :Subj => Grouping(),
@@ -858,10 +909,11 @@ 

4 Linear mixed mo fit(MixedModel, form, dat; contrasts) end

-
Minimizing 242    Time: 0:00:00 ( 1.06 ms/it)
+
Minimizing 240    Time: 0:00:00 ( 1.40 ms/it)
+  objective:  -12782.373697791405
-
-

Row Subj CTR
+
+
@@ -877,7 +929,7 @@

4 Linear mixed mo

- + @@ -917,10 +969,10 @@

4 Linear mixed mo

(Intercept) 5.9358 0.0185320.53320.54 <1e-99 0.1441
-
+
VarCorr(m1)
-
- +
+
@@ -945,8 +997,8 @@

4 Linear mixed mo

- - + + @@ -954,8 +1006,8 @@

4 Linear mixed mo

- - + + @@ -963,8 +1015,8 @@

4 Linear mixed mo

- - + + @@ -973,7 +1025,7 @@

4 Linear mixed mo

- + @@ -981,8 +1033,8 @@

4 Linear mixed mo

- - + + @@ -991,14 +1043,14 @@

4 Linear mixed mo

Subj (Intercept)0.02076540.14410210.02076360.1440957
CTR: sod0.00338490.05817950.00338480.0581791 +0.48
CTR: dos0.00075290.02743990.00075280.0274366 -0.24 -0.15 CTR: dod 0.00062200.02494090.0249400 +0.30 +0.93 -0.43
Residual 0.03685430.19197480.03685440.1919749
-
+
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))

@@ -1009,7 +1061,7 @@ 

4 Linear mixed mo CTR: dod 0.3 0.93 -0.43 1.0 Normalized cumulative variances: -[0.5886, 0.8095, 1.0, 1.0] +[0.5887, 0.8095, 1.0, 1.0] Component loadings PC1 PC2 PC3 PC4 @@ -1030,8 +1082,8 @@

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!()
@@ -1042,17 +1094,21 @@ 

)

-
-
-

-
Figure 3: Residuals versus the fitted values for model m1 of the log response time.
+
+
+
+ +
+
+Figure 3: Residuals versus the fitted values for model m1 of the log response time. +

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

-
-
+
+
Code
CairoMakie.activate!(; type="png")
 draw(
@@ -1064,10 +1120,14 @@ 

)

-
-
-

-
Figure 4: Heatmap of residuals versus fitted values for model m1
+
+
+
+ +
+
+Figure 4: Heatmap of residuals versus fitted values for model m1 +
@@ -1076,18 +1136,22 @@

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)
-

+
+
+

+
+

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.

-
-
+

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)
@@ -1103,10 +1167,14 @@ 

end

-
-
-

-
Figure 5: Kernel density plot of the standardized residuals from model m1 compared to a Gaussian
+
+
+
+ +
+
+Figure 5: Kernel density plot of the standardized residuals from model m1 compared to a Gaussian +
@@ -1128,19 +1196,23 @@

6.2 Caterpillar plot

-

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

-
-
+

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
 )
-
-
-

-
Figure 6: Prediction intervals on the random effects for Subj in model m1
+
+
+
+ +
+
+Figure 6: Prediction intervals on the random effects for Subj in model m1 +
@@ -1148,17 +1220,21 @@

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.

-
-
+

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)
-
-
-

-
Figure 7: Shrinkage plot of the conditional means of the random effects for model m1
+
+
+
+ +
+
+Figure 7: Shrinkage plot of the conditional means of the random effects for model m1 +
@@ -1176,8 +1252,8 @@

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)
@@ -1187,29 +1263,29 @@ 

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)
@@ -1227,20 +1303,20 @@

7.4 Residual

-
-
+
+
Code
draw(
   data(tbl) *
@@ -1259,10 +1335,13 @@ 

)

-
-
-

-
Figure 8: ?(caption)
+
+
+
+ +
+
+
@@ -1271,8 +1350,8 @@

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 include its density here.

-
-
+
+
Code
labels = [
   "CTR: sod" => "spatial effect",
@@ -1291,10 +1370,14 @@ 

)

-
-
-

-
Figure 9: Comparative density plots of the fixed-effects parameters for model m1
+
+
+
+ +
+
+Figure 9: Comparative density plots of the fixed-effects parameters for model m1 +
@@ -1303,8 +1386,8 @@

7.6 Variance components (VCs)

-
-
+
+
Code
draw(
   data(tbl) *
@@ -1318,10 +1401,14 @@ 

)

-
-
-

-
Figure 10: Comparative density plots of the variance components for model m1
+
+
+
+ +
+
+Figure 10: Comparative density plots of the variance components for model m1 +
@@ -1330,8 +1417,8 @@

7.7 Correlation parameters (CPs)

-
-
+
+
Code
let
   labels = [
@@ -1353,10 +1440,14 @@ 

end

-
-
-

-
Figure 11: Comparative density plots of the correlation parameters for model m1
+
+
+
+ +
+
+Figure 11: Comparative density plots of the correlation parameters for model m1 +
@@ -1366,7 +1457,7 @@

8 References

-
+
Bates, D., Kliegl, R., Vasishth, S., & Baayen, H. (2015). Parsimonious mixed models. arXiv. https://doi.org/10.48550/ARXIV.1506.04967
@@ -1425,6 +1516,33 @@

8 References

} } } + const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => { + const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light'; + const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark'; + let newTheme = ''; + if(darkModeDefault) { + newTheme = isAlternate ? baseTheme : alternateTheme; + } else { + newTheme = isAlternate ? alternateTheme : baseTheme; + } + const changeGiscusTheme = () => { + // From: https://github.com/giscus/giscus/issues/336 + const sendMessage = (message) => { + const iframe = document.querySelector('iframe.giscus-frame'); + if (!iframe) return; + iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app'); + } + sendMessage({ + setConfig: { + theme: newTheme + } + }); + } + const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null; + if (isGiscussLoaded) { + changeGiscusTheme(); + } + } const toggleColorMode = (alternate) => { // Switch the stylesheets const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate'); @@ -1491,13 +1609,15 @@

8 References

return localAlternateSentinel; } } - let localAlternateSentinel = 'default'; + const darkModeDefault = false; + let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default'; // Dark / light mode switch window.quartoToggleColorScheme = () => { // Read the current dark / light value let toAlternate = !hasAlternateSentinel(); toggleColorMode(toAlternate); setStyleSentinel(toAlternate); + toggleGiscusIfUsed(toAlternate, darkModeDefault); }; // Ensure there is a toggle, if there isn't float one in the top right if (window.document.querySelector('.quarto-color-scheme-toggle') === null) { @@ -1532,18 +1652,7 @@

8 References

} return false; } - const clipboard = new window.ClipboardJS('.code-copy-button', { - text: function(trigger) { - const codeEl = trigger.previousElementSibling.cloneNode(true); - for (const childEl of codeEl.children) { - if (isCodeAnnotation(childEl)) { - childEl.remove(); - } - } - return codeEl.innerText; - } - }); - clipboard.on('success', function(e) { + const onCopySuccess = function(e) { // button target const button = e.trigger; // don't keep focus @@ -1575,11 +1684,50 @@

8 References

}, 1000); // clear code selection e.clearSelection(); + } + const getTextToCopy = function(trigger) { + const codeEl = trigger.previousElementSibling.cloneNode(true); + for (const childEl of codeEl.children) { + if (isCodeAnnotation(childEl)) { + childEl.remove(); + } + } + return codeEl.innerText; + } + const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', { + text: getTextToCopy }); - function tippyHover(el, contentFn) { + clipboard.on('success', onCopySuccess); + if (window.document.getElementById('quarto-embedded-source-code-modal')) { + // For code content inside modals, clipBoardJS needs to be initialized with a container option + // TODO: Check when it could be a function (https://github.com/zenorocha/clipboard.js/issues/860) + const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', { + text: getTextToCopy, + container: window.document.getElementById('quarto-embedded-source-code-modal') + }); + clipboardModal.on('success', onCopySuccess); + } + var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); + var mailtoRegex = new RegExp(/^mailto:/); + var filterRegex = new RegExp("https:\/\/RePsychLing\.github\.io\/SMLP2023"); + var isInternal = (href) => { + return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); + } + // Inspect non-navigation links and adorn them if external + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)'); + for (var i=0; i8 References

interactive: true, interactiveBorder: 10, theme: 'quarto', - placement: 'bottom-start' + placement: 'bottom-start', }; + if (contentFn) { + config.content = contentFn; + } + if (onTriggerFn) { + config.onTrigger = onTriggerFn; + } + if (onUntriggerFn) { + config.onUntrigger = onUntriggerFn; + } window.tippy(el, config); } const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]'); @@ -1602,7 +1759,130 @@

8 References

try { href = new URL(href).hash; } catch {} const id = href.replace(/^#\/?/, ""); const note = window.document.getElementById(id); - return note.innerHTML; + if (note) { + return note.innerHTML; + } else { + return ""; + } + }); + } + const xrefs = window.document.querySelectorAll('a.quarto-xref'); + const processXRef = (id, note) => { + // Strip column container classes + const stripColumnClz = (el) => { + el.classList.remove("page-full", "page-columns"); + if (el.children) { + for (const child of el.children) { + stripColumnClz(child); + } + } + } + stripColumnClz(note) + if (id === null || id.startsWith('sec-')) { + // Special case sections, only their first couple elements + const container = document.createElement("div"); + if (note.children && note.children.length > 2) { + container.appendChild(note.children[0].cloneNode(true)); + for (let i = 1; i < note.children.length; i++) { + const child = note.children[i]; + if (child.tagName === "P" && child.innerText === "") { + continue; + } else { + container.appendChild(child.cloneNode(true)); + break; + } + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(container); + } + return container.innerHTML + } else { + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + return note.innerHTML; + } + } else { + // Remove any anchor links if they are present + const anchorLink = note.querySelector('a.anchorjs-link'); + if (anchorLink) { + anchorLink.remove(); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + // TODO in 1.5, we should make sure this works without a callout special case + if (note.classList.contains("callout")) { + return note.outerHTML; + } else { + return note.innerHTML; + } + } + } + for (var i=0; i res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.getElementById(id); + if (note !== null) { + const html = processXRef(id, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + } else { + // See if we can fetch a full url (with no hash to target) + // This is a special case and we should probably do some content thinning / targeting + fetch(url) + .then(res => res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.querySelector('main.content'); + if (note !== null) { + // This should only happen for chapter cross references + // (since there is no id in the URL) + // remove the first header + if (note.children.length > 0 && note.children[0].tagName === "HEADER") { + note.children[0].remove(); + } + const html = processXRef(null, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + }, function(instance) { }); } let selectedAnnoteEl; @@ -1646,6 +1926,7 @@

8 References

} div.style.top = top - 2 + "px"; div.style.height = height + 4 + "px"; + div.style.left = 0; let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter"); if (gutterDiv === null) { gutterDiv = window.document.createElement("div"); @@ -1671,6 +1952,32 @@

8 References

}); selectedAnnoteEl = undefined; }; + // Handle positioning of the toggle + window.addEventListener( + "resize", + throttle(() => { + elRect = undefined; + if (selectedAnnoteEl) { + selectCodeLines(selectedAnnoteEl); + } + }, 10) + ); + function throttle(fn, ms) { + let throttle = false; + let timer; + return (...args) => { + if(!throttle) { // first call gets through + fn.apply(this, args); + throttle = true; + } else { // all the others get throttled + if(timer) clearTimeout(timer); // cancel #2 + timer = setTimeout(() => { + fn.apply(this, args); + timer = throttle = false; + }, ms); + } + }; + } // Attach click handler to the DT const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); for (const annoteDlNode of annoteDls) { @@ -1732,12 +2039,12 @@

8 References

+ + +
+

1 A large-scale designed experiment

Load the packages to be used.

-
-
+
+
Code
using AlgebraOfGraphics
 using Arrow
@@ -420,8 +438,9 @@ 

A large-scale designed experiment

The English Lexicon Project (Balota et al., 2007) was a large-scale multicenter study to examine properties of English words. It incorporated both a lexical decision task and a word recognition task. Different groups of subjects participated in the different tasks.

-
-

1 Extracting data tables from the raw data

+
+
+

2 Extracting data tables from the raw data

The raw data are available as an OSF project as Zip files for each of the tasks. These Zip files contain one data file for each participant, which has a mixture of demographic data, responses on some pre-tests, and the actual trial runs.

Parsing these data files is not fun – see this repository for some of the code used to untangle the data. (This repository is an unregistered Julia package.)

Some lessons from this:

@@ -436,11 +455,11 @@

1 Extracting data
  • Remember, the data are only as useful as their provenance. If you invested a lot of time and money in gathering the data you should treat it as a valued resource and exercise great care with it.
  • The Arrow.jl package allows you to add metadata as key/value pairs, called a Dict (or dictionary). Use this capability. The name of the file is not a suitable location for metadata.
  • -
    -

    1.1 Trial-level data from the LDT

    +
    +

    2.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:
    @@ -459,14 +478,14 @@ 

    +
    ldttrial = @transform(DataFrame(ldttrial), :s2 = :seq > 2000)
     describe(ldttrial)
    6×7 DataFrame
    - +
    - + @@ -554,15 +573,15 @@

    -

    1.2 Initial data exploration

    +
    +

    2.2 Initial data exploration

    From the basic summary of ldttrial we can see that there are some questionable response times — negative values and values over 32 seconds.

    Because of obvious outliers we will use the median response time, which is not strongly influenced by outliers, rather than the mean response time when summarizing by item or by subject.

    Also, there are missing values of the accuracy. We should check if these are associated with particular subjects or particular items.

    -
    -

    1.2.1 Summaries by item

    +
    +

    2.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(
    @@ -578,9 +597,9 @@ 

    end

    80962×7 DataFrame
    80937 rows omitted
    -
    Row variable mean
    +
    - + @@ -868,14 +887,14 @@

    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)
    8×7 DataFrame
    -

    Row item ni
    +
    - + @@ -983,13 +1002,13 @@

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

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

    Row variable mean
    +
    - + @@ -1119,7 +1138,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,
    @@ -1129,9 +1148,9 @@ 

    )

    8×7 DataFrame
    -

    Row item ni
    +
    - + @@ -1240,13 +1259,13 @@

    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
    -

    Row variable mean
    +
    - + @@ -1369,9 +1388,9 @@

    -

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

    -
    -
    +

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

    +
    +
    Code
    let
       wlen = 1:21
    @@ -1383,17 +1402,21 @@ 

    end

    -
    -
    -

    -
    Figure 1: Barchart of word lengths in the items used in the lexical decision task.
    +
    +
    +
    + +
    +
    +Figure 1: Barchart of word lengths in the items used in the lexical decision task. +
    -

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

    -
    -
    +

    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
       itemsummry = combine(
    @@ -1419,20 +1442,24 @@ 

    end

    -
    -
    -

    -
    Figure 2: Proportion of accurate trials in the LDT versus word length separately for words and non-words. The area of the marker is proportional to the number of observations represented.
    +
    +
    +
    + +
    +
    +Figure 2: Proportion of accurate trials in the LDT versus word length separately for words and non-words. The area of the marker is proportional to the number of observations represented. +

    The pattern in the range of word lengths with non-negligible counts (there are points in the plot down to word lengths of 1 and up to word lengths of 21 but these points are very small) is that the accuracy for words is nearly constant at about 84% and the accuracy for nonwords is slightly higher until lengths of 13, at which point it falls off a bit.

    -
    -

    1.2.2 Summaries by subject

    +
    +

    2.2.2 Summaries by subject

    A summary of accuracy and median response time by subject

    -
    +
    bysubj = @chain ldttrial begin
       groupby(:subj)
       @combine(
    @@ -1445,9 +1472,9 @@ 

    end

    814×6 DataFrame
    789 rows omitted
    -

    Row variable mean
    +
    - + @@ -1707,13 +1734,13 @@

    shows some anomalies

    -
    +
    describe(bysubj)
    6×7 DataFrame
    -

    Row subj ns
    +
    - + @@ -1800,9 +1827,9 @@

    -

    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.

    -
    -
    +

    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(
       data(bysubj) *
    @@ -1814,33 +1841,37 @@ 

    )

    -
    -
    -

    -
    Figure 3: Median response time versus proportion accurate by subject in the LDT.
    +
    +
    +
    + +
    +
    +Figure 3: Median response time versus proportion accurate by subject in the LDT. +

    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

    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.

    +

    As described in Section 2.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)
    @@ -1851,13 +1882,13 @@ 

    (2714311, 9)

    -
    +
    describe(pruned)
    9×7 DataFrame
    -

    Row variable mean
    +
    - + @@ -1975,12 +2006,12 @@

    -
    -

    1.2.3 Choice of response scale

    +
    +

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

    -
    -
    +

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

    +
    +
    Code
    draw(
       data(pruned) *
    @@ -1990,18 +2021,22 @@ 

    )

    -
    -
    -

    -
    Figure 4: Kernel density plot of the pruned response times (ms.) in the LDT.
    +
    +
    +
    + +
    +
    +Figure 4: Kernel density plot of the pruned response times (ms.) in the LDT. +

    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.

    -
    -
    +

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

    +
    +
    Code
    draw(
       data(pruned) *
    @@ -2012,16 +2047,20 @@ 

    )

    -
    -
    -

    -
    Figure 5: Kernel density plot of the pruned response speed in the LDT.
    +
    +
    +
    + +
    +
    +Figure 5: Kernel density plot of the pruned response speed in the LDT. +
    -

    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.

    -
    +

    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),
    @@ -2050,11 +2089,11 @@ 

    -
    -

    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,

    -
    -
    +
    +

    2.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(
       data(pruned) *
    @@ -2066,17 +2105,21 @@ 

    )

    -
    -
    -

    -
    Figure 6: Scatterplot smooths of response time versus word length in the LDT.
    +
    +
    +
    + +
    +
    +Figure 6: Scatterplot smooths of response time versus word length in the LDT. +
    -

    and Figure 7 shows the similar relationships for speed

    -
    -
    +

    and Figure 7 shows the similar relationships for speed

    +
    +
    Code
    draw(
       data(pruned) *
    @@ -2088,18 +2131,22 @@ 

    )

    -
    -
    -

    -
    Figure 7: Scatterplot smooths of response speed versus word length in the LDT.
    +
    +
    +
    + +
    +
    +Figure 7: Scatterplot smooths of response speed versus word length in the LDT. +
    -

    For the most part the smoother lines in 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.

    -
    -
    +

    For the most part the smoother lines in 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
       plt = data(@subset(pruned, :wrdlen > 3, :wrdlen < 14))
    @@ -2114,28 +2161,32 @@ 

    end

    -
    -
    -

    -
    Figure 8: Empirical density of response speed versus word length by word/non-word status.
    +
    +
    +
    + +
    +
    +Figure 8: Empirical density of response speed versus word length by word/non-word status. +
    -
    -

    1.3 Models with scalar random effects

    +
    +

    2.3 Models with scalar random effects

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

    In Balota et al. (2007) the item response latency is characterized by the average response latency from the correct trials after outlier removal.

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

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

    -
    -

    1.3.1 Establish the contrasts

    +
    +

    2.3.1 Establish the contrasts

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

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

    Set these contrasts

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

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

    fit(MixedModel, form, pruned; contrasts) end

    -
    Minimizing 53    Time: 0:00:06 ( 0.13  s/it)
    +
    Minimizing 53    Time: 0:00:06 ( 0.12  s/it)
    -
    -

    Row variable mean
    +
    +
    @@ -2234,13 +2285,13 @@

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

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

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

    fit(MixedModel, form, dat; contrasts) end

    -
    Minimizing 53    Time: 0:00:04 (83.11 ms/it)
    +
    Minimizing 54    Time: 0:00:04 (78.69 ms/it)
    -
    -

    Row wrdlen isword
    +
    +
    @@ -2403,7 +2454,7 @@

    isword: true

    - + @@ -2439,13 +2490,13 @@

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

    0.0656 0.0005133.72133.73 <1e-99
    +
    - + @@ -2470,7 +2521,7 @@

    4

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

    6

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

    8

    - + @@ -2497,7 +2548,7 @@

    10

    - + @@ -2506,7 +2557,7 @@

    12

    - + @@ -2515,7 +2566,7 @@

    4

    - + @@ -2524,7 +2575,7 @@

    6

    - + @@ -2533,7 +2584,7 @@

    8

    - + @@ -2542,7 +2593,7 @@

    10

    - + @@ -2551,7 +2602,7 @@

    12

    - + @@ -2562,8 +2613,8 @@

    -
    +
    +
    Code
    CairoMakie.activate!(; type="png")
     disallowmissing!(
    @@ -2598,10 +2649,14 @@ 

    )

    -
    -
    -

    -
    Figure 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.
    +
    +
    +
    + +
    +
    +Figure 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. +
    @@ -2616,11 +2671,11 @@

    -

    Adjust the alpha on Figure 9.

    +

    Adjust the alpha on Figure 9.

    -

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

    -
    +

    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}:
    @@ -2630,10 +2685,10 @@ 

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

    end, "./fits/elm01.json", )

    -
    -

    Row wrdlen iswordfalse 1.450360.008924670.00892461 1.44144 1.45929
    false 1.372970.008871010.00887095 1.3641 1.38184
    false 1.295570.008853090.00885302 1.28672 1.30443
    false 1.218180.008871110.00887105 1.20931 1.22705
    false 1.140780.008924870.0089248 1.13186 1.14971
    true 1.627350.008924660.0089246 1.61842 1.63627
    true 1.527020.008871010.00887095 1.51815 1.53589
    true 1.42670.008853080.00885302 1.41784 1.43555
    true 1.326370.00887110.00887104 1.3175 1.33524
    true 1.226050.008924840.00892478 1.21712 1.23497
    +
    +
    @@ -2716,14 +2771,14 @@

    +
    elpldtitem = DataFrame(dataset("ELP_ldt_item"))
     describe(elpldtitem)
    9×7 DataFrame
    -

    +
    - + @@ -2841,14 +2896,14 @@

    +
    elpldtsubj = DataFrame(dataset("ELP_ldt_subj"))
     describe(elpldtsubj)
    20×7 DataFrame
    -

    Row variable mean
    +
    - + @@ -3075,9 +3130,9 @@

    Figure 10,

    -
    -
    +

    For 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,

    +
    +
    Code
    qqcaterpillar!(
       Figure(resolution=(800, 650)),
    @@ -3085,18 +3140,22 @@ 

    )

    -
    -
    -

    -
    Figure 10: Conditional means and 95% prediction intervals for subject random effects in elm01.
    +
    +
    +
    + +
    +
    +Figure 10: Conditional means and 95% prediction intervals for subject random effects in elm01. +

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

    -

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

    -
    -
    +

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

    +
    +
    Code
    qqcaterpillar!(
       Figure(resolution=(800, 650)),
    @@ -3104,22 +3163,26 @@ 

    )

    -
    -
    -

    -
    Figure 11: Conditional means and 95% prediction intervals for subject random effects in elm02.
    +
    +
    +
    + +
    +
    +Figure 11: Conditional means and 95% prediction intervals for subject random effects in elm02. +
    -

    Row variable mean
    +
    - + @@ -3369,7 +3432,7 @@

    534.0

    - + @@ -3425,7 +3488,7 @@

    627.0

    - + @@ -3495,7 +3558,7 @@

    773.0

    - + @@ -3533,9 +3596,9 @@

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

    -
    -
    +

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

    +
    +
    Code
    draw(
       data(dropmissing(select(subjextended, :elm01, :vocabAge, :sex))) *
    @@ -3547,16 +3610,20 @@ 

    )

    -
    -
    -

    -
    Figure 12: Random effect for subject in model elm01 versus vocabulary age
    +
    +
    +
    + +
    +
    +Figure 12: Random effect for subject in model elm01 versus vocabulary age +
    -
    -
    +
    +
    Code
    draw(
       data(dropmissing(select(subjextended, :elm01, :univ))) *
    @@ -3567,16 +3634,20 @@ 

    )

    -
    -
    -

    -
    Figure 13: Estimated density of random effects for subject in model elm01 by university
    +
    +
    +
    + +
    +
    +Figure 13: Estimated density of random effects for subject in model elm01 by university +
    -
    -
    +
    +
    Code
    draw(
       data(dropmissing(select(subjextended, :elm02, :univ))) *
    @@ -3587,16 +3658,20 @@ 

    )

    -
    -
    -

    -
    Figure 14: Estimated density of random effects for subject in model elm02, fit to accurate responders only, by university
    +
    +
    +
    + +
    +
    +Figure 14: Estimated density of random effects for subject in model elm02, fit to accurate responders only, by university +
    -
    -
    +
    +
    Code
    CairoMakie.activate!(; type="png")
     draw(
    @@ -3609,10 +3684,14 @@ 

    )

    -
    -
    -

    -
    Figure 15: Random effect in model elm01 versus mean bigram frequency, by word/nonword status
    +
    +
    +
    + +
    +
    +Figure 15: Random effect in model elm01 versus mean bigram frequency, by word/nonword status +
    @@ -3623,7 +3702,7 @@

    Back to top

    References

    + Back to top

    References

    Balota, D. A., Yap, M. J., Hutchison, K. A., Cortese, M. J., Kessler, B., Loftis, B., Neely, J. H., Nelson, D. L., Simpson, G. B., & Treiman, R. (2007). The english lexicon project. Behavior Research Methods, 39(3), 445–459. https://doi.org/10.3758/bf03193014
    @@ -3674,6 +3753,33 @@

    { + return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); + } + // Inspect non-navigation links and adorn them if external + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)'); + for (var i=0; i { + // Strip column container classes + const stripColumnClz = (el) => { + el.classList.remove("page-full", "page-columns"); + if (el.children) { + for (const child of el.children) { + stripColumnClz(child); + } + } + } + stripColumnClz(note) + if (id === null || id.startsWith('sec-')) { + // Special case sections, only their first couple elements + const container = document.createElement("div"); + if (note.children && note.children.length > 2) { + container.appendChild(note.children[0].cloneNode(true)); + for (let i = 1; i < note.children.length; i++) { + const child = note.children[i]; + if (child.tagName === "P" && child.innerText === "") { + continue; + } else { + container.appendChild(child.cloneNode(true)); + break; + } + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(container); + } + return container.innerHTML + } else { + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + return note.innerHTML; + } + } else { + // Remove any anchor links if they are present + const anchorLink = note.querySelector('a.anchorjs-link'); + if (anchorLink) { + anchorLink.remove(); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + // TODO in 1.5, we should make sure this works without a callout special case + if (note.classList.contains("callout")) { + return note.outerHTML; + } else { + return note.innerHTML; + } + } + } + for (var i=0; i res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.getElementById(id); + if (note !== null) { + const html = processXRef(id, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + } else { + // See if we can fetch a full url (with no hash to target) + // This is a special case and we should probably do some content thinning / targeting + fetch(url) + .then(res => res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.querySelector('main.content'); + if (note !== null) { + // This should only happen for chapter cross references + // (since there is no id in the URL) + // remove the first header + if (note.children.length > 0 && note.children[0].tagName === "HEADER") { + note.children[0].remove(); + } + const html = processXRef(null, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + }, function(instance) { }); } let selectedAnnoteEl; @@ -3895,6 +4163,7 @@

    { + elRect = undefined; + if (selectedAnnoteEl) { + selectCodeLines(selectedAnnoteEl); + } + }, 10) + ); + function throttle(fn, ms) { + let throttle = false; + let timer; + return (...args) => { + if(!throttle) { // first call gets through + fn.apply(this, args); + throttle = true; + } else { // all the others get throttled + if(timer) clearTimeout(timer); // cancel #2 + timer = setTimeout(() => { + fn.apply(this, args); + timer = throttle = false; + }, ms); + } + }; + } // Attach click handler to the DT const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); for (const annoteDlNode of annoteDls) { @@ -3981,12 +4276,12 @@

    @@ -3995,4 +4290,5 @@

    \ No newline at end of file diff --git a/largescaledesigned_files/figure-html/fig-elm01bgmean-output-1.png b/largescaledesigned_files/figure-html/fig-elm01bgmean-output-1.png index 74f730a..9586a4f 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-elm01caterpillarsubj-output-1.svg b/largescaledesigned_files/figure-html/fig-elm01caterpillarsubj-output-1.svg index cb011d7..baf3918 100644 --- a/largescaledesigned_files/figure-html/fig-elm01caterpillarsubj-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-elm01caterpillarsubj-output-1.svg @@ -1,3483 +1,3445 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-elm01univ-output-1.svg b/largescaledesigned_files/figure-html/fig-elm01univ-output-1.svg index 6a4cda1..ce13f54 100644 --- a/largescaledesigned_files/figure-html/fig-elm01univ-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-elm01univ-output-1.svg @@ -1,805 +1,735 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-elm01vocabage-output-1.svg b/largescaledesigned_files/figure-html/fig-elm01vocabage-output-1.svg index 83e3052..ad78fed 100644 --- a/largescaledesigned_files/figure-html/fig-elm01vocabage-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-elm01vocabage-output-1.svg @@ -1,1387 +1,1329 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-elm02caterpillarsubj-output-1.svg b/largescaledesigned_files/figure-html/fig-elm02caterpillarsubj-output-1.svg index 76969c6..e258eb2 100644 --- a/largescaledesigned_files/figure-html/fig-elm02caterpillarsubj-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-elm02caterpillarsubj-output-1.svg @@ -1,2958 +1,2926 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-elm02univ-output-1.svg b/largescaledesigned_files/figure-html/fig-elm02univ-output-1.svg index c2d7813..586b1cc 100644 --- a/largescaledesigned_files/figure-html/fig-elm02univ-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-elm02univ-output-1.svg @@ -1,905 +1,833 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-elpldtrtdens-output-1.svg b/largescaledesigned_files/figure-html/fig-elpldtrtdens-output-1.svg index 44ae063..5324fe2 100644 --- a/largescaledesigned_files/figure-html/fig-elpldtrtdens-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-elpldtrtdens-output-1.svg @@ -1,522 +1,449 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-elpldtspeeddens-output-1.svg b/largescaledesigned_files/figure-html/fig-elpldtspeeddens-output-1.svg index 4d942c9..6172c8f 100644 --- a/largescaledesigned_files/figure-html/fig-elpldtspeeddens-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-elpldtspeeddens-output-1.svg @@ -1,439 +1,375 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-itemreelm01vselm02-output-1.png b/largescaledesigned_files/figure-html/fig-itemreelm01vselm02-output-1.png index 115cf65..5fbfa18 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..2d023fe 100644 --- a/largescaledesigned_files/figure-html/fig-ldtmedianrtvspropacc-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-ldtmedianrtvspropacc-output-1.svg @@ -1,1284 +1,1227 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-ldtrtvswrdlen-output-1.svg b/largescaledesigned_files/figure-html/fig-ldtrtvswrdlen-output-1.svg index c78d21a..64d1a02 100644 --- a/largescaledesigned_files/figure-html/fig-ldtrtvswrdlen-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-ldtrtvswrdlen-output-1.svg @@ -1,452 +1,405 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-ldtspeedvswrdlen-output-1.svg b/largescaledesigned_files/figure-html/fig-ldtspeedvswrdlen-output-1.svg index 70c8cbb..3b4347d 100644 --- a/largescaledesigned_files/figure-html/fig-ldtspeedvswrdlen-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-ldtspeedvswrdlen-output-1.svg @@ -1,508 +1,446 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-ldtwrdlenhist-output-1.svg b/largescaledesigned_files/figure-html/fig-ldtwrdlenhist-output-1.svg index 0ec4d4c..d0df30d 100644 --- a/largescaledesigned_files/figure-html/fig-ldtwrdlenhist-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-ldtwrdlenhist-output-1.svg @@ -1,304 +1,259 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-propvswrdlen-output-1.svg b/largescaledesigned_files/figure-html/fig-propvswrdlen-output-1.svg index fba4a49..d9a4cd7 100644 --- a/largescaledesigned_files/figure-html/fig-propvswrdlen-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-propvswrdlen-output-1.svg @@ -1,545 +1,469 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/largescaledesigned_files/figure-html/fig-speedviolin-output-1.svg b/largescaledesigned_files/figure-html/fig-speedviolin-output-1.svg index 6226faf..3f3b92b 100644 --- a/largescaledesigned_files/figure-html/fig-speedviolin-output-1.svg +++ b/largescaledesigned_files/figure-html/fig-speedviolin-output-1.svg @@ -1,550 +1,488 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + + + diff --git a/mrk17.html b/mrk17.html index 4772074..bcfed66 100644 --- a/mrk17.html +++ b/mrk17.html @@ -2,14 +2,14 @@ - + - + -SMLP2023: Advanced Frequentist Track - RePsychLing Masson, Rabe, & Kliegl, 2017) with Julia: Specification and selection +RePsychLing Masson, Rabe, & Kliegl, 2017) with Julia: Specification and selection – SMLP2023: Advanced Frequentist Track - + - + @@ -88,7 +88,13 @@ "collapse-after": 3, "panel-placement": "end", "type": "overlay", - "limit": 20, + "limit": 50, + "keyboard-shortcut": [ + "f", + "/", + "s" + ], + "show-item-context": false, "language": { "search-no-results-text": "No results", "search-matching-documents-text": "matching documents", @@ -97,13 +103,14 @@ "search-more-match-text": "more match in this document", "search-more-matches-text": "more matches in this document", "search-clear-button-title": "Clear", + "search-text-placeholder": "", "search-detached-cancel-button-title": "Cancel", "search-submit-button-title": "Submit", "search-label": "Search" } } - + @@ -113,40 +120,40 @@
    -

    + +

    1 Setup

    Packages we (might) use.

    -
    +
    using CategoricalArrays
     using DataFrames
     using MixedModels
    @@ -422,14 +437,14 @@ 

    1 Setup

    using SMLP2023: dataset using Statistics: mean, std
    -
    +
    dat = DataFrame(dataset(:mrk17_exp1))
     describe(dat)
    9×7 DataFrame
    -

    Row subj ns0.853883 0.4804610.4956830.495683 Wash. Univ m 19.00.771945 0.2277missingmissing Wash. Univ m 15.10.909899 -0.0753662-0.0606956-0.0606956 Wash. Univ f 18.6
    +
    - + @@ -606,7 +621,7 @@

    3.2 Codebook

    The data (variables and observations) used by Masson et al. (2017) are available in file MRK17_Exp1.RDS

    -

    Row variable mean
    +
    @@ -659,7 +674,7 @@

    4 Setup

    Packages we (might) use.

    -
    +
    using CategoricalArrays
     using DataFrames
     using MixedModels
    @@ -667,14 +682,14 @@ 

    4 Setup

    using SMLP2023: dataset using Statistics: mean, std
    -
    +
    dat = DataFrame(dataset(:mrk17_exp1))
     describe(dat)
    9×7 DataFrame
    -

    Variable
    +
    - + @@ -791,7 +806,7 @@

    4 Setup

    -
    +
    cells = combine(
       groupby(dat, [:F, :P, :Q, :lQ, :lT]),
       nrow => :n,
    @@ -803,9 +818,9 @@ 

    4 Setup

    cells
    32×8 DataFrame
    7 rows omitted
    -
    Row variable mean
    +
    - + @@ -1126,8 +1141,8 @@

    5 Complex LMM

    The following LMM is not the maximal factorial LMM because we do not include interaction terms and associated correlation parameters in the RE structure.

    5.1 Model fit

    -
    -
    contrasts = 
    +
    +
    contrasts =
         Dict( :F => EffectsCoding(; levels=["LF", "HF"]) ,
               :P => EffectsCoding(; levels=["unr", "rel"]),
               :Q => EffectsCoding(; levels=["deg", "clr"]),
    @@ -1135,7 +1150,7 @@ 

    :lT =>EffectsCoding(; levels=["NW", "WD"]) ); -m_cpx = let +m_cpx = let form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT + (1+F+P+Q+lQ+lT | subj) + (1 +P+Q+lQ+lT | item); @@ -1147,11 +1162,12 @@

    -

    Row F P
    +
    +
    @@ -1180,8 +1196,8 @@

    - - + + @@ -1191,8 +1207,8 @@

    - - + + @@ -1202,10 +1218,10 @@

    - - + + - + @@ -1213,30 +1229,30 @@

    - - - - - + + + + + - - + + - - - + + + - - + + @@ -1246,9 +1262,9 @@

    - - - + + + @@ -1257,10 +1273,10 @@

    - - + + - + @@ -1268,41 +1284,41 @@

    - - + + - - + + - - + + - + - - + + - + - + - - + + @@ -1313,52 +1329,52 @@

    +
    issingular(m_cpx)
    true
    -
    +
    MixedModels.PCA(m_cpx)
    (item = 
     Principal components based on correlation matrix
    - (Intercept)   1.0     .      .      .      .
    - P: rel        0.05   1.0     .      .      .
    - Q: clr        0.36   0.38   1.0     .      .
    - lQ: clr       0.38   0.03   0.03   1.0     .
    - lT: WD       -0.11  -0.87  -0.01  -0.35   1.0
    + (Intercept)   1.0     .      .      .     .
    + P: rel        0.05   1.0     .      .     .
    + Q: clr        0.36   0.4    1.0     .     .
    + lQ: clr       0.76   0.33  -0.11   1.0    .
    + lT: WD       -0.11  -0.89  -0.0   -0.6   1.0
     
     Normalized cumulative variances:
    -[0.4225, 0.6867, 0.9059, 1.0, 1.0]
    +[0.4953, 0.7628, 1.0, 1.0, 1.0]
     
     Component loadings
                     PC1    PC2    PC3    PC4    PC5
    - (Intercept)  -0.3   -0.67   0.02  -0.67   0.07
    - P: rel       -0.6    0.38   0.22  -0.05   0.67
    - Q: clr       -0.31  -0.34   0.7    0.46  -0.28
    - lQ: clr      -0.31  -0.41  -0.62   0.55   0.19
    - lT: WD        0.6   -0.34   0.26   0.15   0.66, subj = 
    + (Intercept)  -0.37   0.69  -0.14   0.6    0.11
    + P: rel       -0.51  -0.49  -0.18   0.08   0.68
    + Q: clr       -0.19   0.05  -0.87  -0.32  -0.3
    + lQ: clr      -0.51   0.37   0.36  -0.68   0.06
    + lT: WD        0.55   0.38  -0.23  -0.27   0.65, subj = 
     Principal components based on correlation matrix
    - (Intercept)   1.0     .      .      .      .      .
    - F: HF         0.36   1.0     .      .      .      .
    - P: rel        0.35   0.9    1.0     .      .      .
    - Q: clr        0.41   0.45   0.73   1.0     .      .
    - lQ: clr       0.06   0.16   0.18   0.58   1.0     .
    - lT: WD        0.26  -0.1   -0.02   0.37   0.51   1.0
    + (Intercept)   1.0     .      .      .      .     .
    + F: HF         0.45   1.0     .      .      .     .
    + P: rel        0.35   0.99   1.0     .      .     .
    + Q: clr        0.41   0.72   0.7    1.0     .     .
    + lQ: clr       0.06   0.16   0.17   0.58   1.0    .
    + lT: WD        0.26  -0.02  -0.05   0.37   0.5   1.0
     
     Normalized cumulative variances:
    -[0.4768, 0.736, 0.8814, 0.9433, 1.0, 1.0]
    +[0.5111, 0.7668, 0.9113, 0.9728, 1.0, 1.0]
     
     Component loadings
                     PC1    PC2    PC3    PC4    PC5    PC6
    - (Intercept)  -0.34   0.02   0.84   0.31  -0.27  -0.11
    - F: HF        -0.45   0.42  -0.12  -0.41  -0.44   0.5
    - P: rel       -0.51   0.35  -0.16  -0.17   0.27  -0.7
    - Q: clr       -0.52  -0.15  -0.11   0.4    0.57   0.45
    - lQ: clr      -0.32  -0.51  -0.43   0.3   -0.56  -0.21
    - lT: WD       -0.21  -0.65   0.24  -0.68   0.16  -0.0)
    + (Intercept) -0.33 0.02 0.83 0.43 -0.08 -0.08 + F: HF -0.51 0.34 -0.08 -0.17 -0.27 0.72 + P: rel -0.5 0.35 -0.18 -0.23 -0.27 -0.69 + Q: clr -0.52 -0.14 -0.15 0.05 0.83 -0.0 + lQ: clr -0.28 -0.56 -0.41 0.54 -0.38 -0.0 + lT: WD -0.18 -0.66 0.28 -0.66 -0.14 0.0)

    Variance-covariance matrix of random-effect structure suggests overparameterization for both subject-related and item-related components.

    @@ -1367,28 +1383,28 @@

    5.2 VCs and CPs

    We can also look separately at item- and subj-related VCs and CPs for subjects and items.

    -
    +
    first(m_cpx.λ)
    5×5 LinearAlgebra.LowerTriangular{Float64, Matrix{Float64}}:
    -  0.193312      ⋅             ⋅           ⋅          ⋅ 
    -  0.00211078   0.0387323      ⋅           ⋅          ⋅ 
    -  0.0156026    0.0156457     0.0371574    ⋅          ⋅ 
    -  0.00757549   0.000171477  -0.0025496   0.0184619   ⋅ 
    - -0.0048343   -0.0370832     0.0173848  -0.0116792  0.0
    + 0.19325 ⋅ ⋅ ⋅ ⋅ + 0.00194837 0.0381009 ⋅ ⋅ ⋅ + 0.0156423 0.0163521 0.036403 ⋅ ⋅ + 0.0076146 0.00290876 -0.00585688 0.000150091 ⋅ + -0.00489674 -0.0380148 0.0191766 -5.7594e-5 1.93105e-6

    VP is zero for last diagonal entry; not supported by data.

    -
    +
    last(m_cpx.λ)
    6×6 LinearAlgebra.LowerTriangular{Float64, Matrix{Float64}}:
    - 0.597727      ⋅           ⋅           ⋅          ⋅          ⋅ 
    - 0.00814994   0.0212326    ⋅           ⋅          ⋅          ⋅ 
    - 0.0134514    0.0318017   0.0171291    ⋅          ⋅          ⋅ 
    - 0.0392939    0.030817    0.0691447   0.0440952   ⋅          ⋅ 
    - 0.00204868   0.00560883  0.00264412  0.036242   0.0         ⋅ 
    - 0.0283421   -0.0224684   0.0138518   0.0576631  0.0414037  0.0752354
    + 0.597547 ⋅ ⋅ ⋅ ⋅ ⋅ + 0.00817716 0.0164258 ⋅ ⋅ ⋅ ⋅ + 0.0134442 0.0363417 0.0 ⋅ ⋅ ⋅ + 0.0392617 0.0572024 0.00654036 0.0658558 ⋅ ⋅ + 0.00205337 0.005683 0.0285271 0.0221063 0.000113326 ⋅ + 0.0283612 -0.0168128 0.0297579 0.0543555 0.0819662 0.0232474

    VP is zero for fourth diagonal entry; not supported by data.

    @@ -1399,8 +1415,8 @@

    6 Zero-correlatio

    6.1 Model fit

    We take out correlation parameters.

    -
    -
    m_zcp = let 
    +
    +
    m_zcp = let
         form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT +
                            zerocorr(1+F+P+Q+lQ+lT | subj) +
                            zerocorr(1  +P+Q+lQ+lT | item);
    @@ -1414,8 +1430,8 @@ 

    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. │ - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. │ - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`. -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626 -Minimizing 318 Time: 0:00:02 ( 6.57 ms/it)

    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 304 Time: 0:00:01 ( 3.85 ms/it)
    (item = 
    @@ -1457,10 +1473,10 @@ 

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

    item (Intercept)0.003202530.056590920.003202360.05658940 P: rel0.000128950.011355480.000124810.01117165 +0.05 Q: clr0.000160160.012655590.000157540.01255162 +0.36+0.38+0.40 lQ: clr0.000034690.00588962+0.38+0.03+0.030.000008640.00293953+0.76+0.33-0.11
    lT: WD0.000157440.012547690.000157510.01255021 -0.11-0.87-0.01-0.35-0.89-0.00-0.60
    subj (Intercept)0.030618420.174981210.030617850.17497956 F: HF0.000044330.00665790+0.360.000028870.00537302+0.45 P: rel0.000127320.011283740.000128750.01134679 +0.35+0.90+0.99 Q: clr0.000790070.028108160.000788320.02807711 +0.41+0.45+0.73+0.72+0.70
    lQ: clr0.000116220.010780510.000114820.01071537 +0.06 +0.16+0.18+0.17 +0.58
    lT: WD0.001045500.032334230.001044940.03232551 +0.26-0.10 -0.02-0.05 +0.37+0.51+0.50
    Residual 0.085699400.292744590.085749200.29282964
    +
    +
    @@ -1492,17 +1508,17 @@

    :(1000 / rt) ~ 1 + F + P + Q + lQ + lT + F & P + F & Q + P & Q + F & lQ + P & lQ + Q & lQ + F & lT + P & lT + Q & lT + lQ & lT + F & P & Q + F & P & lQ + F & Q & lQ + P & Q & lQ + F & P & lT + F & Q & lT + P & Q & lT + F & lQ & lT + P & lQ & lT + Q & lQ & lT + F & P & Q & lQ + F & P & Q & lT + F & P & lQ & lT + F & Q & lQ & lT + P & Q & lQ & lT + F & P & Q & lQ & lT + (1 + F + P + Q + lQ + lT | subj) + (1 + P + Q + lQ + lT | item)

    - + - +
    69 71484140 250.02330.0259

    Looks ok. It might be a good idea to prune the LMM by removing small VCs.

    -
    -
    m_zcp2 = let 
    +
    +
    m_zcp2 = let
         form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT +
                            zerocorr(1  +P+Q+lQ+lT | subj) +
                            zerocorr(1  +P+Q   +lT | item);
    @@ -1513,11 +1529,11 @@ 

    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. │ - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. │ - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`. -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626 -Minimizing 246 Time: 0:00:01 ( 4.27 ms/it)

    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 272 Time: 0:00:00 ( 2.61 ms/it)
    -
    - +
    +
    @@ -1544,8 +1560,8 @@

    - - + + @@ -1554,8 +1570,8 @@

    - - + + @@ -1564,8 +1580,8 @@

    - - + + @@ -1574,8 +1590,8 @@

    - - + + @@ -1584,8 +1600,8 @@

    - - + + @@ -1594,8 +1610,8 @@

    - - + + @@ -1604,8 +1620,8 @@

    - - + + @@ -1614,8 +1630,8 @@

    - - + + @@ -1624,8 +1640,8 @@

    - - + + @@ -1634,8 +1650,8 @@

    - - + + @@ -1645,10 +1661,10 @@

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

    item (Intercept)0.003202070.056586800.003202030.05658644 P: rel0.000071410.008450700.000071370.00844831 . Q: clr0.000147200.012132690.000147190.01213221 . . lT: WD0.000117110.010821550.000117080.01082044 . . .subj (Intercept)0.030609240.174954980.030610810.17495945 P: rel0.000099220.009960820.000099210.00996036 . Q: clr0.000773030.027803490.000773040.02780361 . . lQ: clr0.000118910.010904500.000118900.01090435 . . . lT: WD0.001061410.032579250.001061480.03258038 . . .Residual 0.085915820.293114000.085915870.29311409
    +
    +
    @@ -1688,31 +1704,24 @@

    :(1000 / rt) ~ 1 + F + P + Q + lQ + lT + F & P + F & Q + P & Q + F & lQ + P & lQ + Q & lQ + F & lT + P & lT + Q & lT + lQ & lT + F & P & Q + F & P & lQ + F & Q & lQ + P & Q & lQ + F & P & lT + F & Q & lT + P & Q & lT + F & lQ & lT + P & lQ & lT + Q & lQ & lT + F & P & Q & lQ + F & P & Q & lT + F & P & lQ & lT + F & Q & lQ & lT + P & Q & lQ & lT + F & P & Q & lQ & lT + (1 + F + P + Q + lQ + lT | subj) + (1 + P + Q + lQ + lT | item)

    - + - +
    69 71484140 250.02330.0259

    We can perhaps remove some more.

    -
    -
    m_zcp3 = let 
    +
    +
    m_zcp3 = let
         form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT +
                            zerocorr(1    +Q   +lT | subj) + (1 | item);
         fit(MixedModel, form, dat; contrasts)
     end
     VarCorr(m_zcp3)
    -
    -
    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. 
    -│  - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. 
    -│  - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.
    -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626
    -Minimizing 93    Time: 0:00:00 ( 1.14 ms/it)
    -
    -
    - +
    +
    @@ -1727,40 +1736,40 @@

    - - + + - - + + - - + + - - + + - - + + @@ -1768,10 +1777,10 @@

    -
    -
    MixedModels.likelihoodratiotest(m_zcp3, m_zcp2, m_zcp, m_cpx)
    -
    -

    item (Intercept)0.00320480.05661080.00320490.0566119
    subj (Intercept)0.03061660.17497600.03061710.1749774
    Q: clr0.00076280.02761900.00076290.0276197 .
    lT: WD0.00106440.03262590.00106450.0326268 . .
    Residual 0.08647530.29406680.08647520.2940667
    +
    +
    MixedModels.likelihoodratiotest(m_zcp3, m_zcp2, m_zcp, m_cpx)
    +
    +
    @@ -1819,24 +1828,24 @@

    :(1000 / rt) ~ 1 + F + P + Q + lQ + lT + F & P + F & Q + P & Q + F & lQ + P & lQ + Q & lQ + F & lT + P & lT + Q & lT + lQ & lT + F & P & Q + F & P & lQ + F & Q & lQ + P & Q & lQ + F & P & lT + F & Q & lT + P & Q & lT + F & lQ & lT + P & lQ & lT + Q & lQ & lT + F & P & Q & lQ + F & P & Q & lT + F & P & lQ & lT + F & Q & lQ & lT + P & Q & lQ & lT + F & P & Q & lQ & lT + (1 + F + P + Q + lQ + lT | subj) + (1 + P + Q + lQ + lT | item)

    - + - +
    69 71484140 250.02330.0259

    And another iteration.

    -
    -
    m_zcp4 = let 
    -    form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT +
    -                       zerocorr(1         +lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end
    -VarCorr(m_zcp4)
    -
    - +
    +
    m_zcp4 = let
    +    form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT +
    +                       zerocorr(1         +lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end
    +VarCorr(m_zcp4)
    +
    +
    @@ -1865,7 +1874,7 @@

    - + @@ -1879,10 +1888,10 @@

    -
    -
    MixedModels.likelihoodratiotest(m_zcp4, m_zcp3, m_zcp2, m_zcp, m_cpx)
    -
    -

    lT: WD 0.00108960.03300970.0330098 .
    +
    +
    MixedModels.likelihoodratiotest(m_zcp4, m_zcp3, m_zcp2, m_zcp, m_cpx)
    +
    +
    @@ -1938,31 +1947,31 @@

    :(1000 / rt) ~ 1 + F + P + Q + lQ + lT + F & P + F & Q + P & Q + F & lQ + P & lQ + Q & lQ + F & lT + P & lT + Q & lT + lQ & lT + F & P & Q + F & P & lQ + F & Q & lQ + P & Q & lQ + F & P & lT + F & Q & lT + P & Q & lT + F & lQ & lT + P & lQ & lT + Q & lQ & lT + F & P & Q & lQ + F & P & Q & lT + F & P & lQ & lT + F & Q & lQ & lT + P & Q & lQ & lT + F & P & Q & lQ & lT + (1 + F + P + Q + lQ + lT | subj) + (1 + P + Q + lQ + lT | item)

    - + - +
    69 71484140 250.02330.0259

    Too much removed. Stay with m_zcp3, but extend with CPs.

    -
    -
    m_prm = let 
    -    form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT + 
    -                               (1+    Q+lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end
    -VarCorr(m_prm)
    +
    +
    m_prm = let
    +    form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT +
    +                               (1+    Q+lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end
    +VarCorr(m_prm)
    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. 
     │  - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. 
     │  - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.
    -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626
    -Minimizing 230    Time: 0:00:00 ( 0.87 ms/it)
    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 250 Time: 0:00:00 ( 0.46 ms/it)
    -
    - +
    +
    @@ -1977,16 +1986,16 @@

    - - + + - - + + @@ -1994,7 +2003,7 @@

    - + @@ -2002,15 +2011,15 @@

    - + - - + + @@ -2020,22 +2029,22 @@

    6.1.1 post-hoc LMM

    -
    -
    m_prm = let 
    -    form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT + 
    -                               (1+    Q+lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end
    -VarCorr(m_prm)
    +
    +
    m_prm = let
    +    form = @formula (1000/rt) ~ 1+F*P*Q*lQ*lT +
    +                               (1+    Q+lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end
    +VarCorr(m_prm)
    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. 
     │  - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. 
     │  - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.
    -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626
    -Minimizing 230    Time: 0:00:00 ( 0.90 ms/it)
    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 250 Time: 0:00:00 ( 0.47 ms/it)
    -
    -

    item (Intercept)0.00320090.05657610.00320100.0565777
    subj (Intercept)0.03062060.17498760.03062220.1749919
    Q: clr 0.00076260.02761490.0276156 +0.42
    lT: WD 0.00106210.03258950.0325896 +0.26 +0.38
    Residual 0.08647700.29406960.08647690.2940695
    +
    +
    @@ -2050,16 +2059,16 @@

    - - + + - - + + @@ -2067,7 +2076,7 @@

    - + @@ -2075,15 +2084,15 @@

    - + - - + + @@ -2095,10 +2104,10 @@

    6.2 VCs and CPs

    -
    -
    MixedModels.likelihoodratiotest(m_zcp3, m_prm, m_cpx)
    -
    -

    item (Intercept)0.00320090.05657610.00320100.0565777
    subj (Intercept)0.03062060.17498760.03062220.1749919
    Q: clr 0.00076260.02761490.0276156 +0.42
    lT: WD 0.00106210.03258950.0325896 +0.26 +0.38
    Residual 0.08647700.29406960.08647690.2940695
    +
    +
    MixedModels.likelihoodratiotest(m_zcp3, m_prm, m_cpx)
    +
    +
    @@ -2138,37 +2147,37 @@

    :(1000 / rt) ~ 1 + F + P + Q + lQ + lT + F & P + F & Q + P & Q + F & lQ + P & lQ + Q & lQ + F & lT + P & lT + Q & lT + lQ & lT + F & P & Q + F & P & lQ + F & Q & lQ + P & Q & lQ + F & P & lT + F & Q & lT + P & Q & lT + F & lQ & lT + P & lQ & lT + Q & lQ & lT + F & P & Q & lQ + F & P & Q & lT + F & P & lQ & lT + F & Q & lQ & lT + P & Q & lQ & lT + F & P & Q & lQ & lT + (1 + F + P + Q + lQ + lT | subj) + (1 + P + Q + lQ + lT | item)

    - + - +
    69 71483332 290.29160.3103

    The LRT favors the complex LMM, but not that χ² < 2*(χ²-dof); AIC and BIC suggest against selection.

    -
    -
    gof_summary = let
    -  nms = [:m_zcp3, :m_prm, :m_cpx]
    -  mods = eval.(nms)
    -  lrt = MixedModels.likelihoodratiotest(m_zcp3, m_prm, m_cpx)
    -  DataFrame(;
    -    name = nms, 
    -    dof=dof.(mods),
    -    deviance=round.(deviance.(mods), digits=0),
    -    AIC=round.(aic.(mods),digits=0),
    -    AICc=round.(aicc.(mods),digits=0),
    -    BIC=round.(bic.(mods),digits=0),
    -    χ²=vcat(:., round.(lrt.tests.deviancediff, digits=0)),
    -    χ²_dof=vcat(:., round.(lrt.tests.dofdiff, digits=0)),
    -    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
    -  )
    -end
    +
    +
    gof_summary = let
    +  nms = [:m_zcp3, :m_prm, :m_cpx]
    +  mods = eval.(nms)
    +  lrt = MixedModels.likelihoodratiotest(m_zcp3, m_prm, m_cpx)
    +  DataFrame(;
    +    name = nms,
    +    dof=dof.(mods),
    +    deviance=round.(deviance.(mods), digits=0),
    +    AIC=round.(aic.(mods),digits=0),
    +    AICc=round.(aicc.(mods),digits=0),
    +    BIC=round.(bic.(mods),digits=0),
    +    χ²=vcat(:., round.(lrt.tests.deviancediff, digits=0)),
    +    χ²_dof=vcat(:., round.(lrt.tests.dofdiff, digits=0)),
    +    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
    +  )
    +end
    3×9 DataFrame
    - +
    - + @@ -2224,11 +2233,11 @@

    69

    - - - + + + - +
    Row name dof7148.0 7286.07286.07817.033.07287.07818.032.0 29.00.2920.31
    @@ -2242,23 +2251,23 @@

    7 Parsimonious LM

    The LMM is not nested in the previous sequence.

    7.1 Crossed fixed effects

    -
    -
    m_mrk17_crossed =let 
    -   form = @formula (1000/rt) ~ 1 + F*P*Q*lQ*lT +
    -        (1+Q | subj) + zerocorr(0+lT | subj) + zerocorr(1 + P | item) ;
    -    fit(MixedModel, form, dat; contrasts)
    -end
    -
    -VarCorr(m_prm)
    +
    +
    m_mrk17_crossed =let
    +   form = @formula (1000/rt) ~ 1 + F*P*Q*lQ*lT +
    +        (1+Q | subj) + zerocorr(0+lT | subj) + zerocorr(1 + P | item) ;
    +    fit(MixedModel, form, dat; contrasts)
    +end
    +
    +VarCorr(m_prm)
    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. 
     │  - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. 
     │  - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.
    -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626
    -Minimizing 175    Time: 0:00:00 ( 1.39 ms/it)
    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 189 Time: 0:00:00 ( 1.03 ms/it)

    -
    - +
    +
    @@ -2273,16 +2282,16 @@

    - - + + - - + + @@ -2290,7 +2299,7 @@

    - + @@ -2298,15 +2307,15 @@

    - + - - + + @@ -2314,8 +2323,8 @@

    -
    -
    show(m_mrk17_crossed)
    +
    +
    show(m_mrk17_crossed)
    Linear mixed model fit by maximum likelihood
      :(1000 / rt) ~ 1 + F + P + Q + lQ + lT + F & P + F & Q + P & Q + F & lQ + P & lQ + Q & lQ + F & lT + P & lT + Q & lT + lQ & lT + F & P & Q + F & P & lQ + F & Q & lQ + P & Q & lQ + F & P & lT + F & Q & lT + P & Q & lT + F & lQ & lT + P & lQ & lT + Q & lQ & lT + F & P & Q & lQ + F & P & Q & lT + F & P & lQ & lT + F & Q & lQ & lT + P & Q & lQ & lT + F & P & Q & lQ & lT + (1 + Q | subj) + zerocorr(0 + lT | subj) + zerocorr(1 + P | item)
    @@ -2324,12 +2333,12 @@ 

    7.2 Nested fixed effects

    -
    -
    m_mrk17_nested =let 
    -   form = @formula (1000/rt) ~ 1 + Q/(F/P) +
    -        (1+Q | subj) + zerocorr(0+lT | subj) + zerocorr(1 + P | item) ;
    -    fit(MixedModel, form, dat; contrasts)
    -end
    +
    +
    m_mrk17_nested =let
    +   form = @formula (1000/rt) ~ 1 + Q/(F/P) +
    +        (1+Q | subj) + zerocorr(0+lT | subj) + zerocorr(1 + P | item) ;
    +    fit(MixedModel, form, dat; contrasts)
    +end
    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. 
     │  - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. 
     │  - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.
    -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626
    -Minimizing 187    Time: 0:00:00 ( 1.28 ms/it)
    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 176 Time: 0:00:00 ( 0.66 ms/it)

    -
    -

    item (Intercept)0.00320090.05657610.00320100.0565777
    subj (Intercept)0.03062060.17498760.03062220.1749919
    Q: clr 0.00076260.02761490.0276156 +0.42
    lT: WD 0.00106210.03258950.0325896 +0.26 +0.38
    Residual 0.08647700.29406960.08647690.2940695
    +
    +
    @@ -2521,21 +2530,21 @@

    8 Questions from

    8.1 Nesting within products of factors

    Include parenthesis

    -
    -
    m_mrk17_nested =let 
    -   form = @formula (1000/rt) ~ 1 + Q/(F/P) +
    -        (1+Q | subj) + zerocorr(0+lT | subj) + zerocorr(1 + P | item) ;
    -    fit(MixedModel, form, dat; contrasts)
    -end
    +
    +
    m_mrk17_nested =let
    +   form = @formula (1000/rt) ~ 1 + Q/(F/P) +
    +        (1+Q | subj) + zerocorr(0+lT | subj) + zerocorr(1 + P | item) ;
    +    fit(MixedModel, form, dat; contrasts)
    +end
    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. 
     │  - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. 
     │  - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.
    -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626
    -Minimizing 187    Time: 0:00:00 ( 1.25 ms/it)
    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 176 Time: 0:00:00 ( 0.64 ms/it)
    -
    -

    +
    +
    @@ -2663,63 +2672,63 @@

    8.2 Selection in fixed effects

    -
    -
    using RegressionFormulae
    -# m_prm_5 is equivalent to m_prm
    -m_prm_5 = let 
    -    form = @formula (1000/rt) ~ 1+(F+P+Q+lQ+lT)^5 + (1+Q+lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end;
    -
    -m_prm_4 = let 
    -    form = @formula (1000/rt) ~ 1+(F+P+Q+lQ+lT)^4 + (1+Q+lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end;
    -
    -m_prm_3 = let 
    -    form = @formula (1000/rt) ~ 1+(F+P+Q+lQ+lT)^3 + (1+Q+lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end;
    -
    -m_prm_2 = let 
    -    form = @formula (1000/rt) ~ 1+(F+P+Q+lQ+lT)^2 + (1+Q+lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end;
    -
    -m_prm_1 = let 
    -    form = @formula (1000/rt) ~ 1+ F+P+Q+lQ+lT +   (1+Q+lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end;
    -
    -# Compare the fits
    -gof_summary = let
    -  nms = [:m_prm_1, :m_prm_2, :m_prm_3, :m_prm_4, :m_prm_5]
    -  mods = eval.(nms)
    -  lrt = MixedModels.likelihoodratiotest(m_prm_1, m_prm_2, m_prm_3, m_prm_4, m_prm_5)
    -  DataFrame(;
    -    name = nms, 
    -    dof=dof.(mods),
    -    deviance=deviance.(mods),
    -    AIC=aic.(mods),
    -    AICc=aicc.(mods),
    -    BIC=bic.(mods),
    -    χ²=vcat(:.,lrt.tests.deviancediff),
    -    χ²_dof=vcat(:.,lrt.tests.dofdiff),
    -    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
    -  )
    -end
    +
    +
    using RegressionFormulae
    +# m_prm_5 is equivalent to m_prm
    +m_prm_5 = let
    +    form = @formula (1000/rt) ~ 1+(F+P+Q+lQ+lT)^5 + (1+Q+lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end;
    +
    +m_prm_4 = let
    +    form = @formula (1000/rt) ~ 1+(F+P+Q+lQ+lT)^4 + (1+Q+lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end;
    +
    +m_prm_3 = let
    +    form = @formula (1000/rt) ~ 1+(F+P+Q+lQ+lT)^3 + (1+Q+lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end;
    +
    +m_prm_2 = let
    +    form = @formula (1000/rt) ~ 1+(F+P+Q+lQ+lT)^2 + (1+Q+lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end;
    +
    +m_prm_1 = let
    +    form = @formula (1000/rt) ~ 1+ F+P+Q+lQ+lT +   (1+Q+lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end;
    +
    +# Compare the fits
    +gof_summary = let
    +  nms = [:m_prm_1, :m_prm_2, :m_prm_3, :m_prm_4, :m_prm_5]
    +  mods = eval.(nms)
    +  lrt = MixedModels.likelihoodratiotest(m_prm_1, m_prm_2, m_prm_3, m_prm_4, m_prm_5)
    +  DataFrame(;
    +    name = nms,
    +    dof=dof.(mods),
    +    deviance=deviance.(mods),
    +    AIC=aic.(mods),
    +    AICc=aicc.(mods),
    +    BIC=bic.(mods),
    +    χ²=vcat(:.,lrt.tests.deviancediff),
    +    χ²_dof=vcat(:.,lrt.tests.dofdiff),
    +    pvalue=vcat(:., round.(lrt.tests.pvalues, digits=3))
    +  )
    +end
    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. 
     │  - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. 
     │  - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.
    -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626
    -Minimizing 264    Time: 0:00:00 ( 0.59 ms/it)
    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 240 Time: 0:00:00 ( 0.43 ms/it)
    5×9 DataFrame
    -
    +
    - + @@ -2789,7 +2798,7 @@

    7258.61

    - + @@ -2815,21 +2824,21 @@

    8.3 Posthoc LMM

    We are using only three factors for the illustruation.

    -
    -
    m_prm3 = let 
    -    form = @formula (1000/rt) ~ 1 + lT*lQ*Q +
    -                               (1+    Q+lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end
    +
    +
    m_prm3 = let
    +    form = @formula (1000/rt) ~ 1 + lT*lQ*Q +
    +                               (1+    Q+lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end
    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. 
     │  - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. 
     │  - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.
    -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626
    -Minimizing 279    Time: 0:00:00 ( 0.63 ms/it)
    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 282 Time: 0:00:00 ( 0.46 ms/it)
    -
    -
    Row name dof7258.8 7559.136.958646.95863 5 0.224
    +
    +
    @@ -2937,21 +2946,21 @@

    The lT & lQ & Q interactions is significant. Let’s follow it up with a post-hoc LMM, that is looking at the lQ & Q interaction in the two levels of whether the last word was a target or not.

    -
    -
    m_prm3_posthoc1 = let 
    -    form = @formula (1000/rt) ~ 1 + lT/(lQ*Q) +
    -                               (1+    Q+lT | subj) + (1 | item);
    -    fit(MixedModel, form, dat; contrasts)
    -end
    +
    +
    m_prm3_posthoc = let
    +    form = @formula (1000/rt) ~ 1 + lT/(lQ*Q) +
    +                               (1+    Q+lT | subj) + (1 | item);
    +    fit(MixedModel, form, dat; contrasts)
    +end
    ┌ Warning: ProgressMeter by default refresh meters with additional information in IJulia via `IJulia.clear_output`, which clears all outputs in the cell. 
     │  - To prevent this behaviour, do `ProgressMeter.ijulia_behavior(:append)`. 
     │  - To disable this warning message, do `ProgressMeter.ijulia_behavior(:clear)`.
    -└ @ ProgressMeter ~/.julia/packages/ProgressMeter/vnCY0/src/ProgressMeter.jl:626
    -Minimizing 287    Time: 0:00:00 ( 0.62 ms/it)
    +└ @ ProgressMeter ~/.julia/packages/ProgressMeter/dMfiC/src/ProgressMeter.jl:594 +Minimizing 264 Time: 0:00:00 ( 0.46 ms/it)
    -
    -

    +
    +
    @@ -3069,24 +3078,31 @@

    The source of the interaction are trials where the last trial was a word target; there is no evidence for the interaction when the last trial was a nonword target.

    The original and post-hoc LMM have the same goodness of fit.

    -

    [objective(m_prm3), objective(m_prm3_posthoc)] ```

    +
    +
    [objective(m_prm3), objective(m_prm3_posthoc)]
    +
    +
    2-element Vector{Float64}:
    + 7291.14543745544
    + 7291.145437448449
    +
    +

    8.4 Info

    -
    -
    versioninfo()
    +
    +
    versioninfo()
    -
    Julia Version 1.9.3
    -Commit bed2cd540a1 (2023-08-24 14:43 UTC)
    +
    Julia Version 1.9.4
    +Commit 8e5136fa297 (2023-11-14 08:46 UTC)
     Build Info:
       Official https://julialang.org/ release
     Platform Info:
       OS: Linux (x86_64-linux-gnu)
    -  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    +  CPU: 16 × Intel(R) Xeon(R) E-2288G CPU @ 3.70GHz
       WORD_SIZE: 64
       LIBM: libopenlibm
    -  LLVM: libLLVM-14.0.6 (ORCJIT, tigerlake)
    -  Threads: 9 on 8 virtual cores
    + LLVM: libLLVM-14.0.6 (ORCJIT, skylake) + Threads: 17 on 16 virtual cores
    @@ -3138,6 +3154,33 @@

    { + return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); + } + // Inspect non-navigation links and adorn them if external + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)'); + for (var i=0; i { + // Strip column container classes + const stripColumnClz = (el) => { + el.classList.remove("page-full", "page-columns"); + if (el.children) { + for (const child of el.children) { + stripColumnClz(child); + } + } + } + stripColumnClz(note) + if (id === null || id.startsWith('sec-')) { + // Special case sections, only their first couple elements + const container = document.createElement("div"); + if (note.children && note.children.length > 2) { + container.appendChild(note.children[0].cloneNode(true)); + for (let i = 1; i < note.children.length; i++) { + const child = note.children[i]; + if (child.tagName === "P" && child.innerText === "") { + continue; + } else { + container.appendChild(child.cloneNode(true)); + break; + } + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(container); + } + return container.innerHTML + } else { + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + return note.innerHTML; + } + } else { + // Remove any anchor links if they are present + const anchorLink = note.querySelector('a.anchorjs-link'); + if (anchorLink) { + anchorLink.remove(); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + // TODO in 1.5, we should make sure this works without a callout special case + if (note.classList.contains("callout")) { + return note.outerHTML; + } else { + return note.innerHTML; + } + } + } + for (var i=0; i res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.getElementById(id); + if (note !== null) { + const html = processXRef(id, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + } else { + // See if we can fetch a full url (with no hash to target) + // This is a special case and we should probably do some content thinning / targeting + fetch(url) + .then(res => res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.querySelector('main.content'); + if (note !== null) { + // This should only happen for chapter cross references + // (since there is no id in the URL) + // remove the first header + if (note.children.length > 0 && note.children[0].tagName === "HEADER") { + note.children[0].remove(); + } + const html = processXRef(null, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + }, function(instance) { }); } let selectedAnnoteEl; @@ -3359,6 +3564,7 @@

    { + elRect = undefined; + if (selectedAnnoteEl) { + selectCodeLines(selectedAnnoteEl); + } + }, 10) + ); + function throttle(fn, ms) { + let throttle = false; + let timer; + return (...args) => { + if(!throttle) { // first call gets through + fn.apply(this, args); + throttle = true; + } else { // all the others get throttled + if(timer) clearTimeout(timer); // cancel #2 + timer = setTimeout(() => { + fn.apply(this, args); + timer = throttle = false; + }, ms); + } + }; + } // Attach click handler to the DT const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); for (const annoteDlNode of annoteDls) { @@ -3445,13 +3677,13 @@

    @@ -3459,4 +3691,5 @@

    \ No newline at end of file diff --git a/partial_within.html b/partial_within.html new file mode 100644 index 0000000..a6a1313 --- /dev/null +++ b/partial_within.html @@ -0,0 +1,1709 @@ + + + + + + + + + + + +Partially-within subjects designs – SMLP2023: Advanced Frequentist Track + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + +
    + +
    + + +
    + + + +
    + +
    +
    +

    Partially-within subjects designs

    +
    + + + +
    + +
    +
    Author
    +
    +

    Phillip Alday, Douglas Bates, and Reinhold Kliegl

    +
    +
    + +
    +
    Published
    +
    +

    2024-06-26

    +
    +
    + + +
    + + + +
    + + +

    Begin by loading the packages to be used.

    +
    +
    +Code +
    using AlgebraOfGraphics
    +using CairoMakie
    +using DataFrames
    +using MixedModels
    +using MixedModelsMakie
    +using MixedModelsSim
    +using ProgressMeter
    +using Random
    +
    +CairoMakie.activate!(; type="svg")
    +
    +ProgressMeter.ijulia_behavior(:clear)
    +
    +
    +
    +
    +Code +
    n_subj = 40
    +n_item = 3
    +# things are expressed as "between", so "within subjects" is "between items"
    +item_btwn = Dict(:frequency => ["high", "medium", "low"])
    +design = simdat_crossed(MersenneTwister(42), n_subj, n_item;
    +                        item_btwn = item_btwn)
    +design = DataFrame(design)
    +
    +
    +
    120×4 DataFrame
    95 rows omitted
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Rowsubjitemfrequencydv
    StringStringStringFloat64
    1S01I1high-0.556027
    2S02I1high-0.444383
    3S03I1high0.0271553
    4S04I1high-0.299484
    5S05I1high1.77786
    6S06I1high-1.1449
    7S07I1high-0.468606
    8S08I1high0.156143
    9S09I1high-2.64199
    10S10I1high1.00331
    11S11I1high1.08238
    12S12I1high0.187028
    13S13I1high0.518149
    109S29I3low-0.338763
    110S30I3low-0.0953675
    111S31I3low0.768972
    112S32I3low1.44244
    113S33I3low-0.275032
    114S34I3low-0.379637
    115S35I3low-0.722696
    116S36I3low0.139661
    117S37I3low-1.40934
    118S38I3low1.05546
    119S39I3low-2.23782
    120S40I3low1.15915
    +
    +
    +
    +
    +
    +Code +
    unique!(select(design, :item, :frequency))
    +
    +
    +
    3×2 DataFrame
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Rowitemfrequency
    StringString
    1I1high
    2I2medium
    3I3low
    +
    +
    +
    +
    +
    +Code +
    m0 = let contrasts, form
    +    contrasts = Dict(:frequency => HelmertCoding(base="high"))
    +    form = @formula(dv ~ 1 + frequency +
    +                    (1 + frequency | subj))
    +    fit(MixedModel, form, design; contrasts)
    +end
    +
    +
    +
    Minimizing 73    Time: 0:00:00 ( 4.52 ms/it)
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Est.SEzpσ_subj
    (Intercept)-0.08300.0983-0.840.39830.5440
    frequency: low0.04110.12580.330.74380.7051
    frequency: medium-0.00600.0572-0.110.91600.2928
    Residual0.5204
    +
    +
    +
    +
    +Code +
    corrmat = [ 1    0.1 -0.2
    +            0.1  1    0.1
    +           -0.2  0.1  1 ]
    +re_subj = create_re(1.2, 1.5, 1.5; corrmat)
    +
    +
    +
    3×3 LinearAlgebra.LowerTriangular{Float64, Matrix{Float64}}:
    +  1.2    ⋅         ⋅ 
    +  0.15  1.49248    ⋅ 
    + -0.3   0.180907  1.45852
    +
    +
    +
    +
    +Code +
    θ = createθ(m0; subj=re_subj)
    +
    +
    +
    6-element Vector{Float64}:
    +  1.2
    +  0.15000000000000002
    + -0.30000000000000004
    +  1.49248115565993
    +  0.18090680674665818
    +  1.4585173044131932
    +
    +
    +
    +
    +Code +
    σ = 1;
    +β = [1.0, -3, -2];
    +
    +
    +
    +
    +Code +
    fit!(simulate!(m0; θ, β, σ))
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Est.SEzpσ_subj
    (Intercept)1.20700.15277.90<1e-140.6362
    frequency: low-3.26550.3056-10.68<1e-251.7158
    frequency: medium-2.00130.2044-9.79<1e-211.1859
    Residual1.2587
    +
    +
    +
    +
    +Code +
    shrinkageplot(m0)
    +
    +
    +
    +
    +

    +
    +
    +
    +
    +
    +
    +Code +
    caterpillar(m0; orderby=nothing, vline_at_zero=true)
    +
    +
    +
    +
    +

    +
    +
    +
    +
    +
    +
    +Code +
    design[!, :dv] .= response(m0)
    +
    +
    +
    120-element Vector{Float64}:
    +  7.34755654258727
    + 10.229604583695
    +  3.6043175855673883
    +  5.3566728415298925
    +  4.474249009070753
    +  7.719899856563901
    +  4.025122582186671
    +  5.209742237453524
    +  5.451105316896041
    +  5.39384999765566
    +  4.332314108764023
    +  8.376518943225815
    +  4.405193973744266
    +  ⋮
    +  0.07309586813780955
    +  1.4581187646069615
    +  0.7913143551731827
    +  1.2178125667082424
    +  1.5417032495112117
    + -3.1374916197365295
    +  1.230062037484938
    +  0.35610481040040387
    +  2.3340449614726744
    +  1.5733946081398242
    + -0.01802135858697218
    + -3.7247679264549767
    +
    +
    +
    +
    +Code +
    design_partial = filter(design) do row
    +    subj = parse(Int, row.subj[2:end])
    +    item = parse(Int, row.item[2:end])
    +    # for even-numbered subjects, we keep all conditions
    +    # for odd-numbered subjects, we keep only the two "odd" items,
    +    # i.e. the first and last conditions
    +    return iseven(subj) || isodd(item)
    +end
    +sort!(unique!(select(design_partial, :subj, :frequency)), :subj)
    +
    +
    +
    100×2 DataFrame
    75 rows omitted
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Rowsubjfrequency
    StringString
    1S01high
    2S01low
    3S02high
    4S02medium
    5S02low
    6S03high
    7S03low
    8S04high
    9S04medium
    10S04low
    11S05high
    12S05low
    13S06high
    89S36medium
    90S36low
    91S37high
    92S37low
    93S38high
    94S38medium
    95S38low
    96S39high
    97S39low
    98S40high
    99S40medium
    100S40low
    +
    +
    +
    +
    +
    +Code +
    m1 = let contrasts, form
    +    contrasts = Dict(:frequency => HelmertCoding(base="high"))
    +    form = @formula(dv ~ 1 + frequency +
    +                    (1 + frequency | subj))
    +    fit(MixedModel, form, design_partial; contrasts)
    +end
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Est.SEzpσ_subj
    (Intercept)1.18850.18326.49<1e-100.5590
    frequency: low-3.26550.3056-10.68<1e-251.7496
    frequency: medium-2.01980.2726-7.41<1e-121.4723
    Residual1.1621
    +
    +
    +
    +
    +Code +
    shrinkageplot(m1)
    +
    +
    +
    +
    +

    +
    +
    +
    +
    +
    +
    +Code +
    caterpillar(m1; orderby=nothing, vline_at_zero=true)
    +
    +
    +
    +
    +

    +
    +
    +
    +
    + + + + Back to top + + +

    + + + + + \ No newline at end of file diff --git a/partial_within_files/figure-html/cell-10-output-1.svg b/partial_within_files/figure-html/cell-10-output-1.svg new file mode 100644 index 0000000..ba9340e --- /dev/null +++ b/partial_within_files/figure-html/cell-10-output-1.svg @@ -0,0 +1,990 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/partial_within_files/figure-html/cell-11-output-1.svg b/partial_within_files/figure-html/cell-11-output-1.svg new file mode 100644 index 0000000..ec94dde --- /dev/null +++ b/partial_within_files/figure-html/cell-11-output-1.svg @@ -0,0 +1,1576 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/partial_within_files/figure-html/cell-15-output-1.svg b/partial_within_files/figure-html/cell-15-output-1.svg new file mode 100644 index 0000000..9230443 --- /dev/null +++ b/partial_within_files/figure-html/cell-15-output-1.svg @@ -0,0 +1,1002 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/partial_within_files/figure-html/cell-16-output-1.svg b/partial_within_files/figure-html/cell-16-output-1.svg new file mode 100644 index 0000000..9b783ec --- /dev/null +++ b/partial_within_files/figure-html/cell-16-output-1.svg @@ -0,0 +1,1558 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg.html b/pkg.html index 260c3f7..fd3831f 100644 --- a/pkg.html +++ b/pkg.html @@ -2,14 +2,14 @@ - + - + -SMLP2023: Advanced Frequentist Track - Package management and reproducible environments +Package management and reproducible environments – SMLP2023: Advanced Frequentist Track - + @@ -86,7 +86,13 @@ "collapse-after": 3, "panel-placement": "end", "type": "overlay", - "limit": 20, + "limit": 50, + "keyboard-shortcut": [ + "f", + "/", + "s" + ], + "show-item-context": false, "language": { "search-no-results-text": "No results", "search-matching-documents-text": "matching documents", @@ -95,13 +101,14 @@ "search-more-match-text": "more match in this document", "search-more-matches-text": "more matches in this document", "search-clear-button-title": "Clear", + "search-text-placeholder": "", "search-detached-cancel-button-title": "Cancel", "search-submit-button-title": "Submit", "search-label": "Search" } } - + @@ -111,40 +118,40 @@
    -
    -
    -
    + +
    +
    Code
    using Arrow
     using CairoMakie
    @@ -373,7 +388,7 @@ 

    Raw score density

    CairoMakie.activate!(; type="svg") # use SVG (other options include PNG)
    -
    +
    tbl = Arrow.Table("./data/fggk21.arrow")
    Arrow.Table with 525126 rows, 7 columns, and schema:
    @@ -386,14 +401,14 @@ 

    Raw score density

    :score Float64
    -
    +
    df = DataFrame(tbl)
     describe(df)
    7×7 DataFrame
    - +
    - + @@ -490,7 +505,7 @@

    Raw score density

    -
    +
    let
       fdensity = Figure(; resolution=(1000, 500))
       axs = Axis(fdensity[1, 1])
    @@ -563,6 +578,33 @@ 

    Raw score density

    } } } + const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => { + const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light'; + const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark'; + let newTheme = ''; + if(darkModeDefault) { + newTheme = isAlternate ? baseTheme : alternateTheme; + } else { + newTheme = isAlternate ? alternateTheme : baseTheme; + } + const changeGiscusTheme = () => { + // From: https://github.com/giscus/giscus/issues/336 + const sendMessage = (message) => { + const iframe = document.querySelector('iframe.giscus-frame'); + if (!iframe) return; + iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app'); + } + sendMessage({ + setConfig: { + theme: newTheme + } + }); + } + const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null; + if (isGiscussLoaded) { + changeGiscusTheme(); + } + } const toggleColorMode = (alternate) => { // Switch the stylesheets const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate'); @@ -629,13 +671,15 @@

    Raw score density

    return localAlternateSentinel; } } - let localAlternateSentinel = 'default'; + const darkModeDefault = false; + let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default'; // Dark / light mode switch window.quartoToggleColorScheme = () => { // Read the current dark / light value let toAlternate = !hasAlternateSentinel(); toggleColorMode(toAlternate); setStyleSentinel(toAlternate); + toggleGiscusIfUsed(toAlternate, darkModeDefault); }; // Ensure there is a toggle, if there isn't float one in the top right if (window.document.querySelector('.quarto-color-scheme-toggle') === null) { @@ -670,18 +714,7 @@

    Raw score density

    } return false; } - const clipboard = new window.ClipboardJS('.code-copy-button', { - text: function(trigger) { - const codeEl = trigger.previousElementSibling.cloneNode(true); - for (const childEl of codeEl.children) { - if (isCodeAnnotation(childEl)) { - childEl.remove(); - } - } - return codeEl.innerText; - } - }); - clipboard.on('success', function(e) { + const onCopySuccess = function(e) { // button target const button = e.trigger; // don't keep focus @@ -713,11 +746,50 @@

    Raw score density

    }, 1000); // clear code selection e.clearSelection(); + } + const getTextToCopy = function(trigger) { + const codeEl = trigger.previousElementSibling.cloneNode(true); + for (const childEl of codeEl.children) { + if (isCodeAnnotation(childEl)) { + childEl.remove(); + } + } + return codeEl.innerText; + } + const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', { + text: getTextToCopy }); - function tippyHover(el, contentFn) { + clipboard.on('success', onCopySuccess); + if (window.document.getElementById('quarto-embedded-source-code-modal')) { + // For code content inside modals, clipBoardJS needs to be initialized with a container option + // TODO: Check when it could be a function (https://github.com/zenorocha/clipboard.js/issues/860) + const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', { + text: getTextToCopy, + container: window.document.getElementById('quarto-embedded-source-code-modal') + }); + clipboardModal.on('success', onCopySuccess); + } + var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); + var mailtoRegex = new RegExp(/^mailto:/); + var filterRegex = new RegExp("https:\/\/RePsychLing\.github\.io\/SMLP2023"); + var isInternal = (href) => { + return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); + } + // Inspect non-navigation links and adorn them if external + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)'); + for (var i=0; iRaw score density interactive: true, interactiveBorder: 10, theme: 'quarto', - placement: 'bottom-start' + placement: 'bottom-start', }; + if (contentFn) { + config.content = contentFn; + } + if (onTriggerFn) { + config.onTrigger = onTriggerFn; + } + if (onUntriggerFn) { + config.onUntrigger = onUntriggerFn; + } window.tippy(el, config); } const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]'); @@ -740,7 +821,130 @@

    Raw score density

    try { href = new URL(href).hash; } catch {} const id = href.replace(/^#\/?/, ""); const note = window.document.getElementById(id); - return note.innerHTML; + if (note) { + return note.innerHTML; + } else { + return ""; + } + }); + } + const xrefs = window.document.querySelectorAll('a.quarto-xref'); + const processXRef = (id, note) => { + // Strip column container classes + const stripColumnClz = (el) => { + el.classList.remove("page-full", "page-columns"); + if (el.children) { + for (const child of el.children) { + stripColumnClz(child); + } + } + } + stripColumnClz(note) + if (id === null || id.startsWith('sec-')) { + // Special case sections, only their first couple elements + const container = document.createElement("div"); + if (note.children && note.children.length > 2) { + container.appendChild(note.children[0].cloneNode(true)); + for (let i = 1; i < note.children.length; i++) { + const child = note.children[i]; + if (child.tagName === "P" && child.innerText === "") { + continue; + } else { + container.appendChild(child.cloneNode(true)); + break; + } + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(container); + } + return container.innerHTML + } else { + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + return note.innerHTML; + } + } else { + // Remove any anchor links if they are present + const anchorLink = note.querySelector('a.anchorjs-link'); + if (anchorLink) { + anchorLink.remove(); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + // TODO in 1.5, we should make sure this works without a callout special case + if (note.classList.contains("callout")) { + return note.outerHTML; + } else { + return note.innerHTML; + } + } + } + for (var i=0; i res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.getElementById(id); + if (note !== null) { + const html = processXRef(id, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + } else { + // See if we can fetch a full url (with no hash to target) + // This is a special case and we should probably do some content thinning / targeting + fetch(url) + .then(res => res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.querySelector('main.content'); + if (note !== null) { + // This should only happen for chapter cross references + // (since there is no id in the URL) + // remove the first header + if (note.children.length > 0 && note.children[0].tagName === "HEADER") { + note.children[0].remove(); + } + const html = processXRef(null, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + }, function(instance) { }); } let selectedAnnoteEl; @@ -784,6 +988,7 @@

    Raw score density

    } div.style.top = top - 2 + "px"; div.style.height = height + 4 + "px"; + div.style.left = 0; let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter"); if (gutterDiv === null) { gutterDiv = window.document.createElement("div"); @@ -809,6 +1014,32 @@

    Raw score density

    }); selectedAnnoteEl = undefined; }; + // Handle positioning of the toggle + window.addEventListener( + "resize", + throttle(() => { + elRect = undefined; + if (selectedAnnoteEl) { + selectCodeLines(selectedAnnoteEl); + } + }, 10) + ); + function throttle(fn, ms) { + let throttle = false; + let timer; + return (...args) => { + if(!throttle) { // first call gets through + fn.apply(this, args); + throttle = true; + } else { // all the others get throttled + if(timer) clearTimeout(timer); // cancel #2 + timer = setTimeout(() => { + fn.apply(this, args); + timer = throttle = false; + }, ms); + } + }; + } // Attach click handler to the DT const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); for (const annoteDlNode of annoteDls) { @@ -872,4 +1103,5 @@

    Raw score density

    - \ No newline at end of file + + \ No newline at end of file diff --git a/shrinkageplot.html b/shrinkageplot.html index da6d910..df53b18 100644 --- a/shrinkageplot.html +++ b/shrinkageplot.html @@ -2,14 +2,14 @@ - + - + -SMLP2023: Advanced Frequentist Track - More on shrinkage plots +More on shrinkage plots – SMLP2023: Advanced Frequentist Track - + @@ -88,7 +88,13 @@ "collapse-after": 3, "panel-placement": "end", "type": "overlay", - "limit": 20, + "limit": 50, + "keyboard-shortcut": [ + "f", + "/", + "s" + ], + "show-item-context": false, "language": { "search-no-results-text": "No results", "search-matching-documents-text": "matching documents", @@ -97,13 +103,14 @@ "search-more-match-text": "more match in this document", "search-more-matches-text": "more matches in this document", "search-clear-button-title": "Clear", + "search-text-placeholder": "", "search-detached-cancel-button-title": "Cancel", "search-submit-button-title": "Submit", "search-label": "Search" } } - + @@ -113,40 +120,40 @@
    -
    + +
    • 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.
    • This is similar to some of the criterion used in Machine Learning (ML), except that the criterion for LMMs has a rigorous mathematical basis.
    • @@ -382,8 +397,8 @@

      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
     using DataFrames
    @@ -397,7 +412,7 @@ 

    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:
    @@ -410,7 +425,7 @@ 

    More on shrinkage plots

    :rt_raw Int16
    -
    +
    contrasts = Dict(
       :subj => Grouping(),
       :item => Grouping(),
    @@ -429,11 +444,11 @@ 

    More on shrinkage plots

    fit(MixedModel, form, kb07; contrasts) end
    -
    Minimizing 799   Time: 0:00:01 ( 1.60 ms/it)
    -  objective:  28637.123623229592
    +
    Minimizing 874    Time: 0:00:01 ( 1.43 ms/it)
    +  objective:  28637.971010073215
    -
    -
    Row variable mean
    +
    +
    @@ -457,79 +472,79 @@

    More on shrinkage plots

    - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - + - - + + - + - - + + - + - - + + - + - + @@ -540,10 +555,10 @@

    More on shrinkage plots

    (Intercept)2181.672977.313628.222181.642477.351528.20 <1e-99301.8062362.2579301.8721362.4695
    spkr: old67.749118.26643.7167.749617.96073.77 0.000242.379540.680733.058841.1159
    prec: maintain-333.920547.1558-333.920047.1563 -7.08 <1e-1161.9630246.915858.8512247.3299
    load: yes78.770219.52984.0378.800719.72693.99 <1e-0464.975142.389066.952643.3991
    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.0515
    -
    +
    VarCorr(m1)
    -
    - +
    +
    @@ -568,8 +583,8 @@

    More on shrinkage plots

    - - + + @@ -577,35 +592,35 @@

    More on shrinkage plots

    - - - + + + - - - - + + + + - - + + + - - + - - + + @@ -613,35 +628,35 @@

    More on shrinkage plots

    - - - + + + - - + + - + - - - - - + + + + + - - + + @@ -650,128 +665,136 @@

    More on shrinkage plots

    subj (Intercept)91087.0055301.806291126.7545301.8721
    spkr: old1796.022142.3795+0.791092.886233.0588+1.00
    prec: maintain3839.412661.9630-0.59+0.023463.460358.8512-0.62-0.62
    load: yes4221.763864.97514482.649366.9526+0.36 +0.36+0.85+0.54+0.51
    item (Intercept)131230.7914362.2579131384.1084362.4695
    spkr: old1654.923240.6807+0.441690.521041.1159+0.42
    prec: maintain60967.4037246.915861172.0781247.3299 -0.69+0.35+0.37
    load: yes1796.828442.3890+0.32+0.16-0.141883.478543.3991+0.29+0.14-0.13
    Residual 446964.7062668.5542447629.9270669.0515
    -
    +
    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)      91126.7545 301.8721
    +         spkr: old         1092.8862  33.0588 +1.00
    +         prec: maintain    3463.4603  58.8512 -0.62 -0.62
    +         load: yes         4482.6493  66.9526 +0.36 +0.36 +0.51
    +item     (Intercept)     131384.1084 362.4695
    +         spkr: old         1690.5210  41.1159 +0.42
    +         prec: maintain   61172.0781 247.3299 -0.69 +0.37
    +         load: yes         1883.4785  43.3991 +0.29 +0.14 -0.13
    +Residual                 447629.9270 669.0515
      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.3515  28.20    <1e-99
    +spkr: old                                 67.7496      17.9607   3.77    0.0002
    +prec: maintain                          -333.92        47.1563  -7.08    <1e-11
    +load: yes                                 78.8007      19.7269   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.451194 ⋅ ⋅ ⋅ + 0.0494115 0.0 ⋅ ⋅ + -0.0547474 -0.0357256 0.0588535 ⋅ + 0.0359075 -0.0484787 0.0798414 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.541766 ⋅ ⋅ ⋅ + 0.0259255 0.0557178 ⋅ ⋅ + -0.253795 0.26783 0.0226493 ⋅ + 0.0189316 0.000867924 0.0620364 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
    + 91126.8 9979.54 -11057.2 7252.16 + 9979.54 1092.89 -1210.91 794.203 + -11057.2 -1210.91 3463.46 1998.68 + 7252.16 794.203 1998.68 4482.65
    -
    +
    diag(Σ₁)  # compare to the variance column in the VarCorr output
    4-element Vector{Float64}:
    - 91087.0054784778
    -  1796.0221392123499
    -  3839.4125796885137
    -  4221.763756192171
    + 91126.75451781915 + 1092.8862206704753 + 3463.4602904990634 + 4482.649272250181
    -
    +
    sqrt.(diag(Σ₁))
    4-element Vector{Float64}:
    - 301.8062383027856
    -  42.37950140353647
    -  61.96299363078348
    -  64.9751010479566
    + 301.8720830381954 + 33.05882969299542 + 58.85117068078649 + 66.95258973520129

    2 Shrinkage plots

    -
    -
    +
    +
    Code
    shrinkageplot(m1)
    -
    -
    -

    -
    Figure 1: Shrinkage plot of model m1
    +
    +
    +
    + +
    +
    +Figure 1: Shrinkage plot of model m1 +

    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}:
    @@ -785,7 +808,7 @@ 

    -
    +
    X1 * X1'
    8×8 Matrix{Int64}:
    @@ -815,7 +838,7 @@ 

    +
    m2 = let
       form = @formula(
         rt_trunc ~
    @@ -823,8 +846,8 @@ 

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

    -
    - +
    +
    @@ -931,10 +954,10 @@

    +
    VarCorr(m2)
    -
    -

    +
    +
    @@ -977,21 +1000,25 @@

    -
    +
    +
    Code
    shrinkageplot(m2)
    -
    -
    -

    -
    Figure 2: Shrinkage plot of model m2
    +
    +
    +
    + +
    +
    +Figure 2: Shrinkage plot of model m2 +
    -
    +
    m3 = let
       form = @formula(
         rt_trunc ~
    @@ -999,8 +1026,8 @@ 

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

    -
    -

    +
    +
    @@ -1028,7 +1055,7 @@

    77.4681

    - + @@ -1071,10 +1098,10 @@

    +
    VarCorr(m3)
    -
    -

    28.16 <1e-99364.7125364.7126 298.0259
    +
    +
    @@ -1088,21 +1115,21 @@

    - + - + - + @@ -1117,19 +1144,19 @@

    +
    rng = Random.seed!(1234321);
    -
    +
    m3btstrp = parametricbootstrap(rng, 2000, m3);
    -
    +
    DataFrame(shortestcovint(m3btstrp))
    9×5 DataFrame
    -

    item (Intercept)133015.242133015.244 364.713
    prec: maintain63766.93563766.937 252.521 -0.70
    subj (Intercept)88819.43888819.436 298.026
    +
    - + @@ -1193,14 +1220,14 @@

    item

    - + - + @@ -1208,7 +1235,7 @@

    σ

    - + @@ -1224,29 +1251,37 @@

    +
    ridgeplot(m3btstrp)
    -
    -
    -

    -
    Figure 3: Ridge plot of the fixed-effects coefficients from the bootstrap sample
    +
    +
    +
    + +
    +
    +Figure 3: Ridge plot of the fixed-effects coefficients from the bootstrap sample +
    -
    +
    ridgeplot(m3btstrp; show_intercept=false)
    -
    -
    -

    -
    Figure 4: Ridge plot of the fixed-effects coefficients from the bootstrap sample (with the intercept)
    +
    +
    +
    + +
    +
    +Figure 4: Ridge plot of the fixed-effects coefficients from the bootstrap sample (with the intercept) +
    -
    +
    m4 = let
       form = @formula(
         rt_trunc ~
    @@ -1254,8 +1289,8 @@ 

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

    -
    -

    Row type groupprec: maintain 171.547314.702314.7
    7 ρ item (Intercept), prec: maintain-0.89308-0.893081 -0.457084
    subj (Intercept)235.922235.921 364.717
    +
    +
    @@ -1283,7 +1318,7 @@

    77.4681

    - + @@ -1326,22 +1361,26 @@

    +
    m4bstrp = parametricbootstrap(rng, 2000, m4);
    -
    +
    ridgeplot(m4bstrp; show_intercept=false)
    -

    +
    +
    +

    +
    -
    +
    +
    DataFrame(shortestcovint(m4bstrp))
    9×5 DataFrame
    -

    28.16 <1e-99364.7125364.7126 298.0259
    +
    - + @@ -1405,14 +1444,14 @@

    item

    - + - + @@ -1420,7 +1459,7 @@

    σ

    - + @@ -1436,10 +1475,10 @@

    +
    VarCorr(m4)
    -
    -

    Row type groupprec: maintain 177.803318.379318.382
    7 ρ item (Intercept), prec: maintain-0.904904-0.904897 -0.477346
    subj (Intercept)234.299234.301 361.964
    +
    +
    @@ -1453,21 +1492,21 @@

    - + - + - + @@ -1482,8 +1521,8 @@

    -
    +
    +
    Code
    let mods = [m1, m2, m4]
       DataFrame(;
    @@ -1498,9 +1537,9 @@ 

    3×6 DataFrame
    -

    item (Intercept)133015.242133015.244 364.713
    prec: maintain63766.93563766.937 252.521 -0.70
    subj (Intercept)88819.43888819.436 298.026
    +
    - + @@ -1522,12 +1561,12 @@

    - + - - - - + + + + @@ -1552,13 +1591,17 @@

    +
    scatter(fitted(m4), residuals(m4))
    -
    -
    -

    -
    Figure 5: Residuals versus fitted values for model m4
    +
    +
    +
    + +
    +
    +Figure 5: Residuals versus fitted values for model m4 +
    @@ -1611,6 +1654,33 @@

    { + return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); + } + // Inspect non-navigation links and adorn them if external + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)'); + for (var i=0; i { + // Strip column container classes + const stripColumnClz = (el) => { + el.classList.remove("page-full", "page-columns"); + if (el.children) { + for (const child of el.children) { + stripColumnClz(child); + } + } + } + stripColumnClz(note) + if (id === null || id.startsWith('sec-')) { + // Special case sections, only their first couple elements + const container = document.createElement("div"); + if (note.children && note.children.length > 2) { + container.appendChild(note.children[0].cloneNode(true)); + for (let i = 1; i < note.children.length; i++) { + const child = note.children[i]; + if (child.tagName === "P" && child.innerText === "") { + continue; + } else { + container.appendChild(child.cloneNode(true)); + break; + } + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(container); + } + return container.innerHTML + } else { + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + return note.innerHTML; + } + } else { + // Remove any anchor links if they are present + const anchorLink = note.querySelector('a.anchorjs-link'); + if (anchorLink) { + anchorLink.remove(); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + // TODO in 1.5, we should make sure this works without a callout special case + if (note.classList.contains("callout")) { + return note.outerHTML; + } else { + return note.innerHTML; + } + } + } + for (var i=0; i res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.getElementById(id); + if (note !== null) { + const html = processXRef(id, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + } else { + // See if we can fetch a full url (with no hash to target) + // This is a special case and we should probably do some content thinning / targeting + fetch(url) + .then(res => res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.querySelector('main.content'); + if (note !== null) { + // This should only happen for chapter cross references + // (since there is no id in the URL) + // remove the first header + if (note.children.length > 0 && note.children[0].tagName === "HEADER") { + note.children[0].remove(); + } + const html = processXRef(null, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + }, function(instance) { }); } let selectedAnnoteEl; @@ -1832,6 +2064,7 @@

    { + elRect = undefined; + if (selectedAnnoteEl) { + selectCodeLines(selectedAnnoteEl); + } + }, 10) + ); + function throttle(fn, ms) { + let throttle = false; + let timer; + return (...args) => { + if(!throttle) { // first call gets through + fn.apply(this, args); + throttle = true; + } else { // all the others get throttled + if(timer) clearTimeout(timer); // cancel #2 + timer = setTimeout(() => { + fn.apply(this, args); + timer = throttle = false; + }, ms); + } + }; + } // Attach click handler to the DT const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); for (const annoteDlNode of annoteDls) { @@ -1918,12 +2177,12 @@

    @@ -1932,4 +2191,5 @@

    \ No newline at end of file diff --git a/shrinkageplot_files/figure-html/cell-14-output-1.svg b/shrinkageplot_files/figure-html/cell-14-output-1.svg index c99720a..49ecd12 100644 --- a/shrinkageplot_files/figure-html/cell-14-output-1.svg +++ b/shrinkageplot_files/figure-html/cell-14-output-1.svg @@ -1,1736 +1,1640 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shrinkageplot_files/figure-html/cell-29-output-1.svg b/shrinkageplot_files/figure-html/cell-29-output-1.svg index d1582ed..4734de0 100644 --- a/shrinkageplot_files/figure-html/cell-29-output-1.svg +++ b/shrinkageplot_files/figure-html/cell-29-output-1.svg @@ -1,625 +1,563 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/shrinkageplot_files/figure-html/fig-m1shrinkage-output-1.svg b/shrinkageplot_files/figure-html/fig-m1shrinkage-output-1.svg index 6bf88c1..a18eed9 100644 --- a/shrinkageplot_files/figure-html/fig-m1shrinkage-output-1.svg +++ b/shrinkageplot_files/figure-html/fig-m1shrinkage-output-1.svg @@ -1,2217 +1,2124 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shrinkageplot_files/figure-html/fig-m2shrinkage-output-1.svg b/shrinkageplot_files/figure-html/fig-m2shrinkage-output-1.svg index 365840d..6e3fae2 100644 --- a/shrinkageplot_files/figure-html/fig-m2shrinkage-output-1.svg +++ b/shrinkageplot_files/figure-html/fig-m2shrinkage-output-1.svg @@ -1,468 +1,429 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shrinkageplot_files/figure-html/fig-ridgeplot-output-1.svg b/shrinkageplot_files/figure-html/fig-ridgeplot-output-1.svg index 836572a..25ad519 100644 --- a/shrinkageplot_files/figure-html/fig-ridgeplot-output-1.svg +++ b/shrinkageplot_files/figure-html/fig-ridgeplot-output-1.svg @@ -1,691 +1,614 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shrinkageplot_files/figure-html/fig-ridgeplotnoint-output-1.svg b/shrinkageplot_files/figure-html/fig-ridgeplotnoint-output-1.svg index 831ba56..b69851b 100644 --- a/shrinkageplot_files/figure-html/fig-ridgeplotnoint-output-1.svg +++ b/shrinkageplot_files/figure-html/fig-ridgeplotnoint-output-1.svg @@ -1,616 +1,563 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/shrinkageplot_files/figure-html/fig-scatterm4-output-1.svg b/shrinkageplot_files/figure-html/fig-scatterm4-output-1.svg index d7926fa..33e7a43 100644 --- a/shrinkageplot_files/figure-html/fig-scatterm4-output-1.svg +++ b/shrinkageplot_files/figure-html/fig-scatterm4-output-1.svg @@ -1,1950 +1,1930 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/singularity.html b/singularity.html index c06aef3..d196ff4 100644 --- a/singularity.html +++ b/singularity.html @@ -2,14 +2,14 @@ - + - + -SMLP2023: Advanced Frequentist Track - Convergence, singularity and all that +Convergence, singularity and all that – SMLP2023: Advanced Frequentist Track - + @@ -107,7 +108,13 @@ "collapse-after": 3, "panel-placement": "end", "type": "overlay", - "limit": 20, + "limit": 50, + "keyboard-shortcut": [ + "f", + "/", + "s" + ], + "show-item-context": false, "language": { "search-no-results-text": "No results", "search-matching-documents-text": "matching documents", @@ -116,13 +123,14 @@ "search-more-match-text": "more match in this document", "search-more-matches-text": "more matches in this document", "search-clear-button-title": "Clear", + "search-text-placeholder": "", "search-detached-cancel-button-title": "Cancel", "search-submit-button-title": "Submit", "search-label": "Search" } } - + @@ -132,40 +140,40 @@
    -

    + +

    1 Background

    Belenky et al. (2003) reported effects of sleep deprivation across a 14-day study of 30-to-40-year old men and women holding commercial vehicle driving licenses. Their analyses are based on a subset of tasks and ratings from very large and comprehensive test and questionnaire battery (Balkin et al., 2000).

    @@ -434,15 +450,15 @@

    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
    -using Chain              # like pipes but cleaner
    +
    using CairoMakie         # device driver for static (SVG, PDF, PNG) plots
    +using Chain              # like pipes but cleaner
     using DataFrameMacros
     using DataFrames
     using MixedModels
    -using MixedModelsMakie   # plots specific to mixed-effects models using Makie
    +using MixedModelsMakie   # plots specific to mixed-effects models using Makie
     
     using ProgressMeter
     
    @@ -459,7 +475,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)
    @@ -468,9 +484,9 @@ 

    3 Preprocessingend

    GroupedDataFrame with 18 groups based on key: Subj

    First Group (10 rows): Subj = "S308"
    -

    Row geomdof npar1131.284130.126 2928637.128695.128854.328696.128638.028696.028855.228697.0
    2
    +
    - + @@ -558,19 +574,10 @@

    3 Preprocessing

    Row Subj day
    -

    -
    -
    -Last Group (10 rows): Subj = "S372" -
    -
    - -
    -
    -
    - +

    Last Group (10 rows): Subj = "S372"
    +
    - + @@ -661,15 +668,14 @@

    3 Preprocessing - -
    +
    df = gdf.parent
     describe(df)
    4×7 DataFrame
    -

    Row Subj day
    +
    - + @@ -740,7 +746,7 @@

    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)
    @@ -753,13 +759,13 @@

    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
    -

    Row variable mean
    +
    - + @@ -866,9 +872,9 @@

    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.

    -
    -
    +

    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
       ord = sortperm(first.(within.coef))
    @@ -888,10 +894,14 @@ 

    -
    -
    -

    -
    Figure 1: Reaction speed (s⁻¹) versus days of sleep deprivation by subject
    +
    +
    +
    + +
    +
    +Figure 1: Reaction speed (s⁻¹) versus days of sleep deprivation by subject +
    @@ -900,14 +910,17 @@

    6 Basic LMM

    -
    +
    contrasts = Dict(:Subj => Grouping())
     m1 = let
       form = @formula speed ~ 1 + day + (1 + day | Subj)
       fit(MixedModel, form, df; contrasts)
     end
    -
    -

    Row Subj coef
    +
    +
    Minimizing 69    Time: 0:00:00 ( 2.86 ms/it)
    +
    +
    +
    @@ -954,13 +967,13 @@

    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)
    -end
    -
    -
    +
    +
    m2 = let
    +  form = @formula speed ~ 1 + day + zerocorr(1 + day | Subj)
    +  fit(MixedModel, form, df; contrasts)
    +end
    +
    +
    @@ -1001,13 +1014,13 @@

    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)
    +
    MixedModels.likelihoodratiotest(m2, m1)
    -
    -

    +
    +
    @@ -1048,25 +1061,25 @@

    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
    -  mods = [m2, m1]
    -  DataFrame(;
    -    dof=dof.(mods),
    -    deviance=deviance.(mods),
    -    AIC=aic.(mods),
    -    AICc=aicc.(mods),
    -    BIC=bic.(mods),
    -  )
    -end
    +
    let
    +  mods = [m2, m1]
    +  DataFrame(;
    +    dof=dof.(mods),
    +    deviance=deviance.(mods),
    +    AIC=aic.(mods),
    +    AICc=aicc.(mods),
    +    BIC=bic.(mods),
    +  )
    +end
    2×5 DataFrame
    -

    +
    - + @@ -1112,16 +1125,20 @@

    8 Conditional mod

    9 Caterpillar plots (effect profiles)

    -
    -
    +
    +
    Code -
    caterpillar(m2)
    +
    caterpillar(m2)
    -
    -
    -

    -
    Figure 2: Prediction intervals on the random effects in model m2
    +
    +
    +
    + +
    +
    +Figure 2: Prediction intervals on the random effects in model m2 +
    @@ -1129,16 +1146,20 @@

    9 Caterpillar plo

    10 Shrinkage plot

    -
    -
    +
    +
    Code -
    shrinkageplot!(Figure(; resolution=(500, 500)), m2)
    +
    shrinkageplot!(Figure(; resolution=(500, 500)), m2)
    -
    -
    -

    -
    Figure 3: Shrinkage plot of the means of the random effects in model m2
    +
    +
    +
    + +
    +
    +Figure 3: Shrinkage plot of the means of the random effects in model m2 +
    @@ -1146,7 +1167,7 @@

    10 Shrinkage plo

    11 References

    -
    +
    Balkin, 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.
    @@ -1205,6 +1226,33 @@

    11 References { + const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light'; + const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark'; + let newTheme = ''; + if(darkModeDefault) { + newTheme = isAlternate ? baseTheme : alternateTheme; + } else { + newTheme = isAlternate ? alternateTheme : baseTheme; + } + const changeGiscusTheme = () => { + // From: https://github.com/giscus/giscus/issues/336 + const sendMessage = (message) => { + const iframe = document.querySelector('iframe.giscus-frame'); + if (!iframe) return; + iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app'); + } + sendMessage({ + setConfig: { + theme: newTheme + } + }); + } + const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null; + if (isGiscussLoaded) { + changeGiscusTheme(); + } + } const toggleColorMode = (alternate) => { // Switch the stylesheets const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate'); @@ -1271,13 +1319,15 @@

    11 References { // Read the current dark / light value let toAlternate = !hasAlternateSentinel(); toggleColorMode(toAlternate); setStyleSentinel(toAlternate); + toggleGiscusIfUsed(toAlternate, darkModeDefault); }; // Ensure there is a toggle, if there isn't float one in the top right if (window.document.querySelector('.quarto-color-scheme-toggle') === null) { @@ -1312,18 +1362,7 @@

    11 References11 References { + return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); + } + // Inspect non-navigation links and adorn them if external + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)'); + for (var i=0; i11 References11 References { + // Strip column container classes + const stripColumnClz = (el) => { + el.classList.remove("page-full", "page-columns"); + if (el.children) { + for (const child of el.children) { + stripColumnClz(child); + } + } + } + stripColumnClz(note) + if (id === null || id.startsWith('sec-')) { + // Special case sections, only their first couple elements + const container = document.createElement("div"); + if (note.children && note.children.length > 2) { + container.appendChild(note.children[0].cloneNode(true)); + for (let i = 1; i < note.children.length; i++) { + const child = note.children[i]; + if (child.tagName === "P" && child.innerText === "") { + continue; + } else { + container.appendChild(child.cloneNode(true)); + break; + } + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(container); + } + return container.innerHTML + } else { + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + return note.innerHTML; + } + } else { + // Remove any anchor links if they are present + const anchorLink = note.querySelector('a.anchorjs-link'); + if (anchorLink) { + anchorLink.remove(); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + // TODO in 1.5, we should make sure this works without a callout special case + if (note.classList.contains("callout")) { + return note.outerHTML; + } else { + return note.innerHTML; + } + } + } + for (var i=0; i res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.getElementById(id); + if (note !== null) { + const html = processXRef(id, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + } else { + // See if we can fetch a full url (with no hash to target) + // This is a special case and we should probably do some content thinning / targeting + fetch(url) + .then(res => res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.querySelector('main.content'); + if (note !== null) { + // This should only happen for chapter cross references + // (since there is no id in the URL) + // remove the first header + if (note.children.length > 0 && note.children[0].tagName === "HEADER") { + note.children[0].remove(); + } + const html = processXRef(null, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); + } + }, function(instance) { }); } let selectedAnnoteEl; @@ -1426,6 +1636,7 @@

    11 References11 References { + elRect = undefined; + if (selectedAnnoteEl) { + selectCodeLines(selectedAnnoteEl); + } + }, 10) + ); + function throttle(fn, ms) { + let throttle = false; + let timer; + return (...args) => { + if(!throttle) { // first call gets through + fn.apply(this, args); + throttle = true; + } else { // all the others get throttled + if(timer) clearTimeout(timer); // cancel #2 + timer = setTimeout(() => { + fn.apply(this, args); + timer = throttle = false; + }, ms); + } + }; + } // Attach click handler to the DT const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); for (const annoteDlNode of annoteDls) { @@ -1512,12 +1749,12 @@

    11 References

    Row dof deviance