leveneTest {psichomics} | R Documentation

## Levene's test

### Description

Performs a Levene's test to assess the equality of variances

### Usage

    leveneTest(x, g, centers = median)

### Arguments

`x` | a numeric vector of data values, or a list of numeric data vectors. Non-numeric elements of a list will be coerced, with a warning.
`g` | a vector or factor object giving the group for the corresponding elements of `x`. Ignored with a warning if `x` is a list.
`centers` | Function used to calculate how much values spread (`median` by default; another common function used is `mean`)

### Details

The implementation of this function is based on `car:::leveneTest.default` with a more standard result.

### Value

A list with class `"htest"` containing the following components:

`statistic` | the value of the test statistic with a name describing it.
`p.value` | the p-value for the test.
`method` | the type of test applied.
`data.name` | a character string giving the names of the data.

### Examples

    vals <- sample(30, replace=TRUE)
    group <- lapply(list("A", "B", "C"), rep, 10)
    group <- unlist(group)
    psichomics:::leveneTest(vals, group)

    ## Using Levene's test based on the mean
    psichomics:::leveneTest(vals, group, mean)

[Package psichomics version 1.6.2 Index]