portion sober vs. wage | class
with(DrinksWages, plot(wage, sober/n, col=c("blue","red","green")[class]))

# fit logistic regression model of sober on wage
mod.sober &lt;- glm(cbind(sober, n) ~ wage, family=binomial, data=DrinksWages)
summary(mod.sober)
op &lt;- par(mfrow=c(2,2))
plot(mod.sober)
par(op)

# TODO: plot fitted model
</code></pre>

</main>

</div>
</body></html>
