| levene_test {cmstatr} | R Documentation |
Levene's Test for Equality of Variance
Description
This function performs the Levene's test for equality of variance.
Usage
levene_test(data = NULL, x, groups, alpha = 0.05, modcv = FALSE)
Arguments
data |
a data.frame |
x |
the variable in the data.frame or a vector on which to perform the Levene's test (usually strength) |
groups |
a variable in the data.frame that defines the groups |
alpha |
the significance level (default 0.05) |
modcv |
a logical value indicating whether the modified CV approach should be used. |
Details
This function performs the Levene's test for equality of variance. The data is transformed as follows:
w_{ij} = \left| x_{ij} - m_i \right|
Where m_i is median of the ith group. An F-Test is then
performed on the transformed data.
When modcv=TRUE, the data from each group is first transformed
according to the modified coefficient of variation (CV) rules before
performing Levene's test.
Value
Returns an object of class adk. This object has the following fields:
-
callthe expression used to call this function -
datathe original data supplied by the user -
groupsa vector of the groups used in the computation -
alphathe value of alpha specified -
modcva logical value indicating whether the modified CV approach was used. -
nthe total number of observations -
kthe number of groups -
fthe value of the F test statistic -
pthe computed p-value -
reject_equal_variancea boolean value indicating whether the null hypothesis that all samples have the same variance is rejected -
modcv_transformed_datathe data after the modified CV transformation
References
“Composite Materials Handbook, Volume 1. Polymer Matrix Composites Guideline for Characterization of Structural Materials,” SAE International, CMH-17-1G, Mar. 2012.
See Also
Examples
library(dplyr)
carbon.fabric.2 %>%
filter(test == "FC") %>%
levene_test(strength, condition)
##
## Call:
## levene_test(data = ., x = strength, groups = condition)
##
## n = 91 k = 5
## F = 3.883818 p-value = 0.00600518
## Conclusion: Samples have unequal variance ( alpha = 0.05 )