Hello list: Is there an easy way (preferably through one of the standard R packages) of obtaining summary statistics for grouped data? I could split the data into classes by hist, and then progressively calculate all the "columns" i need to obtain the mean and standard deviation, but i was looking for a single function that could do that with a data vector. Thanks in advance, jose romero [[alternative HTML version deleted]]
There are several depending on what specifically you want to do. Some of the things to look at include: tapply, aggregate, the plyr package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of jose romero > Sent: Friday, February 12, 2010 10:24 AM > To: r-help at r-project.org > Subject: [R] summary statistics for grouped data > > Hello list: > > Is there an easy way (preferably through one of the standard R > packages) of obtaining summary statistics for grouped data? I could > split the data into classes by hist, and then progressively calculate > all the "columns" i need to obtain the mean and standard deviation, but > i was looking for a single function that could do that with a data > vector. > > Thanks in advance, > > jose romero > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.
You might find the summaryBy function in the doBy package useful. Regards S?ren ________________________________________ Fra: r-help-bounces at r-project.org [r-help-bounces at r-project.org] På vegne af jose romero [jlaurentum at yahoo.com] Sendt: 12. februar 2010 18:23 Til: r-help at r-project.org Emne: [R] summary statistics for grouped data Hello list: Is there an easy way (preferably through one of the standard R packages) of obtaining summary statistics for grouped data? I could split the data into classes by hist, and then progressively calculate all the "columns" i need to obtain the mean and standard deviation, but i was looking for a single function that could do that with a data vector. Thanks in advance, jose romero [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
At 6:44 PM +0100 2/12/10, S?ren H?jsgaard wrote:>You might find the summaryBy function in the doBy package useful. >Regards >S?rensee also the describe.by function in the psych package.>________________________________________ >Fra: r-help-bounces at r-project.org >[r-help-bounces at r-project.org] På vegne af >jose romero [jlaurentum at yahoo.com] >Sendt: 12. februar 2010 18:23 >Til: r-help at r-project.org >Emne: [R] summary statistics for grouped data > >Hello list: > >Is there an easy way (preferably through one of >the standard R packages) of obtaining summary >statistics for grouped data? I could split the >data into classes by hist, and then >progressively calculate all the "columns" i need >to obtain the mean and standard deviation, but i >was looking for a single function that could do >that with a data vector. > >Thanks in advance, > >jose romero > > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code. >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.-- William Revelle http://revelle.net/revelle.html 2815 Lakeside Court http://revelle.net/lakeside Evanston, Illinois It is 6 minutes to midnight http://www.thebulletin.org