# Script 15.6 - Levene's test as a t
# Clean out workspace
rm(list = ls())
# Suppress levels of significance
options(show.signif.stars = FALSE)
library(car)
source("C:/R/functions.txt")
# Read in the data
white <- c(15,24,21,16,20,29,32,14,24,24,20,27,26,29,33,19,23,23,17,
14,24,37,20,13,22)
asian <- c(12,26,56,11,48,19,17,40,31,12,33,20,34,54,21,24,66,24,31,
33,16,21,27,20,62)
medw <- median(white)
meda <- median(asian)
devw <- abs(white - medw)
deva <- abs(asian - meda)
t.test(devw, deva, var.equal = TRUE)
# From the output, we note the observed t-statistic is -3.04243
# Squaring the observed t to get the F
(-3.04243)^2