From 86740cd8e03c2cba25f3fd4dd2da7873e0deab1f Mon Sep 17 00:00:00 2001 From: Tobias Gerstenberg Date: Mon, 12 Feb 2024 13:20:30 -0800 Subject: [PATCH] updates incl model comparison --- 15-model_comparison.Rmd | 25 +- docs/404.html | 18 +- docs/model-comparison.html | 903 +++++++++--------- .../figure-html/unnamed-chunk-15-1.png | Bin 101346 -> 67847 bytes .../figure-html/unnamed-chunk-16-1.png | Bin 125284 -> 49733 bytes .../figure-html/unnamed-chunk-17-1.png | Bin 150175 -> 63304 bytes .../figure-html/unnamed-chunk-20-1.png | Bin 65300 -> 50192 bytes .../figure-html/unnamed-chunk-3-1.png | Bin 59233 -> 158217 bytes .../figure-html/unnamed-chunk-4-1.png | Bin 34763 -> 247167 bytes .../figure-html/unnamed-chunk-6-1.png | Bin 103280 -> 98540 bytes .../figure-html/unnamed-chunk-8-1.png | Bin 144674 -> 81737 bytes docs/search_index.json | 2 +- .../figure-html/unnamed-chunk-15-1.png | Bin 101346 -> 67847 bytes .../figure-html/unnamed-chunk-16-1.png | Bin 125284 -> 49733 bytes .../figure-html/unnamed-chunk-17-1.png | Bin 150175 -> 63304 bytes .../figure-html/unnamed-chunk-20-1.png | Bin 65300 -> 50192 bytes .../figure-html/unnamed-chunk-3-1.png | Bin 59233 -> 158217 bytes .../figure-html/unnamed-chunk-4-1.png | Bin 34763 -> 247167 bytes .../figure-html/unnamed-chunk-6-1.png | Bin 103280 -> 98540 bytes .../figure-html/unnamed-chunk-8-1.png | Bin 144674 -> 81737 bytes 20 files changed, 475 insertions(+), 473 deletions(-) diff --git a/15-model_comparison.Rmd b/15-model_comparison.Rmd index b1bca40..a73d4f2 100644 --- a/15-model_comparison.Rmd +++ b/15-model_comparison.Rmd @@ -144,8 +144,11 @@ plot_fit = function(i){ geom_point(data = df.more_data, size = 2, color = "red") + - geom_smooth(method = "lm", se = F, - formula = y ~ poly(x, degree = i, raw = TRUE)) + + geom_smooth(method = "lm", + se = F, + formula = y ~ poly(x, + degree = i, + raw = TRUE)) + annotate(geom = "text", x = Inf, y = -Inf, @@ -189,7 +192,9 @@ sd = 0.5 # sample df.data = tibble(participant = 1:sample_size, - x = runif(sample_size, min = 0, max = 1), + x = runif(sample_size, + min = 0, + max = 1), y = b0 + b1*x + b2*x^2 + rnorm(sample_size, sd = sd)) ``` @@ -198,7 +203,7 @@ And plot it: ```{r} ggplot(data = df.data, mapping = aes(x = x, - y = y)) + + y = y)) + geom_smooth(method = "lm", formula = y ~ x + I(x^2)) + geom_point() @@ -283,8 +288,10 @@ fun.cv_plot = function(data_point){ filter(color == 2)) %>% clean_names() - p = ggplot(df.plot, - aes(x, y, color = as.factor(color))) + + p = ggplot(data = df.plot, + mapping = aes(x = x, + y = y, + color = as.factor(color))) + geom_segment(aes(xend = x, yend = fitted), data = df.fit, @@ -518,10 +525,12 @@ df.normal = tibble(y = seq(-5, 5, 0.1), # show the residual plot together with the normal distribution ggplot(data = df.plot , - mapping = aes(x = fitted, y = resid)) + + mapping = aes(x = fitted, + y = resid)) + geom_point() + geom_path(data = df.normal, - aes(x = x, y = y), + aes(x = x, + y = y), size = 2) ``` diff --git a/docs/404.html b/docs/404.html index fc51834..0eb93b0 100644 --- a/docs/404.html +++ b/docs/404.html @@ -23,7 +23,7 @@ - + @@ -51,8 +51,6 @@ - - - @@ -328,36 +292,36 @@
  • 5.8 Session info
  • -
  • 6 Probability and causality +
  • 6 Probability
  • 7 Simulation 1
  • -
  • 7.4 Bayesian inference with the normal distribution +
  • 7.4 Pinguin exercise +
  • +
  • 7.5 Bayesian inference with the normal distribution
  • -
  • 7.5 Additional resources +
  • 7.6 Additional resources
  • -
  • 7.6 Session info
  • +
  • 7.7 Session info
  • 8 Simulation 2
  • 8.5 Additional resources
  • 8.6 Session info
  • @@ -425,7 +393,7 @@
  • 9.3 Hypothesis testing: “One-sample t-test”
  • 9.4 Building a sampling distribution of PRE
  • -
  • 9.5 Misc
  • +
  • 9.5 Misc
  • 9.6 Additional resources
  • @@ -478,7 +446,7 @@
  • 11.8 Additional resources
  • 11.9 Session info
  • 11.10 References
  • @@ -509,7 +477,7 @@
  • 12.7 Additional resources
  • 12.8 Session info
  • @@ -529,7 +497,7 @@
  • 13.6 Additional resources
  • 13.7 Session info
  • @@ -552,7 +520,7 @@
  • 14.8 Session info
  • @@ -607,7 +575,7 @@
  • 16.9 Session info
  • @@ -712,7 +680,7 @@
  • 21.7 Logistic mixed effects model
  • 21.8 Additional information
  • 21.9 Session info
  • @@ -835,7 +803,11 @@ -
  • 26.3 Session info
  • +
  • 26.3 Additional resources +
  • +
  • 26.4 Session info
  • 27 Cheatsheets