Skip to content

Commit

Permalink
updates incl model comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasgerstenberg committed Feb 12, 2024
1 parent 5b08c0e commit 86740cd
Show file tree
Hide file tree
Showing 20 changed files with 475 additions and 473 deletions.
25 changes: 17 additions & 8 deletions 15-model_comparison.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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))
```

Expand All @@ -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()
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
```

Expand Down
18 changes: 15 additions & 3 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="Tobias Gerstenberg" />


<meta name="date" content="2024-02-09" />
<meta name="date" content="2024-02-12" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -51,8 +51,6 @@
<link href="libs/anchor-sections-1.1.0/anchor-sections.css" rel="stylesheet" />
<link href="libs/anchor-sections-1.1.0/anchor-sections-hash.css" rel="stylesheet" />
<script src="libs/anchor-sections-1.1.0/anchor-sections.js"></script>
<script src="libs/kePrint-0.0.1/kePrint.js"></script>
<link href="libs/lightable-0.0.1/lightable.css" rel="stylesheet" />


<style type="text/css">
Expand Down Expand Up @@ -903,6 +901,20 @@ <h1>Page not found</h1>
});
</script>

<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
var src = "true";
if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:")
if (/^https?:/.test(src))
src = src.replace(/^https?:/, '');
script.src = src;
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>

</html>
903 changes: 442 additions & 461 deletions docs/model-comparison.html

Large diffs are not rendered by default.

Binary file modified docs/psych252_files/figure-html/unnamed-chunk-15-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/psych252_files/figure-html/unnamed-chunk-16-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/psych252_files/figure-html/unnamed-chunk-17-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/psych252_files/figure-html/unnamed-chunk-20-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/psych252_files/figure-html/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/psych252_files/figure-html/unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/psych252_files/figure-html/unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/psych252_files/figure-html/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/search_index.json

Large diffs are not rendered by default.

Binary file modified psych252_files/figure-html/unnamed-chunk-15-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified psych252_files/figure-html/unnamed-chunk-16-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified psych252_files/figure-html/unnamed-chunk-17-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified psych252_files/figure-html/unnamed-chunk-20-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified psych252_files/figure-html/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified psych252_files/figure-html/unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified psych252_files/figure-html/unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified psych252_files/figure-html/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 86740cd

Please sign in to comment.