Description Usage Arguments Value See Also Examples
Function to test the homogeneity of variance for two populations, an assumption of the independent samples t-test. The null hypothesis tested is that the two population variances are equal; the alternative is that the two population variances are not equal.
1 | levenes.test(y, group)
|
y |
outcome variable of interest, given as a numeric object. |
group |
a factor or character object with two levels indicating group membership. |
An anova table containing test results: two values for degrees of freedom, the F-value, and the p-value.
1 2 3 4 5 6 7 8 9 10 11 | # using simple data frame
value = c(7,2,4,4,8,3,61,2,80,4)
grp = rep(c("A","B"), each = 5)
ex_data = data.frame(value = value, grp = grp)
levenes.test(ex_data$value, group = ex_data$grp)
# using variable without NA values
levenes.test(NELS$famsize, group = NELS$gender)
# using variable with NA values
levenes.test(NELS$achrdg12, group = NELS$gender)
|
Levene's Test for Homogeneity of Variance
Df F value Pr(>F)
group 1 45.615 0.0001445 ***
8
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Levene's Test for Homogeneity of Variance
Df F value Pr(>F)
group 1 0.7005 0.403
498
Levene's Test for Homogeneity of Variance
Df F value Pr(>F)
group 1 4.1273 0.04273 *
498
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.