Chef Lim Chef Lim is a Chinese restaurant that takes delivery orders. Most of it
ID: 3262560 • Letter: C
Question
Chef Lim
Chef Lim is a Chinese restaurant that takes delivery orders. Most of its deliveries are within a 10-mile radius, but it occasionally delivers to customers more than 10 miles away. Chef Lim employs a number of delivery people, four of whom are relatively new hires. The restaurant has recently been receiving customer complaints about excessively long delivery times. Therefore, SnowPea has collected data on a random sample of deliveries by its four new delivery people during the peak dinner time. Chef Lim is concerned that one or more of the new delivery people might be slower than others.
Managerial report: Using a word processor, write a managerial report about the recommendation and the reason why you make such a recommendation. You must write the report in a clear and concise manner with supporting graphs and tables, equations. Your report will be graded by the rubric. When you are developing a conclusion, consider the following guideline.
***Please need help with the following***:
A: Using the regression analysis and develop a regression equation to predict delivery time.
-Make four separate regression models: one for each deliverer. For each deliverer, what is the predicted delivery time of the customer who lives 15 miles away from the restaurant?
-Make one regression model ignoring deliverer information, what is the predicted delivery time of the customer who lives 15 miles away from the restaurant?
-What is the 95% confidence interval of the prediction in part b.
Do other analyses that you think are necessary or beneficial to make recommendations.
The variables in the dataset are as follows:
Deliverer: which person made the delivery
PrepTime: time from when order was placed until delivery person started driving it to the customer
TravelTime: time to drive from Chef Lim to customer
Distance: distance (miles) from Chef Lim to customer
Order Deliverer PrepTime TravelTime Distance 1 3 13.0 30.0 13.3 2 1 10.9 17.8 8.6 3 1 9.2 9.2 4.7 4 3 7.2 14.7 4.3 5 2 14.5 21.9 12.2 6 2 9.5 8.1 3.6 7 2 7.1 31.6 11.3 8 3 8.5 29.0 10.3 9 2 9.8 4.9 2.6 10 1 14.3 13.4 5.3 11 1 12.0 12.9 4.5 12 2 13.0 8.8 4.1 13 1 14.9 8.7 4.2 14 1 9.7 29.9 11.7 15 2 10.0 18.2 9.5 16 3 10.8 22.9 8.8 17 1 12.1 5.0 1.7 18 1 9.9 9.9 4.5 19 1 7.9 9.0 3.7 20 2 17.2 6.5 3.4 21 4 10.2 29.3 3.4 22 3 15.0 24.0 9.8 23 4 12.5 19.5 5.4 24 1 11.0 10.5 5.0 25 4 15.7 29.0 7.9 26 2 10.1 2.6 1.4 27 3 8.2 19.0 7.5 28 1 9.2 13.4 7.0 29 2 18.7 8.9 5.6 30 4 11.0 9.3 2.2 31 1 9.3 22.8 8.2 32 2 10.1 14.5 7.7 33 1 11.4 26.1 12.9 34 3 18.0 10.8 3.8 35 4 14.0 28.8 11.7 36 2 15.4 21.2 10.7 37 4 6.1 6.9 2.8 38 3 13.9 21.9 8.4 39 4 9.5 17.8 4.6 40 1 10.3 9.5 4.3 41 3 14.4 29.7 6.9 42 2 9.4 23.5 12.2 43 3 6.6 17.0 6.3 44 4 15.6 18.5 5.9 45 2 9.7 13.8 9.2 46 1 14.0 5.3 2.5 47 1 11.7 3.3 1.4 48 4 12.7 0.7 0.2 49 1 14.6 1.9 0.6 50 1 9.5 12.6 6.5 51 1 7.1 7.2 3.3 52 3 8.5 7.3 3.0 53 4 9.9 26.2 5.2 54 4 14.3 28.7 8.9 55 4 12.0 23.1 7.7 56 1 13.0 12.6 7.2 57 4 16.2 28.3 8.2 58 4 10.3 9.4 4.1 59 4 8.5 29.8 13.0 60 1 9.5 21.6 11.6 61 3 13.1 10.1 3.1 62 3 8.4 24.1 5.8 63 3 17.0 6.0 2.8 64 4 14.2 18.6 2.4 65 3 8.8 13.6 4.6 66 2 12.9 29.5 14.0 67 2 10.9 17.8 6.9 68 3 9.7 23.8 6.4 69 2 13.4 18.9 10.1 70 2 8.7 7.0 2.9 71 1 17.3 16.6 9.3 72 3 7.0 31.3 8.6 73 1 9.0 3.5 1.5 74 1 13.1 11.9 4.4 75 1 11.0 11.6 3.6 76 2 12.0 7.5 3.3Explanation / Answer
We will solve the question in R. Write each code in the editor of the statistical software R. You will get the output as pasted. Here is the code to import the data in R.
Code:
delvr<-c(3,
1,
1,
3,
2,
2,
2,
3,
2,
1,
1,
2,
1,
1,
2,
3,
1,
1,
1,
2,
4,
3,
4,
1,
4,
2,
3,
1,
2,
4,
1,
2,
1,
3,
4,
2,
4,
3,
4,
1,
3,
2,
3,
4,
2,
1,
1,
4,
1,
1,
1,
3,
4,
4,
4,
1,
4,
4,
4,
1,
3,
3,
3,
4,
3,
2,
2,
3,
2,
2,
1,
3,
1,
1,
1,
2
)
travtime<-c(30,
17.8,
9.2,
14.7,
21.9,
8.1,
31.6,
29,
4.9,
13.4,
12.9,
8.8,
8.7,
29.9,
18.2,
22.9,
5,
9.9,
9,
6.5,
29.3,
24,
19.5,
10.5,
29,
2.6,
19,
13.4,
8.9,
9.3,
22.8,
14.5,
26.1,
10.8,
28.8,
21.2,
6.9,
21.9,
17.8,
9.5,
29.7,
23.5,
17,
18.5,
13.8,
5.3,
3.3,
0.7,
1.9,
12.6,
7.2,
7.3,
26.2,
28.7,
23.1,
12.6,
28.3,
9.4,
29.8,
21.6,
10.1,
24.1,
6,
18.6,
13.6,
29.5,
17.8,
23.8,
18.9,
7,
16.6,
31.3,
3.5,
11.9,
11.6,
7.5
)
distance<-c(13.3,
8.6,
4.7,
4.3,
12.2,
3.6,
11.3,
10.3,
2.6,
5.3,
4.5,
4.1,
4.2,
11.7,
9.5,
8.8,
1.7,
4.5,
3.7,
3.4,
3.4,
9.8,
5.4,
5,
7.9,
1.4,
7.5,
7,
5.6,
2.2,
8.2,
7.7,
12.9,
3.8,
11.7,
10.7,
2.8,
8.4,
4.6,
4.3,
6.9,
12.2,
6.3,
5.9,
9.2,
2.5,
1.4,
0.2,
0.6,
6.5,
3.3,
3,
5.2,
8.9,
7.7,
7.2,
8.2,
4.1,
13,
11.6,
3.1,
5.8,
2.8,
2.4,
4.6,
14,
6.9,
6.4,
10.1,
2.9,
9.3,
8.6,
1.5,
4.4,
3.6,
3.3
)
data<-data.frame(delvr,travtime,distance)
Now, we will conduct the regressiona analysis step by step for each deliverer.
Deliverer-1.
Code:
lg1<-lm(travtime~distance, data= subset(data,delvr==1))
summary(lg1)
Output:
/* Start of Output */
> lg1<-lm(travtime~distance, data= subset(data,delvr==1))
> summary(lg1)
Call:
lm(formula = travtime ~ distance, data = subset(data, delvr ==
1))
Residuals:
Min 1Q Median 3Q Max
-3.2168 -0.9405 -0.6122 0.4332 5.2674
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.1557 0.8939 1.293 0.209
distance 2.0066 0.1392 14.415 5.25e-13 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.275 on 23 degrees of freedom
Multiple R-squared: 0.9003, Adjusted R-squared: 0.896
F-statistic: 207.8 on 1 and 23 DF, p-value: 5.246e-13
/* End of Output */
Now, the regression equation for deliverer-1 is
Traveltime = 1.1557+ 2.0066*Distance,
So, the predicted delivery time when the distance is 15 miles = 1.1557+ 2.0066*15 = 31.25 minutes.
Deliverer-2.
Code:
lg2<-lm(travtime~distance, data= subset(data,delvr==2))
summary(lg2)
Output:
/* Start of Output */
> lg2<-lm(travtime~distance, data= subset(data,delvr==2))
> summary(lg2)
Call:
lm(formula = travtime ~ distance, data = subset(data, delvr ==
2))
Residuals:
Min 1Q Median 3Q Max
-4.8561 -1.1996 -0.4122 0.7791 8.6951
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.04258 1.47137 0.029 0.977
distance 2.02321 0.17869 11.322 4.75e-09 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.944 on 16 degrees of freedom
Multiple R-squared: 0.889, Adjusted R-squared: 0.8821
F-statistic: 128.2 on 1 and 16 DF, p-value: 4.755e-09
/* End of Output */
Now, the regression equation for deliverer-2 is
Traveltime = 0.0426 + 2.0232*Distance,
So, the predicted delivery time when the distance is 15 miles =0.0426 + 2.0232*15 =30.39 minutes.
Deliverer-3.
Code:
lg3<-lm(travtime~distance, data= subset(data,delvr==3))
summary(lg3)
Output:
/* Start of Output */
> lg3<-lm(travtime~distance, data= subset(data,delvr==3))
> summary(lg3)
Call:
lm(formula = travtime ~ distance, data = subset(data, delvr ==
3))
Residuals:
Min 1Q Median 3Q Max
-5.3480 -2.6367 -1.7999 0.7441 9.4817
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.9065 2.7649 1.413 0.178
distance 2.3640 0.3801 6.220 1.64e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 4.484 on 15 degrees of freedom
Multiple R-squared: 0.7206, Adjusted R-squared: 0.702
F-statistic: 38.69 on 1 and 15 DF, p-value: 1.64e-05
/* End of Output */
Now, the regression equation for deliverer-3 is
Traveltime = 3.9065 + 2.3640*Distance,
So, the predicted delivery time when the distance is 15 miles =3.9065 + 2.3640*15 = 39.37 minutes.
Deliverer-4.
Code:
lg4<-lm(travtime~distance, data= subset(data,delvr==4))
summary(lg4)
Output:
/* Start of Output */
> lg4<-lm(travtime~distance, data= subset(data,delvr==4))
> summary(lg4)
Call:
lm(formula = travtime ~ distance, data = subset(data, delvr ==
4))
Residuals:
Min 1Q Median 3Q Max
-7.9911 -3.8763 -0.4072 3.5795 14.0658
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.2822 3.0789 2.690 0.017600 *
distance 2.0447 0.4549 4.495 0.000504 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6.195 on 14 degrees of freedom
Multiple R-squared: 0.5907, Adjusted R-squared: 0.5615
F-statistic: 20.21 on 1 and 14 DF, p-value: 0.0005039
/* End of Output */
Now, the regression equation for deliverer-4 is
Traveltime = 8.2822 + 2.0447* Distance,
So, the predicted delivery time when the distance is 15 miles = 8.2822 + 2.0447*15 =38.95 minutes.
Now, we will conduct the overall regression with the deliverer information.
Code:
lg<-lm(travtime~distance, data)
summary(lg)
Output:
/* Start of Output */
> lg<-lm(travtime~distance, data)
> summary(lg)
Call:
lm(formula = travtime ~ distance, data = data)
Residuals:
Min 1Q Median 3Q Max
-8.382 -3.220 -2.083 1.782 18.960
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.3981 1.2337 2.754 0.0074 **
distance 2.0417 0.1726 11.831 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 5.178 on 74 degrees of freedom
Multiple R-squared: 0.6542, Adjusted R-squared: 0.6495
F-statistic: 140 on 1 and 74 DF, p-value: < 2.2e-16
/* End of Output */
Now, the regression equation for overall is
Traveltime = 3.3981+2.0417*Distance,
So, the predicted delivery time when the distance is 15 miles = 3.3981+2.0417*15 =34.02 minutes.
To get the 95% confidence interval, write the following code:
newdata<-data.frame(distance=15)
predict(lg,newdata, interval="confidence",conf.level=0.95)
Output:
/* Start of Output */
> newdata<-data.frame(distance=15)
> predict(lg,newdata, interval="confidence",conf.level=0.95)
fit lwr upr
1 34.02321 30.7951 37.25132
/* End of Output */
So, the 95% confidence interval is
(30.80,37.25)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.