What Are the Key Differences Between OLS and GLM Models in Statistical Analysis?

  • Context: Undergrad 
  • Thread starter Thread starter fog37
  • Start date Start date
  • Tags Tags
    Linear regression
Click For Summary

Discussion Overview

The discussion focuses on the differences between Ordinary Least Squares (OLS) and Generalized Linear Models (GLM) in statistical analysis, exploring their applications, assumptions, and implications in various regression contexts, including logistic regression and polynomial regression.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes GLM as a family of models where coefficients are linear, but relationships between the response variable and covariates can be nonlinear, citing examples like polynomial and logistic regression.
  • Another participant notes that while OLS is optimal for linear and polynomial regression, it cannot be used for logistic regression due to violations of OLS assumptions, suggesting that maximum likelihood estimation (MLE) is necessary instead.
  • A later reply mentions that using linear regression for the logit model can lead to inefficiencies, particularly with probabilities at the extremes (p=0 or p=1), due to the variance of the log-odds ratio.
  • Another participant adds that using least squares regression for logistic binary classification would invalidate standard inference procedures, as they require a continuous response variable.
  • Concerns are raised about using least squares regression for multinomial classification, where coding response levels could imply an ordering that does not exist, potentially affecting results based on the order of levels.

Areas of Agreement / Disagreement

Participants express differing views on the applicability of OLS for logistic regression, with some emphasizing the need for MLE due to OLS assumptions being violated, while others discuss historical practices and implications of using linear regression in this context. The discussion remains unresolved regarding the best approach to fitting models in these scenarios.

Contextual Notes

Limitations include the dependence on specific assumptions of OLS and GLM, the implications of using linear regression for binary and multinomial outcomes, and the need for iterative methods in certain contexts.

fog37
Messages
1,566
Reaction score
108
TL;DR
OLS in GLM models...
Hello,

I know this is a big topic but I would like to check that what I understand so far is at least correct. Will look more into it. GLM is a family of statistical models in which the coefficients betas are "linear". The relation between ##Y## and the covariates ##Xs## can be nonlinear (ex: polynomial regression and logistic regression). The relation we need to look at is the one between the link function and the coefficients. For example, for logistic regression, the probability ##p## is related to the covariates ##X## via a sigmoid equation and ##p## and the ##\beta##s are not in a linear relation. But the logit and the ##\beta##s are!
  • OLS is the "best" method to find the unknown coefficients when the model is linear regression (simple or multiple). OLS is also the "best" method when the model is polynomial regression (linear regression being a special case of it).
  • However, in the case of logistic regression, we cannot use OLS to compute the estimated coefficients.. I initially wondered why since the log of the odd is a linear function of the covariates is a straight line model: $$log(odd)=\beta_1 X_1+\beta_2 X_2+...+\beta_0$$
I thought we could use OLS to find the coefficients in the equation for ##log(odd)=log(\frac {p}{1-p})##, given the straight line relation with the ##X## variables, and then, via simple math transformations, find the probability ##p## which is related to the covariates ##X##s via the sigmoid function. I believe the reason we cannot use OLS to find the betas for logistic regression is that the OLS assumptions are violated for logistic regression so the estimated betas would be quite wrong. So we have to resort to the maximum likelihood iterative estimation (MLE) method to find the betas.

Am I on the right track? Any corrections? Thank you!
 
Physics news on Phys.org
It depends what you mean by ordinary least squares (OLS). If you just mean minimising the sum of squared errors (SSE), then that still provides a consistent estimator. But we can't just use the closed-form formulas used to give OLS solutions to simple linear regressions, because the estimates ##\hat p_i## are nonlinear functions of the regressors, which violates the assumptions used to derive those formulas. To minimise the SSE we need to use an iterative, non-linear optimiser. Or we can forget about SSE and use MLE instead, which is also a non-closed form, iterative approach.
 
  • Like
Likes   Reactions: fog37
The logit model was fitted for a long time via linear regression. The problems are e.g. with points with p=0 or p=1. The variance of log p/(1-p) varies with p, hence unweighted linear regression will not be efficient.
 
  • Like
Likes   Reactions: FactChecker and fog37
Good answers above: also:

- if you tried to use LS regression with the original data for a logistic binary classification problem none of the usual inference procedures would be justified since they require a continuous response
- if you tried to use LS regression with a mulinomial classification problem, where you coded the k response levels 1, 2, 3, ..., k, you would be implying an ordering of importance of the levels; and results would be different for different orderings
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 30 ·
2
Replies
30
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K