library(here)
library(tidyverse)
library(lme4)
library(BayesFactor)
library(brms)
frames <- read_csv(here("data", "data_samplesize.csv"))

If you’d done the sampling frames experiment, which analyses would you actually report in a paper? Here we’ll give a frequentist approach and two Bayesian approaches.

Load and plot data

fullframes <- frames %>% 
  mutate(generalisation = (response+.1)/9.2) %>% mutate(id=factor(id)) %>% 
  mutate(id=factor(id)) %>% 
  mutate(sample_size = factor(sample_size, levels = c("small","medium","large"))) 

fullframes_avg <- fullframes %>%
  group_by(test_item, condition, sample_size) %>%
  summarise(
    n = n(),
    sd=sd(generalisation), 
    se=sd/sqrt(n),
    generalisation = mean(generalisation),
    ) %>%
  ungroup()

expsummary <- fullframes_avg %>%
  ggplot(aes(x = test_item, y = generalisation, colour = condition)) +
  geom_line() +
  geom_point() +
  geom_errorbar(aes(ymin = generalisation - se, ymax = generalisation + se)) +
  facet_wrap(~sample_size)
plot(expsummary)