select_vartest: Data-Driven Selection of the Optimal Variance Homogeneity...

View source: R/select_vartest.R

select_vartestR Documentation

Data-Driven Selection of the Optimal Variance Homogeneity Test

Description

select_vartest performs an automated, simulation-based evaluation to identify the optimal variance homogeneity test for a dataset.

Usage

select_vartest(formula, data, nrep = 1000, alpha = 0.05, na.rm = TRUE, verbose = TRUE) 

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a tibble or data frame containing the variables in formula.

nrep

an integer specifying the number of Monte Carlo replications to perform for the simulation. The default is 1000.

alpha

the level of significance to assess variance homogeneity. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Details

The function calculates the empirical moments of the input data and uses the Pearson distribution system to generate random datasets. By evaluating 28 distinct methodological modifications of variance homogeneity tests on these generated datasets, the function recommends the method that yields the highest adjusted power (with the lowest Type I error).

Value

A data frame presenting empirical power, Type I error rate, and adjusted power for each variance homogeneity test.

Author(s)

Muhammed Ali Yilmaz and Osman Dag

Examples


library(vartest)

out <- select_vartest(Sepal.Length ~ Species, data = iris, nrep = 1000)
out


vartest documentation built on April 22, 2026, 5:09 p.m.