02323 · Exercise Quiz 7
Question 1 of 1
In a study the transport delivery times for three transport firms are compared, and the study also involves the size of the transported item. For delivery times in days, the following data found:
Firms | Small item | Intermediate item | Large item | Row average |
---|---|---|---|---|
Firm A | 1.4 | 2.5 | 2.1 | 2.00 |
Firm B | 0.8 | 1.8 | 1.9 | 1.50 |
Firm C | 1.6 | 2.0 | 2.4 | 2.00 |
Column average | 1.27 | 2.10 | 2.13 |
A 95% confidence interval for the potential difference in means between Firm A and B is wanted, but without the assumption of normally distributed data. The following Python code was used to find a bootstrap-based confidence interval:
x = np.array([1.4, 2.5, 2.1]) y = np.array([0.8, 1.8, 1.9]) k = 10000 # Number of bootstrap samples
xsamples = np.random.choice(x, size=(k, len(x)), replace=True) ysamples = np.random.choice(y, size=(k, len(y)), replace=True)
mymeandifs = np.mean(xsamples, axis=1) - np.mean(ysamples, axis=1)
mybootquantiles = np.quantile(mymeandifs, [0.005,0.01,0.025,0.05,0.95,0.975,0.99,0.995],method=’averaged_inverted_cdf’) np.round(mybootquantiles, 3)
The next to last line finds eight different percentiles of the bootstrap distribution, which in the last line is printed out with 3 significant figures:
array([-0.433, -0.267, -0.233, -0.1 , 1.2 , 1.233, 1.367, 1.567])
What is the 95% confidence interval for the possible difference in means between Firm A and B based on this?