commonItems: Identify Common Items for Several Groups

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function identifies sets of items that have been administered to two groups of persons.

Usage

1
commonItems(dat, group.var, na = NA, uncommon = FALSE, simplify = TRUE)

Arguments

dat

A data frame with item responses and a grouping variable.

group.var

Name or column number of the group variable in dat

na

A character string indicating which value should be considered as not administered (missing by design)

uncommon

if TRUE a vector of items that have only been administered to one of the two groups is additionally returned.

simplify

if TRUE a character vector is returned (only in case of 2 groups and uncommon=FALSE)

Details

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.

Value

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 "|".

Author(s)

Martin Hecht

See Also

commonItems.percent

Examples

1
2
3
4
5
6
7
8
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))

eatTools documentation built on May 2, 2019, 4:44 p.m.