HC 14: LOGISITIC REGRESSION PART 1
Gewone regressie
- Voorspel je meestel kwaN/ continu uitkomst
- Bijvoorbeeld: Y =b0 +b1 X
Wat is logisitieke regressie?
- Uitkomst ≠ gewone score
- Uitkomst = WEL binair d.w.z. 0 of 1
Wnr gebruik je logistieke regressie?
- Als DV slechts 2 mogelijke uitkomsten heeft (= dummies)
EXAMPLE
Cross-sectional data originating from the Panel Study on Income Dynamics, 1982.
- See Baltagi, B.H. (2002). Econometrics, 3rd ed. Berlin, Springer.
- Data from 595 participants
Research question:
- Do higher levels of education predict that an individual will be a white-collar worker, rather than a blue-collar worker?
o = P(y=1) voorpelt dus eigenlijk kans dat regressie gebeurt
- IV/predictor: Years of education. = Numerical variable
- DV/criterion: occupation = Categorical variable with two levels:
White-collar worker
Blue-collar worker
DATA STRUCTURE AND NOTATION
Notation:
- i: index for "experimental unit" or observation (i = 1, ..., n)
- Yi : score on criterion (DV) for unit i :
o = is an indicator variable
o Bv. a 2-level categorical variable recoded into a binary dummy variable
o (0 = reference category, 1 = comparison category)
- Xi : score on predictor (IV) for unit i : can be a quantitative or categorical variable
Wanneer gebruik je logistische regressie dus?
- Wanneer je uitkomst binair is: betekenis: waarde 0 of 1.
Doel?
- ≠ voorspellen “hoeveel” y is
- = WEL voorspellen hoe groot de kans is op succes/falen?
DATA VISUALIZATION
,
, WHY NOT LINEAR REGRESSION?
Issue 1: Predicted values can fall outside [0,1]
- Bij gewone linear regression
o The expected value is: E(Y ∨X )=β 0 + β 1 X
o Can produce fitted values less than 0 or greater than 1
Y^ i= β^ 0 + β^ 1 X i
This makes the model’s predictions invalid for binary outcomes.
Bij LOGISTISCHE REGRESSIE heeft Y enkel waarde v 0 of 1
Wat we eigenlijk willen voorspellen is:
o P(Y =1)
Dus de kans dat iets zich voordoet
Kansen moeten altijd tss 0 en 1 liggen
Issue 2: Violation of the normality assumption
- Linear regression assumes that the error terms are normally distributed
- With a binary outcome, residuals are calculated as follows:
o e^ i=
{
0−Y^ i
1−Y^ i
- ^ near 0 or 1:
When the model predicts Y residuals are small
i
- ^ different from 0 or 1:
When the model predicts Y residuals vary much more
i
o →Residuals vary as a function of the predicted values Y^ i
- ^ i follow the distribution of the predictor variables
The predicted values Y X i , which are not necessarily normal
distributed
Issue 3: Violation of homoscedasticity (constant variance)
- Linear regression assumes that the variance of the errors is constant across levels of the predictors.
o THIS MEANS:
For a given value of X i residuals should have same spread for all values of predictors (or fitted
values): ^ iand Y^ i
no pattern between e
- With a binary outcome, residuals are calculated as follows:
e^ i=
{
0−Y^ i
1−Y^ i
- ^ near 0 or 1:
When the model predicts Y residuals are small
i
- ^ iis different from 0 or 1:
When the model predicts Y residuals vary much more
o → the residual spread changes as fitted values change