Levene's Test for hom*ogeneity of Variance (2024)

test.levene {misty}R Documentation

Description

This function performs Levene's test for hom*ogeneity of variance across twoor more independent groups.

Usage

test.levene(formula, data, method = c("median", "mean"), conf.level = 0.95, hypo = TRUE, descript = TRUE, plot = FALSE, violin.alpha = 0.3, violin.trim = FALSE, box = TRUE, box.alpha = 0.2, box.width = 0.2, jitter = TRUE, jitter.size = 1.25, jitter.width = 0.05, jitter.height = 0, jitter.alpha = 0.2, gray = FALSE, start = 0.9, end = 0.4, color = NULL, xlab = NULL, ylab = NULL, ylim = NULL, breaks = ggplot2::waiver(), title = "", subtitle = "", digits = 2, p.digits = 3, as.na = NULL, write = NULL, append = TRUE, check = TRUE, output = TRUE)

Arguments

formula

a formula of the form y ~ group where y isa numeric variable giving the data values and groupa numeric variable, character variable or factor with twoor more than two values or factor levels giving thecorresponding groups.

data

a matrix or data frame containing the variables in theformula formula.

method

a character string specifying the method to compute thecenter of each group, i.e. method = "median" (default)to compute the Levene's test based on the median (akaBrown-Forsythe test) or method = "mean" to computethe Levene's test based on the arithmetic mean.

conf.level

a numeric value between 0 and 1 indicating the confidencelevel of the interval.

hypo

logical: if TRUE (default), null and alternative hypothesisare shown on the console.

descript

logical: if TRUE (default), descriptive statistics are shownon the console.

plot

logical: if TRUE, a plot showing violin plots withboxplots is drawn.

violin.alpha

a numeric value indicating the opacity of the violins.

violin.trim

logical: if TRUE, the tails of the violins to therange of the data is trimmed.

box

logical: if TRUE (default), boxplots are drawn.

box.alpha

a numeric value indicating the opacity of the boxplots.

box.width

a numeric value indicating the width of the boxplots.

jitter

logical: if TRUE (default), jittered data pointsare drawn.

jitter.size

a numeric value indicating the size aestheticfor the jittered data points.

jitter.width

a numeric value indicating the amount of horizontal jitter.

jitter.height

a numeric value indicating the amount of vertical jitter.

jitter.alpha

a numeric value indicating the opacity of the jittereddata points.

gray

logical: if TRUE, the plot is drawn in gray scale.

start

a numeric value between 0 and 1, graphical parameter tospecify the gray value at the low end of the palette.

end

a numeric value between 0 and 1, graphical parameter tospecify the gray value at the high end of the palette.

color

a character vector, indicating the color of the violinsand the boxes. By default, default ggplot2 colors areused.

xlab

a character string specifying the labels for the x-axis.

ylab

a character string specifying the labels for the y-axis.

ylim

a numeric vector of length two specifying limits of thelimits of the y-axis.

breaks

a numeric vector specifying the points at which tick-marksare drawn at the y-axis.

title

a character string specifying the text for the title forthe plot.

subtitle

a character string specifying the text for the subtitlefor the plot.

digits

an integer value indicating the number of decimal placesto be used for displaying results.

p.digits

an integer value indicating the number of decimal placesto be used for displaying the p-value.

as.na

a numeric vector indicating user-defined missing values,i.e. these values are converted to NA beforeconducting the analysis.

write

a character string naming a text file with file extension".txt" (e.g., "Output.txt") for writing theoutput into a text file.

append

logical: if TRUE (default), output will be appendedto an existing text file with extension .txt specifiedin write, if FALSE existing text file will beoverwritten.

check

logical: if TRUE (default), argument specification is checked.

output

logical: if TRUE (default), output is shown.

Details

Levene's test is equivalent to a one-way analysis of variance (ANOVA) with theabsolute deviations of observations from the mean of each group as dependentvariable (center = "mean"). Brown and Forsythe (1974) modified theLevene's test by using the absolute deviations of observations from the median(center = "median"). By default, the Levene's test uses the absolutedeviations of observations from the median.

Value

Returns an object of class misty.object, which is a list with followingentries:

call

function call

type

type of analysis

formula

formula of the current analysis

data

data frame specified in data

plot

ggplot2 object for plotting the results

args

specification of function arguments

result

list with result tables, i.e., descript fordescriptive statistics and test for the ANOVAtable

Author(s)

Takuya Yanagida takuya.yanagida@univie.ac.at

References

