[R] simulating the anova

From: Will Holcomb <wholcomb_at_gmail.com>
Date: Wed, 05 Mar 2008 00:03:10 -0500


I have been trying to figure out how to run a simple simulation of the ANOVA and I'm coming up just a bit short. The code I've got is:

cohen.f = .25
groups = 4
between.var = 19
within.var = between.var / cohen.f ^ 2
n = 500
sim.means = rnorm(n = groups, mean = 0, sd = sqrt(between.var)) sim.data = lapply(sim.means, function(mean) rnorm(n = n, mean = mean, sd = sqrt(within.var)))
sim.anova = ?

I'm pretty sure I've got data with the between group and within group variances that I want. I don't really know how to run an ANOVA on it though. All the examples I've been able to find (with aov and anova) require an explicit model. The ANOVA just tests the equivalence of means for a set of groups, right? Can I not just tell it to give me the likelihood the means are equal for all the columns without writing an explicit model.

Any help would be appreciated,
Will

        [[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. Received on Wed 05 Mar 2008 - 05:11:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 05 Mar 2008 - 07:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive