Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Logit model, logistic regression, and log-linear model A comparison."— Presentation transcript:

1

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

3 Leaving home Models of counts: log-linear model

4 Leaving home

5

6  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 Model 3: Time and Sex (unsaturated log-linear model) Leaving home

7

8

9 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 Leaving home

10 Log-linear and logit model

11 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: Political attitudes

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

13 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 a = and b = Log odds of reference category (males) Log odds ratio (odds females / odds males) with x = 0, 1 Political attitudes

14 The logit model as a regression model

15 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

16 DATA Sex Party Male Female Total Conservative279 352 631 Labour 335 291 626 Total 614 643 1257 Logit model: descriptive statistics Counts in terms of odds and odds ratio Reference categories: Labour; Males F 11 = 279 F 21 = 335 = 279 * 335/279 = 279 / 0.8328 F 12 = 352 = 279 * 352/279 = 279 1.2616 F 22 = 291 = 279 * 352/279 * 291/352 = 279 * 1.2616 * [1/1.2096] Political attitudes

17

18 Logistic regression SPSS 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 Reference category: females (X = 1 for males and X = 0 for females) 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 Political attitudes

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

20 Leaving home

21

22 Relation logit and log-linear model The 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: Leaving home

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

24 Relation logit and log-linear model The 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): Leaving home

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

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

27

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

29 The logistic regression in SPSS Micro data and tabulated data

30 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

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

32 The logistic regression in SPSS Leaving home

33 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

34 Construct your own logistic regression model

35 Specify the logistic regression for 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

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

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

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

39 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

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

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

42 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

43 SPSS output: logistic regression Parameters 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

44 SPSS output: logistic regression Parameters 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

45 SPSS and GLIM : a comparison

46

47


Download ppt "Logit model, logistic regression, and log-linear model A comparison."

Similar presentations


Ads by Google