Lecture 8
Lecture 8
Lecture 8
Analyzing a Binary Response
• We have discusses how to estimate and make
inferences about a single probability of success .
And
• generalizes this discussion to the situation of two
probabilities of success that are now dependent on a
level of a group.
• now completes the generalization to a situation where
there are many different possible probabilities of
success to estimate and perform inferences upon.
• Furthermore, this chapter allows us to quantify how an explanatory
variable with many possible levels (perhaps continuous rather than
categorical) affects the probability of success. These generalizations
are made through the use of binary regression models.
Linear models
Review of normal linear regression models
Note that
E(Yi) = 0 + 1xi1
i = 0 + 1xi1
i
log 0 1xi1 p xip
1 i
• Notice that the left-hand side is the log
transformation of the odds of a success!
This will be very important for us later when
interpreting the effect an explanatory
variable has on the response variable.
i
The log transformation is often referred to as
1 i
the logit transformation. Thus, the most compact way
that people write the model as is
1.0
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0.0
x1 x1
We can make the following generalizations:
0<<1
When 1 > 0, there is a positive relationship between
x1 and . When 1 < 0, there is a negative relationship
between x1 and .
The shape of the curve is somewhat similar to the
letter s.
Above = 0.5 is a mirror image of below = 0.5.
The slope of the curve is dependent on the value of x 1.
We can show this mathematically by taking the
d
derivative with respect to x1: 1(1 )
dx1
Questions:
but now
ˆ 0 ˆ1x1 ˆ p xp
e
ˆ ˆ 0 ˆ1x1 ˆ p xp
1 e
Unfortunately, there are no closed form expressions that can
be written out for ˆ 0 , …, ̂p except in very simple cases. The
MLEs instead are found through using iterative numerical
procedures.
logit( ) 0 1x1
logit( ) 0 1distance
• R to estimate the model with the glm() function
The estimated logistic regression model is
e5.81210.1150distance
ˆ
1 e5.81210.1150distance