We use the following packages:

library(plyr)
library(dplyr)
library(magrittr)
library(ggplot2)

Exercise

  1. Sample 100 samples from a standard normal distribution.
  2. For each of these samples, calculate the following statistics for the mean:
  1. Create a plot that demonstrates the following

    “A replication of the procedure that generates a 95% confidence interval that is centered around the sample mean would cover the population value at least 95 out of 100 times” (Neyman, 1934)

  2. Present a table containing all simulated samples for which the resulting confidence interval does not contain the population value.


End of Practical