Hi is there an R equivalent of the Stata collpase command?
suppose i have: classes <- 1:5 schools <- letters[1:5] stud <- 1:10 dat <- expand.grid(School = schools, Grade = classes, Student.ID = stud) with(dat, table(Student.ID, School)) dat$marks <- rnorm(nrow(dat), 50, 25) I want to get the mean score by school and class while the data is at the school-class-student level. I could write something up but I was wondering if there is already something otu there. Alex ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html