Logistic regressions are a type of generalized linear model (GLM). GLMs are used when the response variable and the error terms from the fitted models are not normally distributed. There are two common applications of GLMs: the logistic regression (used when the response variable is binary e.g. alive/dead or presence/absence) and the Poisson regression (used when the response variable represents counts).
How GLMs are different from general linear models
How GLMs are different from general linear models
- They use maximum likelihoods rather than least squares estimation
- Probability distributions for binomial and Poisson are defined by the natural parameter (a function of the mean) and the dispersion parameter (a function of the variance) rather than normal distributions where the dispersion parameter is estimated separately from the mean.
- The random component – the response variable and its probability distribution (e.g. logistic or Poisson)
- The systematic component – the predictors or X variables
- The link function – this links the random and systematic component. This links the expected value of Y to the predictors by the function:
g(u) is the link function, which could be the mean (this is what it is in standard linear models), or the log link (where g(u) = log(u) and it models the log of the mean), or the logit link.
The logit link is used for binary data and logistic regression. The logit link is:
The logit link is used for binary data and logistic regression. The logit link is:
When your response variable is binary (e.g. a category with two levels such as alive/dead or presence/absence) then you should carry out a logistic regression. The predictor variables (X) can be continuous or categorical. The logistic regression model models the probability that Y equals one for a given value of X (written as π(x)), which is a nonlinear model with a sigmoidal shape.
The logistic model is:
The logistic model is:
Where β_0 (this is the intercept) and β_1 (the slope – measures the rate of change in π(x) for a given change in X) are parameters to be estimated.
You can transform π(x) so that it resembles the more familiar linear model.
You can transform π(x) so that it resembles the more familiar linear model.
This makes particular sense if your response variable can take any real value (e.g. survival estimates based off alive/dead data). This is the logit link function!
See https://ww2.coastal.edu/kingw/statistics/R-tutorials/logistic.html for a good blog on doing a logistic regression in r.
Reference
Quinn, G.P. & Keough, M.J. (2002). Experimental Design and Data Analysis for Biologists. Cambridge University Press, Cambridge, UK.
See https://ww2.coastal.edu/kingw/statistics/R-tutorials/logistic.html for a good blog on doing a logistic regression in r.
Reference
Quinn, G.P. & Keough, M.J. (2002). Experimental Design and Data Analysis for Biologists. Cambridge University Press, Cambridge, UK.