Brown, M. B., & Forsythe, A. B. (1974). Robust tests for the equality ofvariances. Journal of the American Statistical Association, 69,364-367.

Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). Statistics in psychology- Using R and SPSS. John Wiley & Sons.

See Also

aov.b, test.t, test.welch

Examples

dat <- data.frame(y = c(2, 3, 4, 5, 5, 7, 8, 4, 5, 2, 4, 3), group = c(1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3))# Example 1: Levene's test based on the median with 95% confidence intervaltest.levene(y ~ group, data = dat)# Example 2: Levene's test based on the arithmetic mean with 95% confidence intervaltest.levene(y ~ group, data = dat, method = "mean")# Example 3: Levene's test based on the median with 99% confidence intervaltest.levene(y ~ group, data = dat, conf.level = 0.99)## Not run: # Example 4: Write results into a text filetest.levene(y ~ group, data = dat, write = "Levene.txt")# Example 5: Levene's test based on the median with 95# plot resultstest.levene(y ~ group, data = dat, plot = TRUE)# Load ggplot2 packagelibrary(ggplot2)# Save plot, ggsave() from the ggplot2 packageggsave("Levene-test.png", dpi = 600, width = 5, height = 6)# Levene's test based on the median with 95# extract plotp <- test.levene(y ~ group, data = dat, output = FALSE)$plotp# Example 6: Extract dataplotdat <- test.levene(y ~ group, data = dat, output = FALSE)$data# Draw violin and boxplots in line with the default setting of test.levene()ggplot(plotdat, aes(group, y, fill = group)) + geom_violin(alpha = 0.3, trim = FALSE) + geom_boxplot(alpha = 0.2, width = 0.2) + geom_jitter(alpha = 0.2, width = 0.05, size = 1.25) + theme_bw() + guides(fill = "none")## End(Not run)

[Package misty version 0.6.5 Index]

Levene's Test for hom*ogeneity of Variance (2024)
Top Articles
Dayforce Trader Joe's: Login Process & Login Issues Explained - Xivents
TraderJoes Dayforce: Streamlining Operations For Retail Success
How To Check Your Rust Inventory Value? 🔫
Dr. Hannah Straight Website
What Is a Megapixel: Essential Guide [Megapixels Explained]
Ess Compass Associate Portal Login
Nehemiah 6 Kjv
Tear Of The Kingdom Nsp
Anonib Altoona Pa
Cristiano Ronaldo's Jersey Number: The Story Behind His No. 7 Shirt | Football News
Courtney Eaton Is Figuring It All Out
Dr Thottam Ent Clinton Township
Rooms for rent in Pompano Beach, Broward County, FL
Northamptonshire | England, Map, History, & Facts
Jera Gardens
Nissan 300Zx For Sale Craigslist
Terraria Melee Build Progression Guide & Best Class Loadouts
Making a Docker Container Use a VPN – Natural Born Coder
When His Eyes Opened Chapter 2981
Ma.speedtest.rcn/Merlin
Portland Walmart closures attract national attention; Wheeler, Texas Gov. Greg Abbott spar
How To Find Free Stuff On Craigslist San Diego | Tips, Popular Items, Safety Precautions | RoamBliss
Female Same Size Vore Thread
Craigslist Apts Near Me
Tcu Jaggaer
Toernooien, drives en clubcompetities
Snow Rider Unblocked 67
1773X To
Fort Worth Craiglist
افضل موقع سكسي عربي
Chris Bailey Weather Forecast
Who We Are | Kappa Delta Sorority
Fedex Passport Locations Near Me
Kltv Com Big Red Box
12000 Divided By 40
Jan Markell Net Worth
M3Gan Showtimes Near Cinemark North Hills And Xd
charleston rooms & shares - craigslist
New York Sports Club Carmel Hamlet Photos
Donald Vacanti Obituary
Limestone Bank Hillview
6173770487
Alles, was ihr über Saison 03 von Call of Duty: Warzone 2.0 und Call of Duty: Modern Warfare II wissen müsst
Aces Fmc Charting
Ihop Ralph Ave
Easy Homemade Eggnog is So Underrated
Smartmove Internet Provider
Apartments for Rent in Atlanta, GA - Home Rentals | realtor.com®
Natalya Neidhart: Assembling the BOAT
Inside Dave Grohl's past love life and cheating scandals
Opsahl Kostel Funeral Home & Crematory Yankton
Latest Posts
Article information

Author: Maia Crooks Jr

Last Updated:

Views: 6044

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Maia Crooks Jr

Birthday: 1997-09-21

Address: 93119 Joseph Street, Peggyfurt, NC 11582

Phone: +2983088926881

Job: Principal Design Liaison

Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.