[R] one-way ANOVA model, with one factor, an unbalanced design and unequal variances
peter dalgaard
pdalgd at gmail.com
Thu Apr 21 21:07:46 CEST 2011
On Apr 21, 2011, at 20:28 , Steven wrote:
> Hi,
>
> i'm looking for an R function to fit a one-way ANOVA with one factor
> containing 10 levels. The factor levels have different numbers of
> observations (varying between 20 to 40). For most of the dependent variables
> i'm testing there are unequal variances among the factor levels.
>
> I see the function oneway.test:
>
> oneway.test(variable ~ factor, data=dataset)
>
> which by default does not assume equal variances. I also see the basic ANOVA
> function (aov), which, I think, is OK for unbalanced designs. I get a
> different F ratio, however, when using these two functions on the same data,
> which seems to indicate that the aov function assumes equal variances.
>
> My question: is there an R function that performs a one-way ANOVA while not
> assuming a balanced design *or* equal variances? Does the oneway.test
> function, for example, assume a balanced design?
Neither of them assumes a balanced design. This only comes into play
(a) for random effects where aov() effectively assumes it (or rather, it does something truly bizarre when they are not balanced...)
(b) when there are two or more factors, but only in the sense that the terms in the anova table may not be interchangeable.
--
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-help
mailing list