STAT 1124
HW2
Data : Anesthesiology Hrs.csv
R Script : HW2 SRegr (Anesthesiology).R
Distribution of Marks
Question # XXXXXXXXXX10 Total
Marks XXXXXXXXXX /26
Instructions:
• Please hand in your HW on paper. All software output must copy-pasted if you type your HW, or
printed if you handwrite your HW.
• HW is due at the beginning of class on the due date.
• You can do your HW in pairs. If you do so hand in only one HW with both your names.
Hospital management have collected data over 24 months. For each month they record the total staff-
hours (HOURS) needed to run the anaesthesiology department and the number of surgery cases
(CASES) processed in that month.
Load the data in RStudio and define the variables:
y = HOURS
x = CASES
1. Produce the summary statistics for the two variables. Fill the table below [3 marks]:
n Min Q1 Q2 Mean Q3 Max SD
y = HOURS
x = CASES
2. What constitutes an element (an observation) in these data? [1 mark]
3. Manually calculate the least-square (regression) line to predict HOURS using CASES. The value of
has been calculated to be 0.885. [4 marks]
4. Regress HOURS on CASES: (ie., use HOURS as the dependent variable, and CASES as the
independent variable.) Show the R output for the summary of the regression model. (>summary(mod)),
and the Scatter Plot. Copy/paste them to your HW, or print them if you handwrite the rest of your HW.
(Compare the the results of your manual calculation above to the software output. They should be the
same except for round-off e
or) [2 marks]
5. Identify the slope of the Regression Line and interpret what it means in the context of the problem.
Use the number from software output. [3 marks]
p. 1/2
6. Predict the anesthesiology staff time required (in hrs.) for a month when 400 surgeries are
scheduled. Construct a prediction interval that will be co
ect 95% of the time. (Note, R calls the
RMSE “Residual standard e
or.”) [3 marks]
7. Produce the R output for the Residual Plot and the Density Trace of the Residuals. [2 marks]
8. Are the two variables linearly related? Explain your answer by comparing r to the appropriate
decision point, as well as by commenting on the overall shape shown in the Scatte
Residual Plot.
[4 marks]
9. What does the Normality assumption mean in the context of this problem? [2 marks]
10. Is reasonable to assume that the Normality assumption has been satisfied in this problem? Justify
your answer. [2 marks]
p. 2/2