Hello, I have a question concerning the output of leveneTest. I don't understand the "7" in my output Levene's Test for Homogeneity of Variance (center = median) Df F value Pr(>F) group 2 0.0173 0.9829 7 # Where does this number come from? Thanks. Hermann> resgroup.ID qtrait 1 0 6462.3288 2 0 816.7808 3 0 6031.3356 4 0 1013.5274 5 0 1517.2500 6 1 1585.2740 7 1 2481.6781 8 1 8871.5753 9 2 4913.5274 10 2 833.7329> ltest <- leveneTest (qtrait~group.ID, res) > ltestLevene's Test for Homogeneity of Variance (center = median) Df F value Pr(>F) group 2 0.0173 0.9829 7> dput (res)structure(list(group.ID = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L), .Label = c("0", "1", "2"), class = "factor"), qtrait = c(6462.32876712329, 816.780821917808, 6031.33561643836, 1013.52739726027, 1517.25, 1585.27397260274, 2481.67808219178, 8871.57534246575, 4913.52739726027, 833.732876712329)), .Names c("group.ID", "qtrait"), row.names = c(NA, -10L), class = "data.frame") [[alternative HTML version deleted]]
Dear Hermann,> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Hermann Norpois > Sent: Tuesday, October 01, 2013 8:07 AM > To: r-help > Subject: [R] leveneTest - output > > Hello, > > I have a question concerning the output of leveneTest. I don't > understand > the "7" in my outputThat's the denominator df for F. Best, John> > Levene's Test for Homogeneity of Variance (center = median) > Df F value Pr(>F) > group 2 0.0173 0.9829 > 7 # Where does this number come from? > > Thanks. > Hermann > > > > res > group.ID qtrait > 1 0 6462.3288 > 2 0 816.7808 > 3 0 6031.3356 > 4 0 1013.5274 > 5 0 1517.2500 > 6 1 1585.2740 > 7 1 2481.6781 > 8 1 8871.5753 > 9 2 4913.5274 > 10 2 833.7329 > > ltest <- leveneTest (qtrait~group.ID, res) > > ltest > Levene's Test for Homogeneity of Variance (center = median) > Df F value Pr(>F) > group 2 0.0173 0.9829 > 7 > > dput (res) > structure(list(group.ID = structure(c(1L, 1L, 1L, 1L, 1L, 2L, > 2L, 2L, 3L, 3L), .Label = c("0", "1", "2"), class = "factor"), > qtrait = c(6462.32876712329, 816.780821917808, 6031.33561643836, > 1013.52739726027, 1517.25, 1585.27397260274, 2481.67808219178, > 8871.57534246575, 4913.52739726027, 833.732876712329)), .Names > c("group.ID", > "qtrait"), row.names = c(NA, -10L), class = "data.frame") > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
> I have a question concerning the output of leveneTest. I don't > understand > the "7" in my outputIt's the residual degrees of freedom for the corresponding ANOVA table. You'd get the same value if you did a one-way ANOVA by group.ID. Having said that, your test isn't going to tell you much if the example data is the data of interest. First, the dispersions don't look much different on plotting; unless you have reason to believe there should be an underlying difference in variance you could probably stop there. Second, I seem to recall Levene's test is rather flaky for unbalanced data - it doesn't just test the null of equal variance. And third, for the data set size you have in the example, it's got very low power indeed. Based on exploratory simulations I've done myself, for factor-of-four changes in variance between your largest and smallest variance, you'll probably have test power under 5%. Think about that for a second: for a well-behaved test you should expect 5% test power for a negligibly small effect just by setting 95% confidence. Levene's test is fair for larger sets (10 per group and up) and more robust than some, but on this size of data set it doesn't even give you the chance 'reject' rate you asked for at the null. At this size, if I had to apply a test I'd consider bartlett's test instead; although I recall that as having pretty severe caveats around normality at least it preserves the expected confidence level reasonably well. Still, I suppose that if you apply a test that is guaranteed to pass in all but catastrophically extreme circumstances, at least you can say you've applied a test. S Ellison ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}