a <- c(61,60,56,63,56,63,59,56,44,61) b <- c(55,54,47,59,51,61,57,54,62,58) var.test(a,b)
F test to compare two variances data: a and b F = 1.4815, num df = 9, denom df = 9, p-value = 0.5675 alternative hypothesis: true ratio of variances is not equal to 1 95 percent confidence interval: 0.3679936 5.9646717 sample estimates: ratio of variances 1.48154 >
library("car") a <- c(61,60,56,63,56,63,59,56,44,61) b <- c(55,54,47,59,51,61,57,54,62,58) x1 <- data.frame(a,b) x2 <- stack(x1) levene.test(values~ind, data=x2)
Levene's Test for Homogeneity of Variance Df F value Pr(>F) group 1 0.0039 0.9508 18
library("car") c1 <- c(3.6, 4.1, 4.0) c2 <- c(3.1, 3.2, 3.9) c3 <- c(3.2, 3.5, 3.5) c4 <- c(3.5, 3.8, 3.9) x1 <- data.frame(c1,c2,c3,c4) x2 <- stack(x1) levene.test(values~ind, data=x2)
Levene's Test for Homogeneity of Variance Df F value Pr(>F) group 3 0.2593 0.8528 8蠏覓願 讌讌..