# set seed for reproducibility set.seed(1) # sample the observations # estimate the mean and assign the estimate to `mu_hat` # compute the 95% confidence interval using the formula above CI <- c( "lower" = NA, "upper" = NA ) set.seed(1) mu_hat <- mean(rnorm(100, mean = 10, sd = 10)) CI <- c( "lower" = mu_hat - 1.96, "upper" = mu_hat + 1.96 ) test_object("CI") test_object("mu_hat") test_object("CI")