[R] fligner.test
Ben Bolker
bolker at ufl.edu
Fri Jun 20 18:33:27 CEST 2008
Stefan Th. Gries <stgries <at> gmail.com> writes:
>
> Hi all
>
> I have a question regarding the Fligner-Killeen test. I am using
>
> - a PC with Windows XP (Build 20600.xpsp080413-2111 (Service Pack 3);
> - the following R version:
> > sessionInfo()
> R version 2.7.0 (2008-04-22)
> i386-pc-mingw32
>
> I have a vector LENGTH and a factor RELATION that are distributed like this:
>
> > table(LENGTH, RELATION)
> RELATION
> LENGTH object subject
[snip]
> > fligner.test(LENGTH[RELATION=="subject"], LENGTH[RELATION=="object"])
> Fligner-Killeen test of homogeneity of variances
> data: LENGTH[RELATION == "subject"] and LENGTH[RELATION == "object"]
> Fligner-Killeen:med chi-squared = 18.3552, df = 14, p-value = 0.1911
>
> > fligner.test(LENGTH[RELATION=="object"], LENGTH[RELATION=="subject"])
> Fligner-Killeen test of homogeneity of variances
> data: LENGTH[RELATION == "object"] and LENGTH[RELATION == "subject"]
> Fligner-Killeen:med chi-squared = 16.8838, df = 13, p-value = 0.2047
>
> > fligner.test(LENGTH~RELATION)
> Fligner-Killeen test of homogeneity of variances
> data: LENGTH by RELATION
> Fligner-Killeen:med chi-squared = 0.626, df = 1, p-value = 0.4288
> #########
>
> The order of the vectors etc. changes the results??? Needless to say
> this does not happen with var.test or ... Is this normal; if so, which
> one is the one to report?
I think you misunderstood the manual page for fligner.test.
I believe that all of the following should give identical
results (corresponding to the last test in your examples):
fligner.test(list(LENGTH[RELATION=="subject"], LENGTH[RELATION=="object"]))
fligner.test(list(LENGTH[RELATION=="object"], LENGTH[RELATION=="subject"]))
fligner.test(LENGTH,RELATION)
fligner.test(LENGTH~RELATION)
More information about the R-help
mailing list