This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Bayesian p-values! | |
| library(tidyverse) | |
| library(brms) | |
| library(posterior) | |
| library(tidybayes) | |
| library(glue) | |
| library(ggview) | |
| options(scipen = 999) | |
| set.seed(25) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Berkson's paradox or collider bias in surveys | |
| library(tidyverse) | |
| library(ggdist) | |
| library(ggview) | |
| library(dagitty) | |
| library(ggdag) | |
| theme_set(theme_minimal(base_family = "Karla")) | |
| ## A dag of the scenario |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## You can use the fill aesthetic to indicate indicate uncertainty levels in ggdist geoms! | |
| library(tidyverse) | |
| library(tidybayes) | |
| library(posterior) | |
| library(brms) | |
| library(scico) | |
| library(marginaleffects) | |
| library(ggview) | |
| set.seed(5) #for reproducibility |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Visualize uncertainty in bar charts using fuzzy class boundaries | |
| ## as in https://stats.andrewheiss.com/lemon-lucifer/analysis/paper.html | |
| library(tidyverse) | |
| library(tidybayes) | |
| library(ggview) | |
| library(patchwork) | |
| library(glue) | |
| library(scico) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(brms) | |
| library(tidybayes) | |
| options(mc.cores = min(parallel::detectCores(),4)) | |
| ## Simulate data | |
| N <- 1000 | |
| dat <- tibble( | |
| y = sample(LETTERS[1:4], replace=TRUE, size = N) |> |