2, sum)         # totals at each concentration
prop &lt;- z[2,  ]/(tot)           # proportions at each concentration
oprop &lt;- sum(z[2,  ])/sum(tot)  # expected proportion moving if concentration had no effect
conc &lt;- as.numeric(dimnames(z)[[2]])
plot(conc, prop, xlab = "Concentration", ylab = "Proportion", xlim = c(.5,2.5),
    ylim = c(0, 1), pch = 16)
chw &lt;- par()$cxy[1]
text(conc - 0.75 * chw, prop, paste(tot), adj = 1)
abline(h = oprop, lty = 2)

pause()

anes.logit &lt;- glm(nomove ~ conc, fa