Session Ready
Exercise

Sampling distribution of prices

And now the real challenge: running a loop.

Since you have access to the population, we can simulate the sampling distribution for \(\overline{x}\) by taking 5000 samples of size 50 from the population and compute 5000 sample means.

Instructions
100 XP
  • Initialize an object sample_means50 with 5000 NAs.
  • Use a for loop to create 5000 samples of size 50 of price.
  • Inside the loop, calculate the mean of each sample and assign it to its place in sample_means50.
  • Inspect the result by printing sample_means50 using the head() function.
  • Based on this sampling distribution, think about what the mean home price of the population will be?