Calculate R2 for this regression model. Predict the response when a patient takes 5 table spoons per day.

Question 1

(Do it by hand and show all your steps. You may use R for double-checking, if you want) A medical study was designed to study the efficacy of a certain medication and its dose. In this study, X represents the dose, the number of table spoons of medication administrated per day; and Y represents the response, a self-reposted improvement score.

Patient A B C D E F X112233 Y 0 6 6 12 6 12

Fitting the linear regression model in R produced the following output. > reg = lm(Y ∼ X)

> reg

>anova(reg)
Analysis of Variance Table:

Response: Y

X Residuals

Coefficients: (Intercept) X

13

Df SumSq MeanSq Fvalue Pr(>F) 1 36 36.0 2.1818 0.2137 4 66 16.5

  1. (a) Calculate R2 for this regression model.

  2. (b) Predict the response when a patient takes 5 table spoons per day.

  3. (c) For the lack of fit test, state the null and the alternative hypotheses; calculate the extra sum of squares and the F-statistic.

  4. (d) (Stat-627 only) While solving part (c), at some point, you treated dose X as a categorical variable. Keeping X categorical, estimate the prediction mean square error by the LOOCV.

  5. (e) It was noticed that patients A,C and E took a generic, whereas patients B,D and F took the brand-name medicine. Based on the scatterplot, can you tell if the type of medicine has a non-zero interaction with the dose?

SAMPLE ASSIGNMENT
Powered by WordPress