 Download Download Presentation Logit model, logistic regression, and log-linear model A comparison

# Logit model, logistic regression, and log-linear model A comparison

Download Presentation ## Logit model, logistic regression, and log-linear model A comparison

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. Leaving home Models of counts: log-linear model

2. Leaving home

3. Leaving home

4. Leaving home Model 3: Time and Sex (unsaturated log-linear model) 11 = exp[4.697] = 109.6 21 = exp[4.697 + 0.4291] = 168.4 12 = exp[4.697 - 0.0982] = 99.4 22 = exp[4.697 + 0.4291 - 0.0982] = 152.8

5. Leaving home

6. Leaving home

7. Leaving home • Model 4: TIME AND SEX AND TIME*SEX interaction 11 = exp[4.905 = 135 21 = exp[4.905 + 0.0576] = 143 12 = exp[4.905 - 0.6012] = 74 22 = exp[4.905 + 0.0576 - 0.6012 + 0.8201] = 178

8. Log-linear and logit model

9. Political attitudes Log-linear model: Select one variable as a dependent variable: response variable, e.g. does voting behaviour differ by sex Are females more likely to vote conservative than males? Logit model:

10. Political attitudes Are females more likely to vote conservative than males? A = Party; B = Sex Effect coding (1) Males voting conservative rather than labour: Log-odds = logit Females voting conservative rather than labour:

11. Political attitudes Are women more conservative than men? Do women vote more conservative than men? The odds ratio. If the odds ratio is positive, then the odds of voting conservative rather than labour is larger for women than men. In that case, women vote more conservative than men. Logit model: with x = 0, 1 with a = Log odds of reference category (males) and b = Log odds ratio (odds females / odds males)

12. The logit model as a regression model

13. Select a response variable  proportion • Dependent variable of logit model is the log of (odds of) being in one category rather than in another. • Number of observations in each subpopulation (males, females) is assumed to be fixed. • Intercept (a) = log odds of reference category • Slope (b) = log odds ratio

14. Political attitudes Logit model: descriptive statistics Counts in terms of odds and odds ratio DATA Sex Party Male Female Total Conservative 279 352 631 Labour 335 291 626 Total 614 643 1257 Reference categories: Labour; Males F11 = 279 F21 = 335 = 279 * 335/279 = 279 / 0.8328 F12 = 352 = 279 * 352/279 = 279 1.2616 F22 = 291 = 279 * 352/279 * 291/352 = 279 * 1.2616 * [1/1.2096]

15. Political attitudes

16. Political attitudes Logistic regression SPSS Reference category: females (X = 1 for males and X = 0 for females) Variable Param S.E. Exp(param) SEX(1) .3732 .1133 1.4524 Constant -.1903 .0792 Females voting labour: 1/[1+exp[-(-0.1903)]] = 45%  291/626 (females ref.cat) Males voting labour: 1/[1+exp[-(-0.1903+0.3732)]] = 55%  335/626 Different parameter coding: X = -0.5 for males and X = 0.5 for females Variable Param S.E. Exp(param) SEX(1) -.3732 .1133 0.6885 Constant -.0037 .0567 Females voting labour: 1/[1+exp[-(-0.0037 + 0.5*(-0.3732))]] = 45%  291/626 Males voting labour: 1/[1+exp[-(-0.0037 - 0.5 * (-0.3732))]] = 55%  335/626

17. Observation from a binomial distribution with parameter p and index m The logit model and the logistic regression Leaving parental home

18. Leaving home

19. Leaving home

20. Leaving home Relation logit and log-linear modelThe unsaturated model Log-linear model: With i effect of timing and j effect of sex Odds of leaving parental home late rather than early: females:

21. Leaving home Relation logit and log-linear modelThe unsaturated model Odds of leaving parental home late rather than early: males:

22. Leaving home Relation logit and log-linear modelThe saturated model Log-linear model: With i effect of timing and j effect of sex and ij the effect of interaction between timing and sex Odds of leaving parental home late rather than early: females (ref):

23. Leaving home Relation logit and log-linear modelThe saturated model Odds of leaving parental home late rather than early: males:

24. Leaving home Logit model: X=0 for males X=1 for females Logistic regression: probability of leaving home late

25. Leaving home

26. Leaving home Dummy coding: ref.cat: females, late Effect coding or marginal coding: females +1; males –1

27. The logistic regression in SPSS Micro data and tabulated data

28. SPSS: Micro-data • Micro-data: age at leaving home in months • Crosstabs: Number leaving home by reason (row) and sex (column) • Create variable: Age in years • Age = TRUNC[(month-1)/12] • Create variable: TIMING2 based on MONTH: • TIMING2 =1 (early) if month  240 & reason < 4 • TIMING2 =2 (late) if month > 240 & reason < 4 • For analysis: select cases that are NOT censored: SELECT CASES with reason < 4

29. SPSS: tabulated data • Number of observations: WEIGHT cases (in data) • No difference between model for tabulated data and micro-data

30. Leaving home The logistic regression in SPSS

31. Related models • Poisson distribution: counts have Poisson distribution (total number not fixed) • Poisson regression • Log-linear model: model of count data (log of counts) • Binomial and multinomial distributions: counts follow multinomial distribution (total number is fixed) • Logit model: model of proportions [and odds (log of odds)] • Logistic regression • Log-rate model: log-linear model with OFFSET (constant term) Parameters of these models are related

32. Construct your own logistic regression model

33. Specify the logistic regressionfor this observation • Schoolleavers: 50% are males and 50% are females • 70% of schoolleavers find a job within a year • 60% of those who find a job are females

34. 1. Construct table 84% of females find a job within a year against 56% of males

35. 2. Determine reference categories • Duration of job search: One year or more • Sex: Males

36. 3. Odds ratios • Males (ref. Cat): 28/22 = 1.278 • Females: 42/8 = 5.250 • Odds ratio: 5.250/1.278 = 4.125

37. Logit model • p = probability of finding a job within a year • Logit(p) = ln[p/(1-p)] = a + b x • with x Sex (0 for males and 1 for females) • a = ln 1.273 = 0.241 • b = ln 4.128 = 1.418 • Logit model for these data: logit(p) = 0.241 + 1.418 x

38. Logistic regression • For males: • For females: • 84% of females find a job within a year against 56% of males

39. Confidence interval • S.e. saturated model: • s.e. of a [0.2412] = • s.e. of b [1.417] =

40. Confidence interval • S.e. null model: • s.e. of ln[0.7/(1-0.7)] = s.e. of 0.8473 = • Conf. Interval: 0.8473 +/- 1.96 * 0.2180 (0.420, 1.275) on logit scale or (0.603, 0.782) on probability scale • The p for males and females are significantly different

41. SPSS output: logistic regressionParameters of logistic regression • p = probability that duration of search is more than one year • Simple coding (SPSS): reference categories: • Dependent variable: timing: early • Factor: sex: males • Parameters

42. SPSS output: logistic regressionParameters of logistic regression • p = probability that duration of search is more than one year • Deviation coding (SPSS): • Dependent variable: timing: early • Factor: females (-1); males (+1) • Parameters

43. SPSS and GLIM: a comparison