Upload
teresa-shepherd
View
216
Download
0
Tags:
Embed Size (px)
Citation preview
1
The greatest achievement in life is to be able to get up again from
failure.
2
Categorical Categorical Data AnalysisData Analysis
Chapter 5 II: Logistic Chapter 5 II: Logistic Regression for Regression for
Qualitative/Mixed FactorsQualitative/Mixed Factors
3
Anova Type Representation Anova Type Representation of Factorsof Factors
• Binary response variable: Y ~ Bernoulli()
• Qualitative factors: A, B, …
SAS textbook Sec 8.4
4
Example: Berkeley Admissions Data (Table 2.10) Example: Berkeley Admissions Data (Table 2.10)
Men Women
Major # of applicants
% admitted
# of applicants
% admitted
A 825 62 108 82
B 560 63 25 68
C 325 37 593 34
D 417 33 375 35
E 191 28 393 24
F 373 6 341 7
Anova-Type Logistic RegressionAnova-Type Logistic Regression
5
• Only one factor (eg. Department)
• Only main effects of two factors
• Full model
ijjiij
ij ABBA
1
log
ii
i A
1
log
jiij
ij BA
1
log
Anova-Type Logistic RegressionAnova-Type Logistic Regression
• Parameterization (in SAS):The effect at the last level of each factor is set as 0
• (Regular) logistic regression expression by dummy variables (one factor example)
6
112211 ...1
log
II xxx
7
Mixed-type Logistic RegressionMixed-type Logistic Regression
• Binary response variable: Y ~ Bernoulli()
• Qualitative factors: A, B, …• Quantitative factors: X
SAS textbook Sec 8.5
8
Example: Horseshoe CrabExample: Horseshoe Crab• Dataset is given in Table 4.3, textbook• Each female crab had a male crab
attached to her in her nest; other males residing nearby her are called satellites
• Y= # of satellites• X= female crab’s color (C), spine condition
(S), weight (Wt), and carapace width (W)– C = 1 to 4 (light to dark); – S = 1 to 3 (good to worst)
Mixed-Type Logistic RegressionMixed-Type Logistic Regression
9
Numerical factors Wt, W and: •Only one factor (eg. color)
• Only main effects of two factors
• With interaction effects (Not the saturated model)
WWtCSSC ijjiij
ij211
log
WWtCii
i211
log
WWtSC jiij
ij211
log
Mixed-Type Logistic RegressionMixed-Type Logistic Regression
• Parameterization (PROC GENMOD in SAS):The effect at the last level of each factor is set as 0
• (Regular) logistic regression expression by dummy variables (C + W example)
10
Wxxx II
112211 ...1
log
11
Quantitative Treatment of Quantitative Treatment of Ordinal factorsOrdinal factors
• Assign scores to its categories for each ordinal factor
• Treat the ordinal factors as quantitative factors to fit GLM
e.g. color
Goodness of FitGoodness of Fit• Deviance or comparison to the full
model
• Residuals
• Model comparisons (L-R tests)
12