Professional Documents
Culture Documents
URBN LOFTS
Logistic REGRESSION
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
Early uses of logistic regression were in
biomedical studies, for instance, to model whether
subjects have a particular condition such as lung
cancer. The past 25 years have seen much use in
social science research, for modeling opinions and
URBN LOFTS
For instance, the probability that a subject
pays a bill on time may use predictors such as the
size of the bill, annual income, occupation,
mortgage and debt obligations, percentage of bills
paid on time in the past, and other aspects of an
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
Another area of increasing application is
genetics, such as to estimate quantitative trait loci
effects by modeling the probability that an
offspring inherits an allele of one type instead of
another type as a function of phenotypic values on
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
For binary response variable Y and an explanatory X, let
= = 1 = = 1 = 0 = . The logistic
regression model is
exp +
=
1 + exp +
Equivalently, the logit (log odds) has the linear relationship
=
= +
1
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
URBN LOFTS
URBN LOFTS
To illustrate logistic regression, we re-analyze the
horseshoe crab data introduced last time.
URBN LOFTS
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
In each of the eight width categories, we computed the
sample proportion of crabs having satellites and the
mean width for the crabs in that category.
A curve based on smoothing the data using the
generalized additive modeling method, assuming a
binomial response and logit link is also in the graph
This curve shows a roughly increasing trend and is more
informative than viewing the binary data alone.
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
The ML fit is
12.351
x= =
= 24.8
0.497
URBN LOFTS
The statistic z = /s.e. = 0.497/0.102 = 4.89 provides
strong evidence of a positive width effect (P < 0.0001).
The equivalent Wald chi-squared statistic, z2 = 23.89,
has df = 1.
URBN LOFTS
The Wald 95% confidence interval for is 0.497
1.96(0.102), or (0.298, 0.697).
The table reports a likelihood-ratio confidence interval
of (0.308, 0.709), based on the profile likelihood
function.
The confidence interval for the effect on the odds per
1-cm increase in width equals (e0.308, e0.709) =
(1.36,2.03).
We infer that a 1-cm increase in width has at least a
36% increase and at most a doubling in the odds of a
satellite.
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
In practice, there is no guarantee that a certain logistic
regression model fits the data well.
For any type of binary data, one way to detect lack of fit
uses a likelihood-ratio test to compare the model to more
complex ones.
A more complex model might contain a nonlinear effect.
Models with multiple predictors would consider interaction.
If more complex models do not fit better, this provides
URBN LOFTS chosen is reasonable.
some assurance that the model
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
For models with a continuous explanatory variable, X2 and
G2 do not approximate chi-squared distributions due to very
few counts for each value of x.
One solution for this is to bin the continuous variable
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080
URBN LOFTS
In each width category, the fitted value for a "yes" response
is the sum of the estimated probabilities (x) for all crabs
having width in that category
The fitted value for a "no" response is the sum of 1 (x)
URBN LOFTS
Their values are X2 = 5.3 and G2 = 6.2.
The constructed table has eight binomial samples, one for
each width setting.
The model has two parameters, so df = 8 2 = 6.
Neither X2 nor G2 shows evidence of lack of fit (P-value >
0.4).
Thus, we can feel more comfortable about using the model
for the original ungrouped data.
URBN LOFTS
1837 LOFT STREET, ANYTOWN, NY 50080