data.janssen {TAM}R Documentation

Dataset from Janssen and Geiser (2010)

Description

Dataset used in Janssen and Geiser (2010).

Usage

data(data.janssen)
data(data.janssen2)

Format

References

Janssen, A. B., & Geiser, C. (2010). On the relationship between solution strategies in two mental rotation tasks. Learning and Individual Differences, 20(5), 473-478. doi:10.1016/j.lindif.2010.03.002

Examples

## Not run: 
#############################################################################
# EXAMPLE 1: CCT data, Janssen and Geiser (2010, LID)
#            Latent class analysis based on data.janssen
#############################################################################

data(data.janssen)
dat <- data.janssen
colnames(dat)
  ##   [1] "PIS1"  "PIS3"  "PIS4"  "PIS5"  "SCR6"  "SCR9"  "SCR10" "SCR17"

#*********************************************************************
#*** Model 1: Latent class analysis with two classes

tammodel <- "
ANALYSIS:
  TYPE=LCA;
  NCLASSES(2);
  NSTARTS(10,20);
LAVAAN MODEL:
  # missing item numbers (e.g. PIS2) are ignored in the model
  F=~ PIS1__PIS5 + SCR6__SCR17
    "
mod3 <- TAM::tamaan( tammodel, resp=dat  )
summary(mod3)

# extract item response functions
imod2 <- IRT.irfprob(mod3)[,2,]
# plot class specific probabilities
ncl <- 2
matplot( imod2, type="o", pch=1:ncl, xlab="Item", ylab="Probability" )
legend( 1, .3, paste0("Class",1:ncl), lty=1:ncl, col=1:ncl, pch=1:ncl )

#*********************************************************************
#*** Model 2: Latent class analysis with three classes

tammodel <- "
ANALYSIS:
  TYPE=LCA;
  NCLASSES(3);
  NSTARTS(10,20);
LAVAAN MODEL:
  F=~ PIS1__PIS5 + SCR6__SCR17
    "
mod3 <- TAM::tamaan( tammodel, resp=dat  )
summary(mod3)

# extract item response functions
imod2 <- IRT.irfprob(mod3)[,2,]
# plot class specific probabilities
ncl <- 3
matplot( imod2, type="o", pch=1:ncl, xlab="Item", ylab="Probability" )
legend( 1, .3, paste0("Class",1:ncl), lty=1:ncl, col=1:ncl, pch=1:ncl )

# compare models
AIC(mod1); AIC(mod2)

## End(Not run)

[Package TAM version 4.2-21 Index]