Eduard Ponarin- Higher School of Economics, Russia
Veronica Kostenko- The National Research University
ERF Training Workshop on Opinion Poll Data Analysis Using Multilevel Models
Beirut, Lebanon August 22-23, 2016
www.erf.org.eg
2. The basic logistic regression
• X on Y in case of a
binary outcome.
• For example, if a
candidate won or not
during the elections, Y
is either 0 or 1). Here X
stands for the money
spent on the campaign,
Y – the outcome.
3. Plotting X against proportion of
successes
Where ni stands for the number of
observations at X = h.
4. Why not a linear model for
probabilities?
• Linear approximation is
problematic in this case
because:
a) Residuals are non-
randomly distributed
b) 0.2 < p < 0.8 is distributed
otherwise then the tails of
the function (p < 0.2; p >
0.8)
c) Regression line should fall
into the interval between
0 and 1 which is hard to fit
for a linear model
• Estimated probabilities
should be transformed into
logits
9. Script for a simple model
• M1 <- glmer(y ~ female + age + (1|country),
family=binomial(link="logit"))
• display (M1)
10. Output for a logistic multilevel
regression
• Coefficients shouldn’t be interpreted as in
linear models, they should be transformed
(exponential or divided-by-4 rule)
• Signs of the coefficients stay the same
• Coefficients can be compared with each other