Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

item_by_group

Create Dataset with Group-Specific Items


Description

Creates a dataset with group-specific items which can be used for multiple group comparisons.

Usage

item_by_group(dat, group, invariant=NULL, rm.empty=TRUE)

Arguments

dat

Dataset with item responses

group

Vector of group identifiers

invariant

Optional vector of variables which should not be made group-specific, i.e. which should be treated as invariant across groups.

rm.empty

Logical indicating whether empty columns should be removed

Value

Extended dataset with item responses

Examples

## Not run: 
#############################################################################
# EXAMPLE 1: Create dataset with group-specific item responses
#############################################################################

data(data.mg, package="CDM")
dat <- data.mg

#-- create dataset with group-specific item responses
dat0 <- CDM::item_by_group( dat=dat[,paste0("I",1:5)], group=dat$group )

#-- summary statistics
summary(dat0)
colnames(dat0)

#-- set some items to invariant
invariant_items <- c("I1","I4")
dat1 <- CDM::item_by_group( dat=dat[,paste0("I",1:5)], group=dat$group,
            invariant=invariant_items)
colnames(dat1)

## End(Not run)

CDM

Cognitive Diagnosis Modeling

v7.5-15
GPL (>= 2)
Authors
Alexander Robitzsch [aut, cre], Thomas Kiefer [aut], Ann Cathrice George [aut], Ali Uenlue [aut]
Initial release
2020-03-10 14:19:21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.