Logistic regression

Some formulas

  1. Simple logistic regression:
    logit[π(x)] = α + βx π(x) = exp(α + βx)
    1 + exp(α + βx)
  2. Likelihood ratio test
    LR statistic = −2(0 −1) = Deviance0 − Deviance1, df = df0 − df1
  3. Baseline-category logit model has form
    log  πi
    πJ
    
    = αj + βjx, j = 1, 2, . . . , J − 1.
  4. Cumulative logit model has form
    logit[Pr(Y ≤ j)] = αj + βx, j = 1, . . . , J − 1
    odds(Y ≤ j|x + 1)
    odds(Y ≤ j|x)
    = e
    β
  5. Let π denote the probability that a randomly selected respondent supports current laws legalizing
    abortion, predicted using gender of respondent (G = 0, male; G = 1, female), religious affiliation (R1
    = 1, Protestant, 0 otherwise; R2 = 1, Catholic, 0 otherwise; R1 = R2 = 0, Jewish), and political
    party affiliation (P1 = 1, Democrat, 0 otherwise; P2 = 1, Republican, 0 otherwise, P1 = P2 = 0,
    Independent). The logit model with main effects has prediction equation
    logit(ˆπ) = 0.11 + 0.16G − 0.57R1 − 0.66R2 + 0.47P1 − 1.67P2
    (a) (7 points) Controlling for religious affiliation and political party affiliation, are Females estimated
    to be more likely than males to support legalized abortion? Why?
    (b) (7 points) Controlling for gender and religious affiliation, what is ratio between the estimated
    odds that a Democrat supports legalized abortion and the estimated odds that a Republican
    supports legalized abortion?
    (c) (8 points) What is the estimated probability that a male Jewish Independent supports legalized
    abortion?
    (d) (8 points) Which group has the highest estimated probability of supporting legalized abortion?
    Page 2
  6. Consider the loglinear model of independence for a two-way contingency table. This has equation for
    expected frequencies {µij} in an I × J contingency table,
    log µij = λ + λ
    X
    i + λ
    Y
    j
    (a) (5 points) Motivate this model, by showing how the definition of statistical independenceof two
    categorical variables implies that a loglinear model of this form holds.
    (b) (10 points) To allow for association between X and Y, this model is extended to
    log µij = λ + λ
    X
    i + λ
    Y
    j + λ
    XY
    ij
    For a 2 × 2 contingency table, express the log odds ratio in terms of expected frequencies, and
    use it to show that the odds ratio for this model equalsexp
    λ
    XY
    11 + λ
    XY
    22 − λ
    XY
    12 − λ
    XY
    21 
    . (Hence
    the two-factor interaction parameters provide information about the XY association.)
  7. A model fit predicting preference for President (Democrat, Republican Independent) suing x = annual
    income (in $10.000 dollars) is log(ˆπD/πˆI ) = 3.0 − 0.3x and log(ˆπR/πˆI ) = 1.0 + 0.28x
    (a) (6 points) State the prediction equation for log(ˆπR/πˆD). Interpret its slope.
    (b) (7 points) Find the range of x for which πˆR > πˆD
    (c) (7 points) State the prediction equation for πˆI
    Page
  8. Let Y = political ideology (on an ordinal scale from 1 = very liberal to 5 = very conservative), x1 =
    gender (1 = female, 0 = male), x2 = political party (1 = Democrat, 0 = Republican).
    (a) (7 points) A main effects model with a cumulative logit link gives the output shown. Explain
    why the output reports four intercepts.

Estimate Std. Error z value Pr(>|z|)

(Intercept):1 -2.532 0.150 -16.934 2.53e-64

(Intercept):2 -1.539 0.130 -11.879 1.53e-32

(Intercept):3 0.175 0.117 1.496 1.35e-01

(Intercept):4 1.009 0.124 8.116 4.83e-16

PartyDem 0.964 0.129 7.449 9.39e-14

GenderFemale 0.117 0.127 0.921 3.57e-01

(b) (7 points) Explain how to describe gender effect on political ideology with an odds ratio.
(c) (7 points) Beloew is the results of LRT of the two explanotory vairables. What is the hypotheses
to which the LRT for gender refers? And explain how to interpret the result of the test.

Single term deletions

#

Model:

cbind(VLib, SLib, Mod, SCon, VCon) ~ Party + Gender

Df Deviance AIC LRT Pr(>Chi)

15.1 107

Party 1 71.9 162 56.8 4.7e-14 ***

Gender 1 15.9 106 0.8 0.36

---

Signif. codes: 0 '' 0.001 '' 0.01 '' 0.05 '.' 0.1 ' ' 1

(d) (7 points) When we add an interaction term to the model, we get the output shown. Explain how
to find the estimated odds ratio for the gender effect on political ideology for Republicans.

Estimate Std. Error z value Pr(>|z|)

(Intercept):1 -2.6743 0.166 -16.111 2.14e-58

(Intercept):2 -1.6772 0.148 -11.316 1.09e-29

(Intercept):3 0.0424 0.135 0.313 7.54e-01

(Intercept):4 0.8790 0.141 6.255 3.97e-10

PartyDem 1.2653 0.197 6.419 1.38e-10

GenderFemale 0.3661 0.180 2.037 4.16e-02

PartyDem:GenderFemale -0.5091 0.254 -2.004 4.51e-02

(e) (7 points) Using the interaction model, show how to find the estimated probability that a female
Republican is in the first category (very liberal).