class: center, middle, inverse, title-slide # Logistic Regression ### Bora Jin --- layout: true <div class="my-footer"> <span> <a href="https://introds.org" target="_blank">introds.org</a> </span> </div> --- ## Material 🎥 Watch [Logistic Regression](https://www.youtube.com/watch?v=AidXFYSYfJg) - [Slides](https://rstudio-education.github.io/datascience-box/course-materials/slides/u4-d06-logistic-reg/u4-d06-logistic-reg.html#1) --- ## Today's Goal - Understand logistic regression - Be able to fit logistic regression in `R` --- ## Quiz **Q - Which of the following is the correct scenario to use a logistic regression?** a. when we have multiple categorical predictors b. when we have a mix of numeric and categorical predictors c. when we have a count response variable d. when we have a binary response variable --- ## Quiz **Q - Which of the following is the correct scenario to use a logistic regression?** a. when we have multiple categorical predictors b. when we have a mix of numeric and categorical predictors c. when we have a count response variable **d. when we have a binary response variable** --- ## Quiz **Q - Which of the following is not correct for a logistic regression? Select all that apply.** a. it is a non-linear model b. it uses a logit link c. logit is a function of a binary response `\(y\)` d. in order to fit the logistic regression in `R`, we define `family = "binomial"` --- ## Quiz **Q - Which of the following is not correct for a logistic regression? Select all that apply.** **a. it is a non-linear model** `\(\rightarrow\)` linear model with `\(logit(p)\)` as a response (Generalized linear model) b. it uses a logit link **c. logit is a function of a binary response `\(y\)`** `\(\rightarrow\)` it is a function of the success probability `\(p\)` of `\(y\)` d. in order to fit the logistic regression in `R`, we define `family = "binomial"` --- ## Quiz **Q - Write out a logistic model using parameters.** -- $$ \log\left(\frac{p}{1-p}\right) = \beta_0 + \beta_1~x$$ No error term! --- class: middle, center # Questions? --- ## Let's Practice Together! Go to [AE 23: Logistic Regression](https://sta199-summer22.netlify.app/appex/ae23_BJ.html) --- ## Bulletin - Project peer review due Wednesday, June 15 at 11:59pm - HW02, HW04 due Thursday, June 16 at 11:59pm - Submit `ae22` by Wednesday, June 15 at 9:29am - Submit `ae23` by Thursday, June 16 at 9:29am