levene_test: Calculates the Levene's test

View source: R/levene_test.R

levene_testR Documentation

Calculates the Levene's test

Description

levene_test Calculates the Levene's test for homogeneity of variance across groups, model coefficients, the variance-covariance matrix and the degrees of freedom.

Usage

levene_test(y, x, formula, data)

Arguments

y

numeric (continuous) response variable.

x

categorical group variable.

formula

A formula object to specify the model as normally used by glm. Use 'factor' to define the grouping x variable. Only one variable is allowed.

data

An objects of class milist, created by df2milist, list2milist or mids2milist.

Details

The Levene's test centers on group means to calculate outcome residuals, the Brown-Forsythe test on the median.

Value

An object from which the following objects are extracted:

  • fstats F-test value, including numerator and denominator degrees of freedom.

  • qhat model coefficients.

  • vcov variance-covariance matrix.

  • dfcom degrees of freedom obtained from df.residual.

Author(s)

Martijn Heymans, 2021

See Also

with.milist, pool_levenetest, bf_test

Examples


imp_dat <- df2milist(lbpmilr, impvar="Impnr")
ra <- with(imp_dat, expr=levene_test(Pain ~ factor(Carrying)))



miceafter documentation built on Oct. 2, 2022, 5:08 p.m.