testHetPerm {TreeBUGS} | R Documentation |
Permutation Test of Heterogeneity
Description
Tests whether whether participants (items) are homogeneous without assuming item (participant) homogeneity.
Usage
testHetPerm(data, tree, source = "person", rep = 1000, nCPU = 4)
Arguments
data |
matrix or data frame with three columns: person code/index, item label, response category. Can also be the path to a .csv file with frequencies (comma-separated; first line defines category labels) |
tree |
a list that defines which categories belong to the same
multinomial distribution (i.e., the the same MPT tree). For instance:
|
source |
whether to test for |
rep |
number of permutations to be sampled |
nCPU |
number of CPUs used for parallel Monte Carlo sampling of permutations |
Details
If an item/person has zero frequencies on all categories in an MPT tree, these zeros are neglected when computing mean frequencies per column. As an example, consider a simple recognition test with a fixed assignments of words to the learn/test list. In such an experiment, all learned words will result in hits or misses (i.e., the MPT tree of old items), whereas new words are always false alarms/correct rejections and thus belong to the MPT tree of new items (this is not necessarily the case if words are assigned randomly).
Note that the test does still assume independence of observations. However,
it does not require item homogeneity when testing participant heterogeneity
(in contrast to the chi-square test: testHetChi
).
Author(s)
Daniel W. Heck
References
Smith, J. B., & Batchelder, W. H. (2008). Assessing individual differences in categorical data. Psychonomic Bulletin & Review, 15, 713-731. doi:10.3758/PBR.15.4.713
See Also
Examples
# generate homogeneous data
# (N=15 participants, M=30 items)
data <- data.frame(
id = rep(1:15, each = 30),
item = rep(1:30, 15)
)
data$cat <- sample(c("h", "cr", "m", "fa"), 15 * 30,
replace = TRUE,
prob = c(.7, .3, .4, .6)
)
head(data)
tree <- list(
old = c("h", "m"),
new = c("fa", "cr")
)
# test participant homogeneity:
tmp <- testHetPerm(data, tree, rep = 200, nCPU = 1)
tmp[2:3]