[R] Test of Homogeneity of Variances

Daren Tan daren76 at hotmail.com
Fri Aug 22 18:10:03 CEST 2008


I am testing whether the sample variances are equal. When p-value < 0.05 (alpha), should accept null hypothesis (sample variances are equal) or reject it ?


The two new examples with each having same sample variances also puzzle me. Why are the p-values different ?

bartlett.test(rep(rnorm(5),times=4), rep(1:5, each=4))


        Bartlett test of homogeneity of variances


data:  rep(rnorm(5), times = 4) and rep(1:5, each = 4)
Bartlett's K-squared = 0.8681, df = 4, p-value = 0.929


bartlett.test(rep(rnorm(5),times=4), rep(1:5, each=4))


        Bartlett test of homogeneity of variances


data:  rep(rnorm(5), times = 4) and rep(1:5, each = 4)
Bartlett's K-squared = 3.5599, df = 4, p-value = 0.4688


> From: Patrick.Richardson at vai.org
> To: daren76 at hotmail.com; r-help at stat.math.ethz.ch
> Date: Fri, 22 Aug 2008 11:25:36 -0400
> Subject: RE: [R] Test of Homogeneity of Variances
>
> What are your hypotheses? Once you state what they are, interpretation should be straightforward.
>
>
>
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Daren Tan
> Sent: Friday, August 22, 2008 11:18 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Test of Homogeneity of Variances
>
>
> I am testing the homogeneity of variances via bartlett.test and fligner.test. Using the following example, how should I interpret the p-value in order to accept or reject the null hypothesis ?
>
> set.seed(5)
> x <- rnorm(20)
> bartlett.test(x, rep(1:5, each=4))
>
>
> Bartlett test of homogeneity of variances
>
>
> data: x and rep(1:5, each = 4)
> Bartlett's K-squared = 1.7709, df = 4, p-value = 0.7778
>
> fligner.test(x, rep(1:5, each=4))
>
> Fligner-Killeen test of homogeneity of variances
>
>
> data: x and rep(1:5, each = 4)
> Fligner-Killeen:med chi-squared = 1.0819, df = 4, p-value = 0.8971
>
> ______________________________________________
> 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.
> This email message, including any attachments, is for ...{{dropped:6}}



More information about the R-help mailing list