[R] summary stats

Neil Hepburn nhepburn at ualberta.ca
Sun Apr 16 20:55:36 CEST 2006


I have a data set that has student test scores along with several
categorical variables. I would like to generate a set of summary stats
(mean, variance, n) for the data grouped by school authority and by exam
topic.  I have tried the by() function but that seems to only be able to
handle one level of grouping.  In particular what I would like is
something like the following 

Board	Subject	Mean	Variance	N
board1	english	70	150		600
board2	english	66	210		510
board1	science	69	180		605
board2	science	71	220		520

and so on.


I have already generated the stats that I need using "GROUP BY" in a
select query in MySQL.  I'm just curious now about doing the same thing
in R

thanks in advance,
Neil




More information about the R-help mailing list