[R] multiple ANOVAs

Greg Snow Greg.Snow at imail.org
Fri Dec 14 17:48:23 CET 2007


Look at ?by and if that is not enough then look at the doBy package.  If
neither of those give you what you want, then give us more detail to
help you with.

Hope this helps,

-- 
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 Kevin J Emerson
> Sent: Thursday, December 13, 2007 1:21 PM
> To: r-help at r-project.org
> Subject: [R] multiple ANOVAs
> 
> Hello R help-ers,
> 
> 
> I have a basic question, but I have been playing with it for 
> a while and haven't quite gotten a hang of how to get it 
> working.  I want to perform multiple one-way ANOVAs on 
> subsets of data and am not sure how to do it in an automated 
> way.  I am thinking of doing something similar to 'aggregate'
> but I would like to collect all of the ANOVA results in a way 
> in which I can get to the information from each of the 
> independent ANOVAs.  In effect, I would like a data frame 
> with each of the subset identifiers, F and P values in the 
> rows.  Or a list of all of the ANOVA summaries or something like that.
> 
>  
> 
> I would like to do an anova of the form aov(var ~ day) for 
> each subset of data corresponding to "temp" and "line".  I 
> have lots of temps and lines and would like to do this in an 
> automated fashion.  I know of the aggregate function for 
> doing this kind of thing to compute means etc, but I am not 
> sure how to call an anova in this way.  I have looked at "by" 
> and "apply"
> and have tried various things but am unable to get it to work.  
> 
>  
> 
> Any help  would be greatly appreciated.  A sample of the 
> dataset is below.
> 
>  
> 
> Thank you for your time,
> 
> Kevin
> 
>  
> 
>  
> 
>    temp  line       day                 var 
> 
>      12 WMG 1        LD               70.59
> 
>      12 WMG 1        LD              100.00
> 
>      12 WMG 1        LD              100.00
> 
>      12 WMG 1        SD               85.00
> 
>      12 WMG 1        SD               75.00
> 
>      12 WMG 1        SD               90.00
> 
>      12 WMG 2        LD              100.00
> 
>      12 WMG 2        LD               83.33
> 
>      12 WMG 2        LD              100.00
> 
>      12 WMG 2        SD               91.67
> 
>      14 WMG 1        LD               76.03
> 
> .
> 
>  
> 
>    
> 
>  
> 
> 
> 	[[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.
> 



More information about the R-help mailing list