Logistic regression can be used to calculate odds ratios when the dependent variable has two categories and the independent variables are categorical. An example is examining whether smoking status (never smoked, ex-smoker, current smoker) predicts higher odds of depression (yes, no). The logistic regression would show that compared to never smokers, ex-smokers have 1.14 times higher odds of depression and current smokers have 1.79 times higher odds of depression.