Question: Empirical distribution of random sample means def simulate_sample_mean(table, label, sample_size, repetitions): means = make_array() for i in np.arange(repetitions): new_sample_mean = one_sample_mean(table, label, sample_size) means =

"""Empirical distribution of random sample means"""

def simulate_sample_mean(table, label, sample_size, repetitions): means = make_array()

for i in np.arange(repetitions): new_sample_mean = one_sample_mean(table, label, sample_size) means = np.append(means, new_sample_mean)

sample_means = Table().with_column('Sample Means', means) # Display empirical histogram and print all relevant quantities - don't change this! sample_means.hist(bins=20) plt.xlabel('Sample Means') plt.title('Sample Size ' + str(sample_size)) print("Sample size: ", sample_size) print("Population mean:", np.mean(table.column(label))) print("Average of sample means: ", np.mean(means)) print("Population SD:", np.std(table.column(label))) print("SD of sample means:", stats.tstd(means)) return stats.tstd(means)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!