# How to manually calculate odds ratio for continuous variables?

In school, long before learning about logistic models, I've been taught how to calculate odds ratios by hand.

Formula was based on a contingency table, just like this:

This is very easy to understand for categorical variables (even with 3+ levels by one-hot encoding), but for a continuous variable a logistic model would give me an OR "for a predictor increase of 1".

What would be the odds ratio calculation for such a continuous variable ?

EDIT: this is a question of curiosity, aiming at better understanding the logic behind models I fit daily

• Is there a reason you'd rather not just fit the model and take the antilog of the estimate? – LSC Mar 15 '19 at 13:03
• this question is about understanding, not performing. I think knowing how to calculate something is often a very good way to understand it. – Dan Chaltiel Mar 15 '19 at 13:12
• This explains the basic idea for a discrete independent variable. – Penguin_Knight Mar 15 '19 at 13:31
• @Penguin_Knight so the answer is that unlike for categorical variables, you cannot really calculate such an odds ratio without fitting a logistic regression ? – Dan Chaltiel Mar 15 '19 at 13:37
• If you're talking about something as simple as ad/bc, then you're correct that there is no such shortcut. – Penguin_Knight Mar 15 '19 at 13:41