Section A.9 Multiple And Logistic Regression
Solution 1. Exercise 1
-
\(\widehat{baby\_\hspace{0.3mm}weight} = 123.05 - 8.94 \times smoke\text{.}\)
-
The estimated body weight of babies born to smoking mothers is 8.94 ounces lower than babies born to non-smoking mothers. Smoker: \(123.05 - 8.94 \times 1 = 114.11\) ounces. Non-smoker: \(123.05 - 8.94 \times 0 = 123.05\) ounces.
-
\(H_0\text{:}\) \(\beta_1 = 0\text{.}\) \(H_A\text{:}\) \(\beta_1 \ne 0\text{.}\) \(T= -8.65\text{,}\) and the p-value is approximately 0. Since the p-value is very small, we reject \(H_0\text{.}\) The data provide strong evidence that the true slope parameter is different than 0 and that there is an association between birth weight and smoking. Furthermore, having rejected \(H_0\text{,}\) we can conclude that smoking is associated with lower birth weights.
Solution 2. Exercise 3
-
\(\widehat{baby\_weight} = -80.41 + 0.44 \times gestation - 3.33 \times parity - 0.01 \times age + 1.15 \times height + 0.05 \times weight - 8.40 \times smoke\text{.}\)
-
\(\beta_{gestation}\text{:}\) The model predicts a 0.44 ounce increase in the birth weight of the baby for each additional day of pregnancy, all else held constant. \(\beta_{age}\text{:}\) The model predicts a 0.01 ounce decrease in the birth weight of the baby for each additional year in motherβs age, all else held constant.
-
Parity might be correlated with one of the other variables in the model, which complicates model estimation.
-
\(\widehat{baby\_\hspace{0.3mm}weight} = 120.58\text{.}\) \(e = 120 - 120.58 = -0.58\text{.}\) The model over-predicts this babyβs birth weight.
-
\(R^2 = 0.2504\text{.}\) \(R_{adj}^2 = 0.2468\text{.}\)
Solution 3. Exercise 5
Solution 5. Exercise 9
Based on the p-value alone, either gestation or smoke should be added to the model first. However, since the adjusted \(R^2\) for the model with gestation is higher, it would be preferable to add gestation in the first step of the forward- selection algorithm. (Other explanations are possible. For instance, it would be reasonable to only use the adjusted \(R^2\text{.}\))
Solution 6. Exercise 11
Solution 7. Exercise 13
Nearly normal residuals: With so many observations in the data set, we look for particularly extreme outliers in the histogram and do not see any. variability of residuals: The scatterplot of the residuals versus the fitted values does not show any overall structure. However, values that have very low or very high fitted values appear to also have somewhat larger outliers. In addition, the residuals do appear to have constant variability between the two parity and smoking status groups, though these items are relatively minor. Independent residuals: The scatterplot of residuals versus the order of data collection shows a random scatter, suggesting that there is no apparent structures related to the order the data were collected. Linear relationships between the response variable and numerical explanatory variables: The residuals vs. height and weight of mother are randomly distributed around 0. The residuals vs. length of gestation plot also does not show any clear or strong remaining structures, with the possible exception of very short or long gestations. The rest of the residuals do appear to be randomly distributed around 0. All concerns raised here are relatively mild. There are some outliers, but there is so much data that the influence of such observations will be minor.
Solution 8. Exercise 15
-
There are a few potential outliers, e.g. on the left in the \var{total\_\hspace{0.3mm}length} variable, but nothing that will be of serious concern in a data set this large.
-
When coefficient estimates are sensitive to which variables are included in the model, this typically indicates that some variables are collinear. For example, a possumβs gender may be related to its head length, which would explain why the coefficient (and p-value) for \var{sex\_\hspace{0.3mm}male} changed when we removed the \var{head\_\hspace{0.3mm}length} variable. Likewise, a possumβs skull width is likely to be related to its head length, probably even much more closely related than the head length was to gender.
Solution 9. Exercise 17
-
The logistic model relating \(\hat{p}_i\) to the predictors may be written as \(\log\left( \frac{\hat{p}_i}{1 - \hat{p}_i} \right) = 33.5095 - 1.4207\times sex\_male_i - 0.2787 \times skull\_width_i + 0.5687 \times total\_length_i - 1.8057 \times tail\_length_i\text{.}\) Only \var{total\_\hspace{0.3mm}length} has a positive association with a possum being from Victoria.
-
\(\hat{p} = 0.0062\text{.}\) While the probability is very near zero, we have not run diagnostics on the model. We might also be a little skeptical that the model will remain accurate for a possum found in a US zoo. For example, perhaps the zoo selected a possum with specific characteristics but only looked in one region. On the other hand, it is encouraging that the possum was caught in the wild. (Answers regarding the reliability of the model probability will vary.).
Solution 10. Exercise 19
-
False. When predictors are collinear, it means they are correlated, and the inclusion of one variable can have a substantial influence on the point estimate (and standard error) of another.
-
True.
-
False. This would only be the case if the data was from an experiment and \(x_1\) was one of the variables set by the researchers. (Multiple regression can be useful for forming hypotheses about causal relationships, but it offers zero guarantees.).
-
False. We should check normality like we would for inference for a single mean: we look for particularly extreme outliers if \(n \geq 30\) or for clear outliers if \(n \lt 30\text{.}\)
Solution 11. Exercise 21
Solution 12. Exercise 23
-
The equation is: [Math: \log\left(\frac{p_i}{1 - p_i}\right) &= -0.8124 &\quad- 2.6351 \times \resp{to\us{}multiple} &\quad + 1.6272 \times \resp{winner} &\quad- 1.5881 \times \resp{format} &\quad - 3.0467 \times \resp{re\us{}subj} ].
-
First find \(\log\left(\frac{p}{1 - p}\right)\text{,}\) then solve for \(p\text{:}\) [Math: &\log\left(\frac{p}{1 - p}\right) &\quad= -0.8124 - 2.6351 \times 0 + 1.6272 \times 1 &\qquad- 1.5881 \times 0 - 3.0467 \times 0 &\quad= 0.8148 &\frac{p}{1 - p} = e^{0.8148} \quad\to\quad p = 0.693 ].
-
It should probably be pretty high, since it could be very disruptive to the person using the email service if they are missing emails that arenβt spam. Even only a 90\% chance that a message is spam is probably enough to warrant keeping it in the inbox. Maybe a probability of 99\% would be a reasonable cutoff. As for other ideas to make it even better, it may be worth building a second model that tries to classify the importance of an email message. If we have both the spam model and the importance model, we now have a better way to think about cost-benefit tradeoffs. For instance, perhaps we would be willing to have a lower probability-of-spam threshold for messages we were confident were not important, and perhaps we want an even higher probability threshold (e.g. 99.99\%) for emails we are pretty sure are important.
