Exercise

# Fitting a model

Logistic regression is a special case of a broader class of generalized linear models, often known as GLMs. Specifying a logistic regression model is very similar to specify a regression model, with two important differences:

- We use the
`glm()`

function instead of`lm()`

- We specify the
`family`

argument and set it to`binomial`

. This tells the GLM function that we want to fit a logistic regression model to our binary response. [The terminology stems from the assumption that our binary response follows a binomial distribution.]

We still use the `formula`

and `data`

arguments with `glm()`

.

Note that the mathematical model is now: $$ \log{ \left( \frac{y}{1-y} \right) } = \beta_0 + \beta_1 \cdot x + \epsilon \,, $$ where \(\epsilon\) is the error term.

Instructions

**100 XP**

- Use
`glm()`

to fit a logistic regression model for`Acceptance`

as a function of`GPA`

.