Screen Link:
https://app.dataquest.io/m/305/the-mean/8/estimating-the-population-mean
My Code:
import matplotlib.pyplot as plt
parameter = houses['SalePrice'].mean()
for i in range(101):
sample = houses['SalePrice'].sample(n = 5 + (29*i), random_state = i)
statistic = sample.mean()
sampling_errors = parameter - statistic
sample_size = 5 + (29*i)
plt.scatter(x = sample_size, y = sampling_errors)
plt.axvline(2930)
plt.axhline(0)
plt.xlabel('Sample size')
plt.ylabel('Sampling error')
plt.show()
What I expected to happen:
The task here is to find how sample size effects our sampling. In the above code I kept on increasing the sample size and measured the sampling_error(sample mean - mean of series) and the plot this sampling error on scatter plot. This is what I got.
What actually happened:
As per DQ, my plot is not matching the expected result
Your plot didn't matched the expected plot.