# Linearity assumption for logistic regression (very simple question plz help me)

#### Heebyungkoh

##### New Member
Hi.
Do I have to check linearity assumption of logistic regression (Log odds of outcome with continuous variable)
using graph of predicted logodds (by logistic regression) and continuous variable
Or
using graph with real logodds and continuous variable ?
I think the latter is right.
In univariate setting, the first one should be always perfect linear. Is it right?

Best.

Last edited:

#### Dason

##### Ambassador to the humans
How do you plan on defining the real logodds for any given value of x?

#### Heebyungkoh

##### New Member
How do you plan on defining the real logodds for any given value of x?
For example,
If at age 20, total 100 observation, 50 event and 50 non-event
Log(0.5/0.5) would be real logodds of age20

If At age 30, total 100 observation, 10 event and 90 non-event
Log(0.1/0.9) would be real logodds of age30

If At age 40, total 100 observation, 70 event and 30 nonevent
Log(0.7/0.3) would be real logodds of age 40

That pattern would be nonlinear.

But if I get a predicted logodds by logistic regression (logistic outcome age) and connected , it would be always perfectely linear unless another variable is added.

The term real logodds and predicted logodds is just for explanation

#### Dason

##### Ambassador to the humans
Ok so you have fairly large sample sizes at several values of the covariate. In that case I think it makes sense to use that data. Note that it probably won't be perfectly linear - we still have variation in the data of course. But what you're really looking for is significant deviations from that linearity assumption.

#### hlsmith

##### Not a robit
Well I follow, and get if you just get the beta coefficient and plug it into with age that it is assuming a standard increase with a unit increase with age. Though, if I am thinking correctly, adding another covariate won't make it not linear unless you add an interaction term.

Do you have covariates? If you do, this may make estimates from doing the hand calculation off.