Logistic Regression for Survey Data Professor Ron Fricker Naval Postgraduate School Monterey, California
1
Naval Postgraduate School Logistic Regression Professor Ron Fricker - - PDF document
1 Naval Postgraduate School Logistic Regression Professor Ron Fricker Monterey, California for Survey Data Goals for this Lecture Introduction to logistic regression Discuss when and why it is useful Interpret output Odds
1
2
3
1 1 2 2
i i i k ki i
1 1 2 2 1 1 2 2
k k k k
4
5
6
7
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 20 30 40 50 60 70 Mean Group Age Proportion w / CHD
8
0.2 0.4 0.6 0.8 1 10 30 50 70 90 Age
p(CHD)
9
0.2 0.4 0.6 0.8 1 1.2 10 20 30 40 50 60 70 80 90 100 Age Probability of CHD
10
11
12
1 1 2 2 3 1 1 2 2 3
k k
13
– Number between 0 and 1 – Example: Pr(Red Sox win next World Series) = 5/8 = 0.62
– Any number > 0 – Example: Odds Red Sox win World Series are 5/3 = 1.667
– Any number from -¶ to +¶ – Log odds is sometimes called the “logit”
14
“slope” p-value Log odds of having CHD
15
Age can be any (positive) number and answer still makes sense
0.2 0.4 0.6 0.8 1 10 30 50 70 90 Age
p (C H D )
16
17
1 2 2 2 2
|male |female ln ln 1 |male 1 |female
i k ki i i i i i k ki
X X p p p p X X β β β β β β β ⎛ ⎞ ⎛ ⎞ + + + + = ⎜ ⎟ ⎜ ⎟ − − + + + ⎝ ⎠ ⎝ ⎠ K K
1 2 2 1 2 2
exp( )exp( )exp( ) exp( ) exp( )exp( ) ex exp( )
) R p(
i k ki i k ki
X X X X β β β β β β β β = = L L
18
19
20
1 2 2
ˆ
i i i i i i i i i S i S i S i S i i i i i i S i S i S
w x y w y w x w B w x w x w
∈ ∈ ∈ ∈ ∈ ∈ ∈
− = ⎛ ⎞ −⎜ ⎟ ⎝ ⎠
1
i i i i i S i S i i S
∈ ∈ ∈
2 1 1 N i i i
=
21
22
23
24
25