In the Fall of 2023, I moved over a bunch of stuff from PowerPoint slides (nearly) verbatim. I was in a rush, so I told myself to move it just move it over and improve it later.
Go back, reread, and improve. PowerPoint doesn't always translate perfectly to book format.
Left off at
2023-10-03: Completed the first draft of the chapter.
Tasks
[ ] Module quiz. Task 6 is just a standard logistic regression question. However, I kept getting a weird answer. Males had 2 times the odds of the outcome -- ever drink -- but, my regression results kept telling me that females had 2 times the odds. I called Doug and we finally figured it out. The problem was that the outcome variable, ALQ111, was coded as 1 = Yes and 2 = No instead of 0 = No and 1 = Yes. So, the model was estimating the log odds of NOT ever drinking. Apparently, the glm() function will predict the first value of the regressand, by default. To fix this issue, you have to either have to recode the outcome variable to 0/1 or you have to use something like nhanes$ALQ111_f <- relevel(nhanes$ALQ111_f, ref = "No"). You should definitely add this to R4Epi and the lab.
[ ] Add a discussion of converting log odds to odds.
[ ] Interpret model results other than coefficients. For example, degrees of freedom, null deviance, residual deviance, and AIC.
[ ] Add multiple regression.
[ ] Improve discussion of model assumptions. Possibly move to the top of the page.
[ ] Add p-values, p-value curves, and confidence intervals.
Overview
In the Fall of 2023, I moved over a bunch of stuff from PowerPoint slides (nearly) verbatim. I was in a rush, so I told myself to move it just move it over and improve it later.
Go back, reread, and improve. PowerPoint doesn't always translate perfectly to book format.
Left off at
2023-10-03: Completed the first draft of the chapter.
Tasks
ALQ111
, was coded as 1 = Yes and 2 = No instead of 0 = No and 1 = Yes. So, the model was estimating the log odds of NOT ever drinking. Apparently, theglm()
function will predict the first value of the regressand, by default. To fix this issue, you have to either have to recode the outcome variable to 0/1 or you have to use something likenhanes$ALQ111_f <- relevel(nhanes$ALQ111_f, ref = "No")
. You should definitely add this to R4Epi and the lab.