Bio2 Module 5 - Logistic Regression
Bio2 Module 5 - Logistic Regression
Logistic regression
Getu Degu
November 6, 2008
1
Logistic regression
► The preceding section dealt with multiple regression with
a continuous dependent variable, extending the methods
of linear regression introduced in Biostat 2 ( module 1).
2
Uses and selection of independent variables
3
developing cancer than working in an
asbestos mine).
The Model:
4
where the dependent variable is of more than two
cases, known as multinomial logistic regression.
5
Backward stepwise regression appears to be the
preferred method of exploratory analyses, where the
analysis begins with a full or saturated model and
variables are eliminated from the model in an iterative
process. The fit of the model is tested after the elimination
of each variable to ensure that the model still adequately fits
the data. When no more variables can be eliminated from
the model, the analysis has been completed.
6
♣ The transformation we use is called the logit
transformation, written as logit (p). Here p is the proportion
of individuals with the characteristic.
♣ The logit can take any value from minus infinity to plus
infinity.
7
Because the logistic regression
equation predicts the log odds, the
coefficients represent the difference
between two log odds, a log odds
ratio.
P=
Significance tests
The process by which coefficients are tested for significance
for inclusion or elimination from the model involves several
different techniques.
8
I) Z-test
Deviance
9
Before proceeding to the likelihood
ratio test, we need to know about the
deviance which is analogous to the
residual sum of squares from a linear
model.
The deviance of a model is -2 times
the log likelihood associated with
each model.
As a model’s ability to predict
outcomes improves, the deviance
falls. Poorly-fitting models have
higher deviance.
If a model perfectly predicts
outcomes, the deviance will be zero.
This is analogous to the situation in
linear regression, where the residual
sum of squares falls to 0 if the model
predicts the values of the dependent
variable perfectly.
Based on the deviance, it is possible to
construct an analogous to r² for logistic
10
regression, commonly referred to as the
Pseudo r².
r² = 1 - =1 – (ln L1 / ln L0)
One might think of it as the proportion of
deviance explained.
11
► Inits most basic form, it can test the
hypothesis that all the coefficients in a
model are all equal to 0:
H0: ß1 = ß2 = . . . = ßk = 0
►The test statistic has a chi-square
distribution, with k degrees of freedom.
► Ifwe want to test whether a subset
consisting of q coefficients in a model are all
equal to zero, the test statistic is the same,
except that for L0 we use the likelihood from
the model without the coefficients, and L1 is
the likelihood from the model with them.
►This chi-square has q degrees of freedom.
Assumptions
12
► Logistic regression is popular in part because
it enables the researcher to overcome many of
the restrictive assumptions of OLS regression:
13
1. Meaningful coding. Logistic coefficients will
be difficult to interpret if not coded meaningfully.
The convention for binomial logistic regression is
to code the dependent class of greatest interest
as 1 and the other class as 0.
14
6.No multicollinearity: To the extent that one
independent is a linear function of another
independent, the problem of multicollinearity
will occur in logistic regression, as it does in
OLS regression. As the independents increase
in correlation with each other, the standard
errors of the logit (effect) coefficients will
become inflated.
15
MLE relies on large-sample asymptotic
normality which means that reliability of
estimates decline when there are few
cases for each observed combination of
independent variables.
That is, in small samples one may get
high standard errors. In the extreme, if
there are too few cases in relation to the
number of variables, it may be impossible
to converge on a solution.
Very high parameter estimates (logistic
coefficients) may signal inadequate
sample size.
Summary
♣ A likelihood is a probability, specifically the
probability that the values of the dependent variable
may be predicted from the values of the independent
17
variables. Like any probability, the likelihood varies
from 0 to 1.
18
♣ It measures the improvement in fit that the
explanatory variables make compared to the null
model.
19