I have to run an multiple way Anova and want to test the assumption of homoscedasticity.
How can I run a Fligner.test with several independent variables (variables indicating the grouping) with R? Does it make sense to do such a thing?
I have to run an multiple way Anova and want to test the assumption of homoscedasticity.
How can I run a Fligner.test with several independent variables (variables indicating the grouping) with R? Does it make sense to do such a thing?
There are two ways of using the fligner.test() function. You can either do
fligner.test(x=…, g=…)
or
fligner.test(formula= a~b+c+d, data=your_data)
The second case allows to check an anova model with several independent variables.
And yes, it totally makes sense to run a Fligner test with several grouping variables.
Be careful with the use of the formula fligner.test(formula= a~b+c+d, data=your_data)
.
The fligner.test
will only take into account the first factor when you use this notation (see example here).
A more appropriate way to handle multiple independent variables is with the formula fligner.test(a ~ interaction(a, b, c, d), data=your_data)
. This will make sure that the order you use for your independent variables does not impact your output (i.e., p-value).