levenes.test {sur} | R Documentation |
Levene's Test for Homogeneity of Variance
Description
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.
Usage
levenes.test(y, group)
Arguments
y |
outcome variable of interest, given as a numeric object. |
group |
a factor or character object with two levels indicating group membership. |
Value
An anova table containing test results: two values for degrees of freedom, the F-value, and the p-value.
See Also
Examples
# 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)
[Package sur version 1.0.4 Index]