# ferdo Lab — Proposed Week 5: Sampling & uncertainty (STUDENT)
# Independent companion, not verified against UCL Moodle Week 5.
# All numbers are fictional. No external R packages required.
rt_ms <- c(620, 610, 590, 605, 615, 600, 625, 595, 608, 612, 598, 603)

# A) Inspect sample size, mean, standard deviation and standard error.
# TODO: n <- ... ; mean_rt <- ... ; sd_rt <- ... ; se_rt <- ...

# B) Predict: what does replacing resample size 4 by size 10 change?
# Sample WITH replacement from these same 12 fictional observations.
set.seed(46)
# TODO: means_n4 <- replicate(1000, mean(sample(rt_ms, 4, replace=TRUE)))
# TODO: means_n10 <- ...
# TODO: hist(...); sd(means_n4); sd(means_n10)

# C) Explain: what is a sampling distribution?
# Why do repeated resamples NOT make our fictional data representative?

# D) Optional: generate a proper size-n bootstrap percentile interval
# for the *observed 12-value sample mean* (rather than the n=10 comparison).
# TODO: means_n12 <- replicate(1000, mean(sample(rt_ms, n, replace=TRUE)))
# TODO: quantile(means_n12, c(.025, .975))
# Explain why bootstrap cannot repair sampling bias.
