Session Ready
Exercise

Challenge (2)

Okay, remember the outline:

  1. Obtain a random sample.
  2. Calculate the sample's mean and standard deviation.
  3. Use these statistics to calculate a confidence interval.
  4. Repeat steps (1)-(3) 50 times.

Now that we've initialized our objects, we can use a for loop to calculate 50 times the mean and standard deviation of random samples.

In this exercise we're taking away the training wheels, so it will be a bit harder than the previous ones. But hey, that's why it's called a challenge!

Instructions
100 XP

Use a for loop to do 50 times the following:

  • create a sample of size n from the population (call this samp).
  • Calculate the mean and sd and assign them to their correct positions in samp_mean and samp_sd depending on which iteration you're on.