Skip to content
Prev 276522 / 398506 Next

Graph binned data

On Nov 7, 2011, at 12:09 AM, Jeffrey Joh wrote:

            
?cut
?tapply
?mean

dat$sgrp <- cut(dat$speed, c(0,5,10, 15, 20), include.lowest=TRUE,  
right=TRUE)
  plot( tapply(dat$speed, dat$sgrp, mean), xaxt="n", ylim=c(0,20))
  axis(1, at= 1:4, labels = levels(dat$sgrp) )
(This would seem to be pretty basic material. Why don't you do further  
study of whatever introductory texts you are using.) The CI's can be  
added with one of the functions in package 'plotrix'.
David Winsemius, MD
West Hartford, CT