Skip to main content
replaced http://stats.stackexchange.com/ with https://stats.stackexchange.com/
Source Link

I would just add that you might wish to install the car package and use Anova() that this package provides instead of anova() because for aov() and lm() objects, the vanilla anova() uses a sequential sum of squares, which gives the wrong result for unequal sample sizes while for lme() it uses either the type-I or the type-III sum of squares depending on the type argument, but the type-III sum of squares violates marginality-- i.e. it treats interactions no differently than main effects.

The R-help list has nothing good to say about type-I and type-III sums of squares, and yet these are the only options! Go figure.

Edit: Actually, it looks like type-II is not valid if there is a significant interaction term, and it seems the best anybody can do is use type-III when there are interactions. I got tipped off to it by an answer to one of my own questionsanswer to one of my own questions that in turn pointed me to this postthis post.

I would just add that you might wish to install the car package and use Anova() that this package provides instead of anova() because for aov() and lm() objects, the vanilla anova() uses a sequential sum of squares, which gives the wrong result for unequal sample sizes while for lme() it uses either the type-I or the type-III sum of squares depending on the type argument, but the type-III sum of squares violates marginality-- i.e. it treats interactions no differently than main effects.

The R-help list has nothing good to say about type-I and type-III sums of squares, and yet these are the only options! Go figure.

Edit: Actually, it looks like type-II is not valid if there is a significant interaction term, and it seems the best anybody can do is use type-III when there are interactions. I got tipped off to it by an answer to one of my own questions that in turn pointed me to this post.

I would just add that you might wish to install the car package and use Anova() that this package provides instead of anova() because for aov() and lm() objects, the vanilla anova() uses a sequential sum of squares, which gives the wrong result for unequal sample sizes while for lme() it uses either the type-I or the type-III sum of squares depending on the type argument, but the type-III sum of squares violates marginality-- i.e. it treats interactions no differently than main effects.

The R-help list has nothing good to say about type-I and type-III sums of squares, and yet these are the only options! Go figure.

Edit: Actually, it looks like type-II is not valid if there is a significant interaction term, and it seems the best anybody can do is use type-III when there are interactions. I got tipped off to it by an answer to one of my own questions that in turn pointed me to this post.

added 392 characters in body
Source Link
f1r3br4nd
  • 2.4k
  • 22
  • 32

I would just add that you might wish to install the car package and use Anova() that this package provides instead of anova() because for aov() and lm() objects, the vanilla anova() uses a sequential sum of squares, which gives the wrong result for unequal sample sizes while for lme() it uses either the type-I or the type-III sum of squares depending on the type argument, but the type-III sum of squares violates marginality-- i.e. it treats interactions no differently than main effects.

The R-help list has nothing good to say aboutThe R-help list has nothing good to say about type-I and type-III sums of squares, and yet these are the only options! Go figure.

Edit: Actually, it looks like type-III is not valid if there is a significant interaction term, and it seems the best anybody can do is use type-III sums of squares, and yet thesewhen there are the only options! Go figureinteractions. I got tipped off to it by an answer to one of my own questions that in turn pointed me to this post.

I would just add that you might wish to install the car package and use Anova() that this package provides instead of anova() because for aov() and lm() objects, the vanilla anova() uses a sequential sum of squares, which gives the wrong result for unequal sample sizes while for lme() it uses either the type-I or the type-III sum of squares depending on the type argument, but the type-III sum of squares violates marginality-- i.e. it treats interactions no differently than main effects.

The R-help list has nothing good to say about type-I and type-III sums of squares, and yet these are the only options! Go figure.

I would just add that you might wish to install the car package and use Anova() that this package provides instead of anova() because for aov() and lm() objects, the vanilla anova() uses a sequential sum of squares, which gives the wrong result for unequal sample sizes while for lme() it uses either the type-I or the type-III sum of squares depending on the type argument, but the type-III sum of squares violates marginality-- i.e. it treats interactions no differently than main effects.

The R-help list has nothing good to say about type-I and type-III sums of squares, and yet these are the only options! Go figure.

Edit: Actually, it looks like type-II is not valid if there is a significant interaction term, and it seems the best anybody can do is use type-III when there are interactions. I got tipped off to it by an answer to one of my own questions that in turn pointed me to this post.

Source Link
f1r3br4nd
  • 2.4k
  • 22
  • 32

I would just add that you might wish to install the car package and use Anova() that this package provides instead of anova() because for aov() and lm() objects, the vanilla anova() uses a sequential sum of squares, which gives the wrong result for unequal sample sizes while for lme() it uses either the type-I or the type-III sum of squares depending on the type argument, but the type-III sum of squares violates marginality-- i.e. it treats interactions no differently than main effects.

The R-help list has nothing good to say about type-I and type-III sums of squares, and yet these are the only options! Go figure.