Week 2 Python Assessment :Fitting Statistical Models to Data with Python (Statistics with Python Specialization) Answers 2025
1. What is the value of the coefficient for predictor bmi?
(Answer format #.####)
Answer:
✅ 0.0037
Explanation:
This matches the BMI coefficient reported for the model (change in log-odds per one unit BMI).
2. Are the predictors for this model statistically significant (yes / no)?
-
✅ No
-
❌ Yes
Explanation:
The BMI coefficient’s 95% CI includes 0 (e.g. −0.005 to 0.011) so BMI is not significant; Age was significant previously but not all predictors here are significant, so the correct overall answer is No.
3. What most likely happened to our R-Squared value when we added predictor bp to our initial model?
-
❌ Decreased
-
✅ Increased
-
❌ Stayed the same
Explanation:
Adding a predictor cannot decrease (ordinary) R² — it will typically increase (or remain the same if the predictor provides zero additional explanatory power).
4. What type of model should we use when our target outcome is continuous?
-
❌ Logistic regression
-
✅ Linear Regression
-
❌ Confidence intervals
Explanation:
Continuous outcomes are modeled with linear regression (ordinary least squares), not logistic regression which is for binary outcomes.
5. Which of our predictors has the largest coefficient?
-
✅ Intercept
-
❌ DMDEDUC2x[T.HS]
-
❌ DMDEDUC2x[T.SomeCollege]
-
❌ DMDEDUC2x[T.x9_11]
Explanation:
Based on the model table, the intercept has the largest (absolute) coefficient value compared to the listed education dummy coefficients.
6. Which values for DMDEDUC2x and RIAGENDRx are represented in our intercept (reference level)?
-
✅ Male and Some College
-
❌ Female and Age
-
❌ Female and College
-
❌ Male and HS
Explanation:
The intercept corresponds to the reference category for categorical predictors; here the reference levels are Male for RIAGENDRx and Some College for DMDEDUC2x.
7. What model should we use when our target outcome is binary (0/1)?
-
❌ Hypothesis Tests
-
❌ Linear Regression
-
✅ Logistic Regression
-
❌ None of the above
Explanation:
Binary outcomes (0/1) are modeled with logistic regression (to estimate probabilities/odds), not ordinary linear regression.
🧾 Summary Table
| Q# | Answer | Key point |
|---|---|---|
| 1 | 0.0037 | BMI coefficient (log-odds change per unit BMI) |
| 2 | No | Not all predictors are significant (BMI CI includes 0) |
| 3 | Increased | Adding predictor usually raises R² |
| 4 | Linear Regression | Continuous outcome → linear model |
| 5 | Intercept | Intercept has largest coefficient among listed terms |
| 6 | Male & Some College | Reference levels represented by intercept |
| 7 | Logistic Regression | Binary outcome → logistic model |