[R] different results from fligner.test

peter dalgaard pdalgd at gmail.com
Tue Jan 10 23:46:37 CET 2012


On Jan 10, 2012, at 21:30 , gaiarrido wrote:

> I've made fligner test with the same data, changing the orders of the
> variables, and this what i get
> 
>> fligner.test(rojos~edadysexo*zona*ano*estacion)
> 
>        Fligner-Killeen test of homogeneity of variances
> 
> data:  rojos by edadysexo by zona by ano by estacion 
> Fligner-Killeen:med chi-squared = 15.7651, df = 2, p-value = 0.0003773
> 
>> fligner.test(rojos~ano*edadysexo*zona*estacion)
> 
>        Fligner-Killeen test of homogeneity of variances
> 
> data:  rojos by ano by edadysexo by zona by estacion 
> Fligner-Killeen:med chi-squared = 86.5317, df = 3, p-value < 2.2e-16
> 
> Different results with the same variables!!! Why? i try to find an answer,
> but i really surprised

You are assuming that you can put interactions on the rhs of formulas, but nowhere in the documentation does it say that that should work. All examples have a single grouping variables. So the behavior is undefined. As far as I can see, only the _first_ variable is actually being used for grouping.  

Arguably, there is potential for better argument checking in fligner.test(), but in the meantime, I suspect that you need something like

g <- interaction(ano, edadysexo, zona, estacion)
fligner.test(rojos ~ g)

> 
> -----
> Mario Garrido Escudero
> PhD student
> Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola
> Universidad de Salamanca
> --
> View this message in context: http://r.789695.n4.nabble.com/different-results-from-fligner-test-tp4283312p4283312.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 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
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list