























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
























π
π
π
π
a+bx
a+bx
Example: Coronary Heart Disease
60 8 8 10 0.80 4.00000 1.
55 7 13 17 0.76 3.25000 1.
50 6 5 8 0.63 1.66667 0.
45 5 6 13 0.46 0.85714 -0.
40 4 5 15 0.33 0.50000 -0.
35 3 3 12 0.25 0.33333 -1.
30 2 2 15 0.13 0.15385 -1.
25 1 1 10 0.10 0.11111 -2.
Log(Odds) log(p/(1-p)
Odds N p p/(1-p)
CHD Present
Age Age Group
Example: Coronary Heart Disease
Multiplicative Additive
a = -2.
b = 0.
Exp(b) = Odds Ratio = 1.
60 8 8 10 0.80 4.89175 1.58755 0.
55 7 13 17 0.76 2.79947 1.02943 0.
50 6 5 8 0.63 1.60209 0.47131 0.
45 5 6 13 0.46 0.91685 -0.08681 0.
40 4 5 15 0.33 0.52470 -0.64493 0.
35 3 3 12 0.25 0.30028 -1.20305 0.
30 2 2 15 0.13 0.17184 -1.76117 0.
25 1 1 10 0.10 0.09834 -2.31929 0.
Predicted p-hat 1/(1+exp(-a-b*x))
Predicted Log(Odds) a+b*x
Predicted Odds N p exp(a+b*x)
CHD Present
Age Group Age x
Example: Coronary Heart Disease
P robability of Coronary Heart Disease
1 2 3 4 5 6 7 8 A g e Gr o up
predicted observed
log(p/(1-p)) = -2.8774 +0.5581* X
H 0 : β = 0
H 1 : β ≠ 0
( )
( )
ˆ Q a.s.e. ˆ
⎛ ⎞ = ⎜ ⎟ ⎜ ⎟ ⎝ ⎠
∼
QS ∼ χ 1
( )
p (^) ˆ X n ˆ
− = ∑ ∼
χ π
Hosmer-Lemeshow
Goodness of Fit Test
πˆi
πˆi
Logistic Regression Example Coronary Heart Disease vs. Age (first 25 observations, out of 100)
Age Obs Age Group CHD 1 25 1 1 2 25 1 0 3 25 1 0 4 25 1 0 5 25 1 0 6 25 1 0 7 25 1 0 8 25 1 0 9 25 1 0 10 25 1 0 11 30 2 1 12 30 2 1 13 30 2 0 14 30 2 0 15 30 2 0 16 30 2 0 17 30 2 0 18 30 2 0 19 30 2 0 20 30 2 0 21 30 2 0 22 30 2 0 23 30 2 0 24 30 2 0 25 30 2 0
SAS Code:
Proc Logistic
Proc Logistic Data=CHD100 Descending; Model CHD=AgeGroup / Scale=none Aggregate; Run;
The LOGISTIC Procedure
Testing Global Null Hypothesis: BETA=
Test Chi-Square DF Pr > ChiSq
Likelihood Ratio 28.4851 1 <. Score 26.0782 1 <. Wald 21.4281 1 <.
Analysis of Maximum Likelihood Estimates
Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq
Intercept 1 -2.8770 0.6233 21.3024 <. AgeGroup 1 0.5580 0.1206 21.4281 <.
Odds Ratio Estimates
Point 95% Wald Effect Estimate Confidence Limits
AgeGroup 1.747 1.380 2.
Deviance and Pearson Goodness-of-Fit Statistics
Criterion DF Value Value/DF Pr > ChiSq
Deviance 6 0.2164 0.0361 0. Pearson 6 0.2178 0.0363 0.
Number of unique profiles: 8
SAS Code for Logistic Regression
Proc Logistic Data=Miner.CHD100 Descending; Model CHD=Age / Lackfit; Units Age=5; Output Out=C1 p=pi_hat; Run;
Proc Logistic Output: CHD Example
The LOGISTIC Procedure
Testing Global Null Hypothesis: BETA=
Test Chi-Square DF Pr > ChiSq
Likelihood Ratio 28.6373 1 <. Score 26.1600 1 <. Wald 21.4538 1 <.
Analysis of Maximum Likelihood Estimates
Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq
Intercept 1 -4.8815 1.0374 22.1433 <. Age 1 0.1114 0.0240 21.4538 <.
Odds Ratio Estimates
Point 95% Wald Effect Estimate Confidence Limits
Age 1.118 1.066 1.
Proc Logistic Output: CHD Example
Adjusted Odds Ratios
Effect Unit Estimate
Age 5.0000 1.
Hosmer and Lemeshow Goodness-of-Fit Test
Chi-Square DF Pr > ChiSq
1.6102 7 0.
Logistic Regression Model predicting CHD from Age
-0.
0
1
20 25 30 35 40 45 50 55 60 65 Age
Probability
Observed Predicted
Predicting Thermal Distress
from Temperature
Testing Global Null Hypothesis: BETA=
Test Chi-Square DF Pr > ChiSq Likelihood Ratio 7.9520 1 0. Score 7.2312 1 0. Wald 4.6008 1 0.
Analysis of Maximum Likelihood Estimates
Standard Wald Parameter DF Estimate Error Chi-Square Pr > ChiSq Intercept 1 15.0429 7.3786 4.1563 0. Temp 1 -0.2322 0.1082 4.6008 0.
Odds Ratio Estimates
Point 95% Wald Effect Estimate Confidence Limits Temp 0.793 0.641 0.
Predicting Thermal Distress
from Temperature
Predicting O-ring Thermal Distress from Temperature
-0.
0
1
30 40 50 60 70 80 Temperature
Probability
Observed Predicted
⎛ ⎞ = (^) ⎜ ⎟= + + + + ⎝ − ⎠
logit( ) log (^) 1 1x 2 x 2 " k xk 1
π π α β β β π