Which of these cells would correctly find a bootstrapped 95% confidence interval for the mean weight of a population? a. orig_sample = Table().read_table("Sample.csv") new_means = make_array() for i in np.arange(1000): new_mean = np.average(orig_sample.sample().column("Weight")) new_means = np.append(new_means, new_mean) Lower_bd = percentile(2.5, new_means) Upper_bd = percentile(97.5, new_means) print(f"The 95% confidence interval is from {Lower_bd} to {Upper_bd}") b. orig_sample = Table().read_table("Sample.csv") new_means = make_array() for i in np.arange(1000): new_mean = np.average(orig_sample.sample().select(Weight)) new_means = np.append(new_means, new_mean) Lower_bd = percentile(5, new_means) Upper_bd = percentile(95, new_means) print(f"The 95% confidence interval is from {Lower_bd} to {Upper_bd}") c. orig_sample = Table().read_table("Sample.csv") new_means = make_array() for i in np.arange(1000): new_mean = np.average(orig_sample.column(Weight)) new_means = np.append(new_means, new_mean) Lower_bd = percentile(2.5, new_means) Upper_bd = percentile(97.5, new_means) print(f"The 95% confidence interval is from {Lower_bd} to {Upper_bd}")
Which of these cells would correctly find a bootstrapped 95% confidence interval for the
a.
orig_sample = Table().read_table("Sample.csv")
new_means = make_array()
for i in np.arange(1000):
new_mean = np.average(orig_sample.sample().column("Weight"))
new_means = np.append(new_means, new_mean)
Lower_bd = percentile(2.5, new_means)
Upper_bd = percentile(97.5, new_means)
print(f"The 95% confidence interval is from {Lower_bd} to {Upper_bd}")
b.
orig_sample = Table().read_table("Sample.csv")
new_means = make_array()
for i in np.arange(1000):
new_mean = np.average(orig_sample.sample().select(Weight))
new_means = np.append(new_means, new_mean)
Lower_bd = percentile(5, new_means)
Upper_bd = percentile(95, new_means)
print(f"The 95% confidence interval is from {Lower_bd} to {Upper_bd}")
c.
orig_sample = Table().read_table("Sample.csv")
new_means = make_array()
for i in np.arange(1000):
new_mean = np.average(orig_sample.column(Weight))
new_means = np.append(new_means, new_mean)
Lower_bd = percentile(2.5, new_means)
Upper_bd = percentile(97.5, new_means)
print(f"The 95% confidence interval is from {Lower_bd} to {Upper_bd}")
Trending now
This is a popular solution!
Step by step
Solved in 4 steps