[R] unbalanced design in multifactor anova....

peter dalgaard pd@|gd @end|ng |rom gm@||@com
Tue Jan 18 13:43:25 CET 2022


In brief, aov() requires balancedness (or at least you _really_ need to know what you are doing otherwise), lm() does not, but you need to be careful that results, like in any multiple regression, depends on test order. For models with random effects, things get tricky and you likely need to use the "lme4" package.

- Peter D.

> On 18 Jan 2022, at 08:14 , akshay kulkarni <akshay_e4 using hotmail.com> wrote:
> 
> dear members,
>                         I have a question on anova as implemented in R.
> 
> If there is an unbalanced design in multifactor anova, will aov or lm work properly? I was reading a book on excel where the author points that in an unbalanced design, the factors, as coded vectors, are correlated. He says that variance will be allocated properly only when the coded vectors are uncorrelated. But he also justifies that the function TREND() in Excel handles this automatically using semipartial correlations.
> 
> What about aov or lm in R, which are used to implement anova? Should we do some thing extra for them to work properly in an unbalanced design? Or will the coding system used by R to represent the factors or levels internally handles the correlation?
> 
> THanking you,
> Yours sincerely,
> AKSHAY M KULKARNI
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes using cbs.dk  Priv: PDalgd using gmail.com



More information about the R-help mailing list