Skip to content

Logistic regression dummy variables  #17

Open
@sof202

Description

@sof202

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions