Skip to content

probable typo in "So, you did some GLMs & compared with AIC. Congrats!" #3

@ashander

Description

@ashander

The visualization example at the end of this post

Line 301 here should be ggplot(mavg.pred) + not ggplot(d) +

m2.pred <- broom::augment(m2)
m2.weight <- reported.table[2, "weight"]
m3.weight <- reported.table[3, "weight"]
mavg.pred <- m2.weight$weight * m2.pred[ , -(1:2)] + m3.weight$weight * m3.pred[ , -(1:3)]
mavg.pred <- cbind(m3.pred[1:3], mavg.pred)
library(ggplot2)
ggplot(d) +
geom_point(aes(Dept, Admitted / (Admitted + Rejected), color=Gender,
size=Admitted + Rejected),
position = position_dodge(width = 0.5)) +
geom_pointrange(aes(Dept, plogis(.fitted),
ymin = plogis(.fitted - 2 * .se.fit),
ymax = plogis(.fitted + 2 * .se.fit),
shape=Gender),
position=position_dodge(width = 0.5), data =mavg.pred, alpha=0.4) +
theme_minimal() + scale_color_manual(values=c(&quot;blue&quot;, &quot;orange&quot;))</code></pre>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions