Very right-skewed, almost bi-modal. Mean of sampe is 1477, this is around what a typical value seems to be (or slightly less, given skew… median is 1372).
Not exactly identical, but having a similar mean, and likely also right-skewed given sample size.
We expect that 95% of these confidence intervals will include the true mean of the population.
Yes
95% … because we expect the sampling distribution to be approximately normal, and our confidence intervals use the sample data to determine the 95% confidence interval based on this assumption, using the sample data mean and std dev. as stand-ins for the population parameters.
samp_mean <- rep(NA, 50)
samp_sd <- rep(NA, 50)
n <- 60
for(i in 1:50){
samp <- sample(population, n) # obtain a sample of size n = 60 from the population
samp_mean[i] <- mean(samp) # save sample mean in ith element of samp_mean
samp_sd[i] <- sd(samp) # save sample sd in ith element of samp_sd
}
lower_vector <- samp_mean - 1.96 * samp_sd / sqrt(n)
upper_vector <- samp_mean + 1.96 * samp_sd / sqrt(n)Using the following function (which was downloaded with the data set), plot all intervals. What proportion of your confidence intervals include the true population mean? Is this proportion exactly equal to the confidence level? If not, explain why.
plot_ci(lower_vector, upper_vector, mean(population))2/50## [1] 0.04
96% of the CI’s include the mean… which is pretty close to the confidence interval. The confidence intervals are just an estimate, not a parameter of the population, so we do expect some variation based on the randomness inherent in the samples.
lower_vector <- samp_mean - 1.65 * samp_sd / sqrt(n)
upper_vector <- samp_mean + 1.65 * samp_sd / sqrt(n)
plot_ci(lower_vector, upper_vector, mean(population))7/50## [1] 0.14
plot_ci function, plot all intervals and calculate the proportion of intervals that include the true population mean. How does this percentage compare to the confidence level selected for the intervals?This confidence interval is lower (90%), so we are less confident our sample CI’s will include the true population mean, and accordingly, we see several more CI’s that do not include mu, as expected.