0

I'm trying to plot empirical probability of a logistic regression. My data is students' homework score range from 0 to 20. The response is if they passed the final exam, 1 for pass and 0 for fail.

I want to know from my data, what is the rate of passing the final exam for students who received 18-20 in their homework, 16-18, etc.

I assume I can achieve this by several loops, but seems very complicated. Does anyone know an easier way? Thanks in advance.

NewbieDave
  • 1,199
  • 3
  • 12
  • 23
  • 1
    Need data and code. If you want a tutorial on doing logistic regression do a google search. – IRTFM Jun 11 '13 at 23:15
  • I think you want *something* like: `DF <- data.frame(hwscore,passed); DF <- transform(DF,hwbin=cut(hwscore,breaks=seq(0,20,by=2)); library("plyr"); ddply(DF,"hwbin",summarise,passprob=mean(passed))` – Ben Bolker Jun 12 '13 at 00:43

0 Answers0