Levene’s test is used to test if the variance between groups is comparable. The test can be used to compare the variances between two groups, but also between more than two groups.
mice
functionThe lbp_orig as part of the miceafter package is a dataset with
missing values. So we first impute them with the mice
function. Than we use the mids2milist
function to turn a
mids
object with multiply imputed datasets, as a result of
using mice
, into a milist
object. Than we use
the with
function to apply repeated analyses with the
levene_test
function across the list of multiply imputed
datasets. Finally, we pool the results by using the
pool_levenetest
function.
imp_data <- mice(lbp_orig, m=5, seed=3025, printFlag = FALSE)
imp_list <- mids2milist(imp_data)
ra <- with(data=imp_list,
expr = levene_test(Pain ~ factor(Satisfaction)))
res <- pool_levenetest(ra, method = "D1")
res
#> F_value df1 df2 P(>F) RIV
#> [1,] 0.9733556 2 39.1486 0.3867687 0.2869869
#> attr(,"class")
#> [1] "mipool"
mice
function in one
PipeThe lbp_orig as part of the miceafter package is a dataset with
missing values. So we first impute them with the mice
function. Than we use the mids2milist
function to turn a
mids
object with multiply imputed datasets, as a result of
using mice
, into a milist
object. Than we use
the with
function to apply repeated analyses with the
levene_test
function across the list of multiply imputed
datasets. Finally, we pool the results by using the
pool_levenetest
function.
The dataset lbpmilr
as part of the miceafter package is
a long dataset that contains 10 multiply imputed datasets. The datasets
are distinguished by the Impnr
variable. First we convert
the dataset into a milist
object by the
df2milist
function. Than we use the with
function to apply repeated analyses with the levene_test
function across the multiply imputed datasets. Finally, we pool the
results by using the pool_levenetest
function. As pooling
method we use D1
(D2
is also possible).