A soft drink bottler is analyzing vending machine service routes in his distribution system. 
He is interested in predicting the amount of time required by the route driver to service the vending machines in an outlet. This
service activity including stocking the machine with beverage products and minor maintenance or housekeeping. 
The industrial engineer responsible for the study has suggested that the two most important variables
affecting the delivery time are the number of cases of product stocked and the distance walked by the route driver. 
The engineer has collected 25 observations on delivery time (minutes), number of cases and distance
walked (metres).

\begin{center}
\begin{tabular}{rrrcrrrcrrr}
    \multicolumn{1}{c}{Time} &  \multicolumn{1}{c}{Cases} &  \multicolumn{1}{c}{Distance} & \phantom{xx} & 
\multicolumn{1}{c}{Time} &  \multicolumn{1}{c}{Cases} &  \multicolumn{1}{c}{Distance} & \phantom{xx} & 
\multicolumn{1}{c}{Time} &  \multicolumn{1}{c}{Cases} &  \multicolumn{1}{c}{Distance} \\ \cline{1-3} \cline{5-7} \cline{9-11}
16.68  &  7 \phantom{x}   &  171 \phantom{x} & &  11.50  &  3 \phantom{x}   &   67 \phantom{x} & &  12.03  &  3 \phantom{x}   &  104 \phantom{x} \\
 14.88  &  4 \phantom{x}   &      24  \phantom{x}  & & 13.75  &  6 \phantom{x}   &      46 \phantom{x} & & 18.11  &  7  \phantom{x}   &    101 \phantom{x} \\
  8.00  &  2 \phantom{x}   &      34  \phantom{x}  & & 17.83  &  7 \phantom{x}   &      64 \phantom{x} & & 79.24  & 30  \phantom{x}   &    445 \phantom{x} \\
 21.50  &  5 \phantom{x}   &     184  \phantom{x}  & & 40.33  & 16 \phantom{x}   &     210 \phantom{x} & & 21.00  & 10  \phantom{x}   &     66 \phantom{x} \\
 13.50  &  4 \phantom{x}   &      78  \phantom{x}  & & 19.75  &  6 \phantom{x}   &     141 \phantom{x} & & 24.00  &  9  \phantom{x}   &    137 \phantom{x} \\
 29.00  & 10 \phantom{x}   &     237  \phantom{x}  & & 15.35  &  6 \phantom{x}   &      61 \phantom{x} & & 19.00  &  7  \phantom{x}   &     40 \phantom{x} \\
  9.50  &  3 \phantom{x}   &      11  \phantom{x}  & & 35.10  & 17 \phantom{x}   &     235 \phantom{x} & & 17.90  & 10  \phantom{x}   &     43 \phantom{x} \\
 52.32  & 26 \phantom{x}   &     247  \phantom{x}  & & 18.75  &  9 \phantom{x}   &     137 \phantom{x} & & 19.83  &  8  \phantom{x}   &    194 \phantom{x} \\
 10.75  &  4 \phantom{x}   &      46 \phantom{x} \\
\end{tabular}
\end{center}

The engineer decided to fit a model that used {\sf Cases}, {\sf Distance} and the {\sf Cases:Distance} 
interaction as regressors.  Her reason for including the interaction term was that she felt that the 
impact that the distance walked by the route driver has  on delivery time will increase as the number of cases 
increases.
\begin{verbatim}
    > delivery.fit2<-lm(Time~Cases*Distance)
    > summary(delivery.fit2)
    Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
    (Intercept)    7.149924   1.402289   5.099 4.75e-05 ***
    Cases          1.013252   0.191662   5.287 3.06e-05 ***
    Distance       0.018963   0.011102   1.708 0.102358    
    Cases:Distance 0.002441   0.000575   4.246 0.000361 ***
    ---
    Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 

    Residual standard error: 2.452 on 21 degrees of freedom
    Multiple R-Squared: 0.9782,	Adjusted R-squared: 0.9751 
    F-statistic: 313.8 on 3 and 21 DF,  p-value:   0 
\end{verbatim}

\vspace{10mm}

\begin{enumerate}
\item{}
Explain what each of the following parts of the regression output 
indicates:
\begin{enumerate}
\item{}
\verb+ Residual standard error: 2.452+
\item{}
\verb+ Multiple R-Squared: 0.9782+
\item{}
\verb+ F-statistic: 313.8 on 3 and 21 DF,  p-value:   0+
\end{enumerate}

\marks{5}

\newpage

\item{}
Does the fitted model support the engineer's contention that ``the 
impact that the distance walked by the route driver has  on delivery time will increase as the number of cases 
increases''? Justify your answer.

\marks{5}

\vspace{29mm}


\item{}
The {\tt predict} command in R can be used to create 
two types of interval estimates: 
confidence intervals and prediction intervals. The following interval 
estimates were obtained 
for a delivery involving 25 cases that have to be transported 
50 metres:
\begin{verbatim}
   > new.df<-data.frame(list( Cases=25 , Distance=50))
   > predict(delivery.fit2,new.df,interval="confidence",level=.95)
             fit      lwr      upr
   [1,] 36.48094 29.43656 43.52532
   
   > predict(delivery.fit2,new.df,interval="prediction",level=.95)
             fit      lwr      upr
   [1,] 36.48094 27.78517 45.17671
\end{verbatim}

Explain, in language that a non-statistics major can understand, what each 
of these intervals represent. Make sure that the difference 
between these two types of interval estimates is clear from your explanation. 

\marks{5}
\vspace{29mm}


\item{}
\begin{enumerate}
\item{}
An index plot of Cook's Distance (not shown) indicates that observation 9 
(this is the observation with $\mbox{\sf time}=79.24$) has 
a much larger value of Cook's Distance than any other observation. 
What does this indicate about observation 9?
\item{}
The output from {\tt influence.measures} for observation 9 is:
\begin{small}
\begin{verbatim}

   dfb.1.  dfb.Case  dfb.Dist dfb.Cs.D  dffit  cov.r   cook.d   hat   inf
9  0.954    -1.310    -0.653   2.240    3.304  12.917  2.740   0.922   *

\end{verbatim}
\end{small}

What do you deduce from (1) the value of the covariance ratio and (2) 
the values of the DFBETA's? Note that {\tt dfb.Cs.D} represents the DFBETA diagnostic 
for the interaction term.

\end{enumerate}

\marks{5}

\end{enumerate}

