commonItems {eatTools} | R Documentation |
This function identifies sets of items that have been administered to two groups of persons.
commonItems(dat, group.var, na = NA, uncommon = FALSE, simplify = TRUE)
dat |
A data frame with item responses and a grouping variable. |
group.var |
Name or column number of the group variable in |
na |
A character string indicating which value should be considered as not administered (missing by design) |
uncommon |
if |
simplify |
if |
dat
must only contain the group variable and the items, if further variables
are in dat
they are treated as items. If group.var
specifies more than two groups,
pairwise group comparisons are performed.
returns a list of all group.var
combinations with character vectors of common item names.
If uncommon=TRUE
a vector of uncommon (unique) items of each group is additionally returned.
The names of list elements are the two group names concatenated by "|".
Martin Hecht
data(science1) d <- science1[ , c("version", science1.items)] # common items are listed for each combination of groups str(commonItems(dat = d, group.var = "version", na = "mbd")) # uncommon items are returned as well str(commonItems(dat = d, group.var = "version", na = "mbd", uncommon = TRUE))