Re: [R] median of grouped data

2010-01-27 Thread Girish A.R.
Check the package doBy as well (pretty handy for analysis of grouped data). library(doBy) summaryBy(PM~ID,data=d,FUN=median) HTH, -Girish -- View this message in context: http://n4.nabble.com/median-of-grouped-data-tp1311971p1312386.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] median of grouped data

2010-01-27 Thread Felipe Carrillo
ery Biologist Department of the Interior US Fish & Wildlife Service California, USA --- On Wed, 1/27/10, "María del Pilar Márquez" wrote: > From: "María del Pilar Márquez" > Subject: [R] median of grouped data > To: r-help@r-project.org > Date: Wednesda

Re: [R] median of grouped data

2010-01-27 Thread Peter Alspach
day, 28 January 2010 7:06 a.m. > To: r-help@r-project.org > Subject: [R] median of grouped data > > Good morning, > I would like to know if is possible somebody can help me with > this please: > I would like to calculate the median of grouped data, this is > an example

[R] median of grouped data

2010-01-27 Thread María del Pilar Márquez
Good morning, I would like to know if is possible somebody can help me with this please: I would like to calculate the median of grouped data, this is an example: IDPM adt_01 25.255 adt_01 225.36 adt_01 14.2325 adt_02 15 adt_02 12.3 adt_03 15.2 adt_03 148.3 adt_03 25.5 adt_03 14.25 I

Re: [R] median of grouped data

2008-06-30 Thread [EMAIL PROTECTED]
On 28 июн, 03:19, "Bricklemyer, Ross S" <[EMAIL PROTECTED]> wrote: > I am having difficulty calculating the median of grouped data.  I have 8 to > 10 repeated measures per sample and I have successfully used the following > code to calculate the average for each sample. > > libs.norm.preds.median

Re: [R] median of grouped data

2008-06-28 Thread Peter Dalgaard
jim holtman wrote: Is this what you want: # split the dataframe by the grouping (z was your sample data) z.s <- split(z, z[[1]]) # calculate the median (ans <- lapply(z.s, function(.grp) apply(.grp[,7:9], 2, median))) $HOR006_3 TC.15_comps IC.16_comps SOC.17_comps 10.549669 4.

Re: [R] median of grouped data

2008-06-27 Thread jim holtman
Is this what you want: > # split the dataframe by the grouping (z was your sample data) > z.s <- split(z, z[[1]]) > # calculate the median > (ans <- lapply(z.s, function(.grp) apply(.grp[,7:9], 2, median))) $HOR006_3 TC.15_comps IC.16_comps SOC.17_comps 10.549669 4.224790 7.012470 $H

[R] median of grouped data

2008-06-27 Thread Bricklemyer, Ross S
I am having difficulty calculating the median of grouped data. I have 8 to 10 repeated measures per sample and I have successfully used the following code to calculate the average for each sample. libs.norm.preds.median[,7:9]<-apply(libs.norm.preds.median[,7:9],MARGIN=2, FUN=ave,libs.norm.pred