neg.cat {negligible} | R Documentation |
Equivalence Testing for Categorical Variables
Description
Testing for the presence of a negligible association between two categorical variables
Usage
neg.cat(
v1 = NULL,
v2 = NULL,
tab = NULL,
eiU = 0.2,
data = NULL,
plot = TRUE,
save = FALSE,
nbootpd = 1000,
alpha = 0.05
)
## S3 method for class 'neg.cat'
print(x, ...)
Arguments
v1 |
first categorical variable |
v2 |
second categorical variable |
tab |
contingency table for the two predictor variables |
eiU |
upper limit of equivalence interval |
data |
optional data file containing the categorical variables |
plot |
logical; should a plot be printed out with the effect and the proportional distance |
save |
should the plot be saved to 'jpg' or 'png' |
nbootpd |
number of bootstrap samples for calculating the CI for the proportional distance |
alpha |
nominal acceptable Type I error rate level |
x |
Data frame from neg.cat |
... |
extra arguments |
Details
This function evaluates whether a negligible relationship exists among two categorical variables.
The statistical test is based on the Cramer's V statistic; namely addressing the question of whether the upper limit of the confidence interval for Cramer's V falls below the upper bound of the negligible effect (equivalence) interval (eiU).
If the upper bound of the CI for Cramer's V falls below eiU, we can reject Ho: The relationship is nonnegligible (V >= eiU).
eiU is set to .2 by default, but should be set based on the context of the research. Since Cramer's V statistic is in a correlation metric, setting eiU is a matter of determining what correlation is the minimally meaningful effect size (MMES) given the context of the research.
Users can input either the names of the categorical variables (v1, v2) or a frequency (contingency) table (tab).
The proportional distance (V/eiU) estimates the proportional distance of the effect from 0 to eiU, and acts as an alternative effect size measure.
Value
A list
containing the following:
-
cramv
Cramer's V statistic -
propvar
Proportion of variance explained (V^2) -
cil
Lower bound of the confidence interval for Cramer's V -
ciu
Upper bound of the confidence interval for Cramer's V -
eiU
Upper bound of the negligible effect (equivalence) interval -
decis
NHST decision -
PD
Proportional distance -
CI95L
Lower bound of the 1-alpha CI for the PD -
CI95U
Upper bound of the 1-alpha CI for the PD -
alpha
Nominal Type I error rate
Author(s)
Rob Cribbie cribbie@yorku.ca
The confidence interval for the proportional distance is computed via bootstrapping (percentile bootstrap).
Examples
sex<-rep(c("m","f"),c(12,22))
haircol<-rep(c("bld","brn","bld","brn"),c(9,7,11,7))
d <- data.frame(sex,haircol)
tab<-table(sex,haircol)
neg.cat(tab=tab, alpha=.05, nbootpd=5)
neg.cat(v1=sex, v2=haircol, data=d, nbootpd=5)