Please solve the following using statistical software, R. Question: Jim and Joyc
ID: 3230928 • Letter: P
Question
Please solve the following using statistical software, R.
Question:
Jim and Joyce are opening a new restaurant, and they want to see if there average food item price of $8.19 is different from the rest of the town. They decided to look up a random sample of 37 menus (this town is big into restaurants) and looked at the cost. The data they found is provided below.
12.19
8.65
10.50
9.00
5.12
12.64
7.53
4.22
8.91
8.11
4.31
10.22
11.52
11.87
10.65
19.22
15.81
17.64
11.20
19.56
16.00
14.23
15.78
9.10
9.87
10.31
11.45
15.67
14.89
12.34
9.99
11.11
18.10
17.85
14.93
15.87
12.39
Test the normality of the population of food item cost for restaurants in this town. Use a significance level of 0.05. (10 points)
Hint: The name of the test you need to perform is called the Shapiro-Wilk’s Test
Are the assumptions for a one sample mean hypothesis test met? (5 points)
Test to see if the average food price of Jim and Joyce differs from rest of the town. Use a significance level of 0.05. (20 points)
Construct a 90% confidence interval for the mean menu price. Does this confidence interval match your conclusion in part c? Explain. (15 points)
******You must show all four steps of the hypothesis test.******
12.19
8.65
10.50
9.00
5.12
12.64
7.53
4.22
8.91
8.11
4.31
10.22
11.52
11.87
10.65
19.22
15.81
17.64
11.20
19.56
16.00
14.23
15.78
9.10
9.87
10.31
11.45
15.67
14.89
12.34
9.99
11.11
18.10
17.85
14.93
15.87
12.39
Explanation / Answer
Normality:
H0: The data is follows normal distribution
H1: The data is not follows normal distribution
Let the los be alpha = 0.05
> data=read.table("E:/data1.txt",header=F)
> price=data$V1
> shapiro.test(price)
Shapiro-Wilk normality test
data: price
W = 0.97132, p-value = 0.4452
Here P-value 0.4452 > alpha 0.05, so we accept H0
Thus we conclude that The data is follows normal distribution
Test for single mean
For this test, the assumption of t distribution is satiesfied since variable (price) is follows normal distribution
H0: the average food price of Jim and Joyce is not differs from rest of the town
H1: the average food price of Jim and Joyce differs from rest of the town
> t.test(price, mu=8.19, conf.level = 0.95)
One Sample t-test
data: price
t = 6.0272, df = 36, p-value = 6.392e-07
alternative hypothesis: true mean is not equal to 8.19
95 percent confidence interval:
10.80315 13.45361
sample estimates:
mean of x
12.12838
The p-value is 6.392e-07 < alpha 0.05, So we reject H0
thus we conclude that the average food price of Jim and Joyce differs from rest of the town
90% Confdiece interval:
> t.test(price, mu=8.19, conf.level = 0.90)
One Sample t-test
data: price
t = 6.0272, df = 36, p-value = 6.392e-07
alternative hypothesis: true mean is not equal to 8.19
90 percent confidence interval:
11.02518 13.23157
sample estimates:
mean of x
12.12838
90 percent confidence interval of populatio mean : ( 11.02518, 13.23157)
> data=read.table("E:/data1.txt",header=F)
> price=data$V1
> shapiro.test(price)
Shapiro-Wilk normality test
data: price
W = 0.97132, p-value = 0.4452