1 the greatest achievement in life is to be able to get up again from failure

12
1 The greatest achievement in life is to be able to get up again from failure.

Upload: teresa-shepherd

Post on 03-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 The greatest achievement in life is to be able to get up again from failure

1

The greatest achievement in life is to be able to get up again from

failure.

Page 2: 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

Page 3: 1 The greatest achievement in life is to be able to get up again from failure

3

Anova Type Representation Anova Type Representation of Factorsof Factors

• Binary response variable: Y ~ Bernoulli()

• Qualitative factors: A, B, …

SAS textbook Sec 8.4

Page 4: 1 The greatest achievement in life is to be able to get up again from failure

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

Page 5: 1 The greatest achievement in life is to be able to get up again from failure

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

Page 6: 1 The greatest achievement in life is to be able to get up again from failure

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

Page 7: 1 The greatest achievement in life is to be able to get up again from failure

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

Page 8: 1 The greatest achievement in life is to be able to get up again from failure

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)

Page 9: 1 The greatest achievement in life is to be able to get up again from failure

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

Page 10: 1 The greatest achievement in life is to be able to get up again from failure

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

Page 11: 1 The greatest achievement in life is to be able to get up again from failure

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

Page 12: 1 The greatest achievement in life is to be able to get up again from failure

Goodness of FitGoodness of Fit• Deviance or comparison to the full

model

• Residuals

• Model comparisons (L-R tests)

12