In: Math
Suppose a market analyst wants to determine whether the average price of a gallon of whole milk in Seattle is greater than Atlanta. To do so, he takes a telephone survey of 21 randomly selected consumers in Seattle who have purchased a gallon of milk and asks how much they paid for it. The analyst undertakes a similar survey in Atlanta with 18 respondents. Assume the population variance for Seattle is 0.03, the population variance for Atlanta is 0.015, and that the price of milk is normally distributed. Given average price for Seattle is $2.52, and average price for Atlanta is $2.38.
(1). Use the correct R command to compute a 99% confidence level confidence interval of the difference in the mean price of a gallon of milk between Seattle and Atlanta. (note: in the R function, you need the value of standard deviation for both samples. You need to calculate the standard deviation based on the variance, then plug the standard deviation values in the R function) What are the lower bound and upper bound of the interval?
(2). Using a 1% level of significance (alpha = 0.01), manually test whether the average price of a gallon of whole milk in Seattle is greater than Atlanta. What is the statistical decision and business decision?
(3). Using a 1% level of significance. Import data set MilkPrice_S.csv and MilkPrice_A.csv files to R studio. Write the correct R commands for testing whether the average price of a gallon of whole milk in Seattle is greater than Atlanta. What is the p value? What is the statistical decision and business decision?
Seattle | |||||||||||||||||||
2.55 | |||||||||||||||||||
2.36 | |||||||||||||||||||
2.43 | |||||||||||||||||||
2.67 | |||||||||||||||||||
2.54 | |||||||||||||||||||
2.43 | |||||||||||||||||||
2.5 | |||||||||||||||||||
2.54 | |||||||||||||||||||
2.38 | |||||||||||||||||||
2.61 | |||||||||||||||||||
2.8 | |||||||||||||||||||
2.49 | |||||||||||||||||||
2.43 | |||||||||||||||||||
2.61 | |||||||||||||||||||
2.57 | |||||||||||||||||||
2.36 | |||||||||||||||||||
2.56 | |||||||||||||||||||
2.71 | |||||||||||||||||||
2.5 | |||||||||||||||||||
2.64 | |||||||||||||||||||
2.27
|
1) Two variance test: to test variances are statistically equal or not
P-value: 0.3182, is significantly greater than 0.05. We can conlude that the variances of both variables are equal.
Confidence interval:
99% confidence interval of mean difference between two variables is: 0.04007144 - 0.2405648
2)
Seattle | Atlanta | |
Mean | 2.521429 | 2.381111 |
Variance | 0.016633 | 0.010258 |
Observations | 21 | 18 |
Two sample t test for equal variances:
,
Significant value: 0.05
The test statistic:
Pooled variance:
df= n1+n2-2= 37
P-value: for one tail= 0.000318
The test statistic is significant and there is enough evidence to support the claim that the seattle is higher than Atlanta.
3)P-value is lessthan 0.05 significant value. So, we can conlude that the test statistic is significant and conlude that the seattle mean is statistically higher than Atlanta.