Skip to content

Logistic regression dummy variables #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sof202 opened this issue Oct 31, 2024 · 0 comments
Open

Logistic regression dummy variables #17

sof202 opened this issue Oct 31, 2024 · 0 comments

Comments

@sof202
Copy link

sof202 commented Oct 31, 2024

Problem

In the last delivery of the course, some participants were confused by the logistic regression section as new variables were introduced to the mathematics without much explanation.

The logistic regression is introduced as:

$$\sigma(t) = \frac{e^t}{e^t+1}$$

But then in a single line, this is converted to:

$$ln(odds) = ln\big(\frac{p}{(1-p)}\big) = \beta_0 + \beta_1x$$

Suggested edit

A simple explanation that we are looking at the odds ratio (probability of case / probability of not a case) would explain where the $\frac{p}{(1-p)}$ part comes from (though this is in my opinion rather obvious).

From here, the fact that ㅤ $ln(\frac{p}{(1-p)}) = \beta_0 + \beta_1x$ ㅤ might benefit from a small footnote explaining why this step works. The mathematics isn't required, but some might want to know where this actually comes from. As such a footnote/smalltext is probably better than adding this into the main text.

This step works because you are using the logistic equation as your probability function ($\sigma = p$). Substituting $p = \frac{e^t}{e^t+1}$ into the odds ratio equation gets you:

$$ln\Bigg(\frac{\frac{e^t}{e^t+1}}{1-\frac{e^t}{e^t+1}}\Bigg)=ln\big(\frac{e^t}{e^t+1-e^t}\big)=ln(e^t)=t$$

You would then need to explain that $t = \beta_0 + \beta_1x$ as this is just a dummy variable. I'm not 100% sure how to convey this idea in a way that would be comfortable to all audiences however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant