# How to write the formulas for logistic & ordinal logistic regression models

In my thesis I am using logistic regression models (either binomial or ordinal, depending on the type of the dependent variable) to analyse the association between environmental quality and socio-demographic characteristics.

The implementation in R was easy and I obtained reliable results. However, I am struggling with a rather simple problem: my supervisor asked me to also specify the regression models in a formula. What is the best way to do that for logistic regression?

Let's say my (simplified) regression models evaluates the influence of age, gender and income on whether a person rates the environmental quality as "good" or "bad". Would the following be the correct formula for the model to state in my thesis? Or is there any better was to state the model as a formula?

$$P(\text{envquality = bad}) = \frac{1}{1+e^{-(\beta_0 + \beta_1 \cdot {\rm age} + \beta_2 \cdot {\rm gender} + \beta_2 \cdot {\rm income})}}$$

What does the formula for an ordinal logistic regression model look like?

• stats.stackexchange.com/questions/108834 -- but it's expressed only in R code. I believe stats.stackexchange.com/q/89474/919 contains answers and some discussion.
– whuber
Feb 15, 2022 at 19:42
• If Y is best, good, bad you can write the model just as you did with $P(Y \ge$ good) for example. But you need to index $\beta_0$ by "good". See RMS. Feb 15, 2022 at 19:47

$$g(\mu) = X \beta$$
where $$g()$$ is the link function, $$\mu$$ is the mean being modeled, and $$X \beta$$ is the linear predictor. That also seems to be the choice of the equatiomatic package in R, which can convert from several types of R models to LaTeX.
$$\text{logit}(p_{bad})=\ln \left( \frac{p_{bad}}{1-p_{bad}}\right)= \beta_0 + \beta_1\cdot \text{age} + \beta_2 \cdot \text{gender} + \beta_3 \cdot \text{income} .$$
Be careful with an ordinal model, as you need to check whether you modeled in terms of $$P(Y \ge \text{good})$$ as in Frank Harrell's comment, or the reverse inequality as in the Wikipedia page section on ordinal models. That page shows additional coefficients added to the linear predictor to represent each of the levels. The equatiomatic vignette shows separate equations with different intercepts for each level, which might be a less confusing display if you don't have too many levels.