Learn R Programming

TAM (version 1.995-0)

data.geiser: Dataset from Geiser et al. (2006)

Description

This is a subsample of the dataset used in Geiser et al. (2006) and Geiser and Eid (2010).

Usage

data(data.geiser)

Arguments

Format

A data frame with 519 observations on the following 24 variables 'data.frame': 519 obs. of 24 variables: $ mrt1 : num 0 0 0 0 0 0 0 0 0 0 ... $ mrt2 : num 0 0 0 0 0 0 0 0 0 0 ... $ mrt3 : num 0 0 0 0 0 0 0 0 1 0 ... $ mrt4 : num 0 0 0 0 0 1 0 0 0 0 ... [...] $ mrt23: num 0 0 0 0 0 0 0 1 0 0 ... $ mrt24: num 0 0 0 0 0 0 0 0 0 0 ...

References

Geiser, C., & Eid, M. (2010). Item-Response-Theorie. In C. Wolf & H. Best (Hrsg.). Handbuch der sozialwissenschaftlichen Datenanalyse (S. 311-332). VS Verlag fuer Sozialwissenschaften. Geiser, C., Lehmann, W., & Eid, M. (2006). Separating rotators from nonrotators in the mental rotations test: A multigroup latent class analysis. Multivariate Behavioral Research, 41(3), 261-293.

Examples

Run this code
## Not run: 	
# #############################################################################
# # EXAMPLE 1: Latent trait and latent class models (Geiser et al., 2006, MBR)
# #############################################################################
# 
# data(data.geiser)
# dat <- data.geiser
# 
# #**********************************************
# # Model 1: Rasch model
# tammodel <- "
#   LAVAAN MODEL:
#     F =~ 1*mrt1__mrt12
#     F ~~ F
#   ITEM TYPE:
#     ALL(Rasch)
#     "
# mod1 <- tamaan( tammodel , dat)    
# summary(mod1)
# 
# #**********************************************
# # Model 2: 2PL model
# tammodel <- "
#   LAVAAN MODEL:
#     F =~ mrt1__mrt12
#     F ~~ 1*F
#     "
# mod2 <- tamaan( tammodel , dat)    
# summary(mod2)
# 
# # model comparison Rasch vs. 2PL
# anova(mod1,mod2)
# 
# #*********************************************************************
# #*** Model 3: Latent class analysis with four classes  
# 
# tammodel <- "
# ANALYSIS:
#   TYPE=LCA;
#   NCLASSES(4);   # 4 classes
#   NSTARTS(10,20); # 10 random starts with 20 iterations
# LAVAAN MODEL:
#   F =~ mrt1__mrt12
#     "    
# mod3 <- tamaan( tammodel , resp=dat  )
# summary(mod3)
# 
# # extract item response functions
# imod2 <- IRT.irfprob(mod3)[,2,]
# # plot class specific probabilities
# matplot( imod2 , type="o" , pch=1:4 , xlab="Item" , ylab="Probability" )
# legend( 10 ,1 , paste0("Class",1:4) , lty=1:4 , col=1:4 , pch=1:4 )
# 
# #*********************************************************************
# #*** Model 4: Latent class analysis with five classes  
# 
# tammodel <- "
# ANALYSIS:
#   TYPE=LCA;
#   NCLASSES(5); 
#   NSTARTS(10,20);
# LAVAAN MODEL:
#   F =~ mrt1__mrt12
#     "    
# mod4 <- tamaan( tammodel , resp=dat )
# summary(mod4)
# 
# # compare different models
# AIC(mod1); AIC(mod2); AIC(mod3); AIC(mod4)
# BIC(mod1); BIC(mod2); BIC(mod3); BIC(mod4)
# # more condensed form
# IRT.compareModels(mod1, mod2, mod3, mod4)
# 
# #############################################################################
# # EXAMPLE 2: Rasch model and mixture Rasch model (Geiser & Eid, 2010)
# #############################################################################
# 
# data(data.geiser)
# dat <- data.geiser
# 
# #*********************************************************************
# #*** Model 1: Rasch model
# tammodel <- "
# LAVAAN MODEL:
#   F =~ mrt1__mrt6
#   F ~~ F
# ITEM TYPE:
#   ALL(Rasch);
#     "    
# mod1 <- tamaan( tammodel , resp=dat  )
# summary(mod1)
# 
# #*********************************************************************
# #*** Model 2: Mixed Rasch model with two classes
# tammodel <- "
# ANALYSIS:
#   TYPE=MIXTURE ;
#   NCLASSES(2);
#   NSTARTS(20,25);
# LAVAAN MODEL:
#   F =~ mrt1__mrt6
#   F ~~ F
# ITEM TYPE:
#   ALL(Rasch);
#     "    
# mod2 <- tamaan( tammodel , resp=dat  )
# summary(mod2)
# 
# # plot item parameters
# ipars <- mod2$itempartable_MIXTURE[ 1:6 , ]
# plot( 1:6 , ipars[,3] , type="o" , ylim=c(-3,2) , pch=16 ,
#         xlab="Item" , ylab="Item difficulty")
# lines( 1:6 , ipars[,4] , type="l", col=2 , lty=2)
# points( 1:6 , ipars[,4] ,  col=2 , pch=2)
# 
# #*********************************************************************
# #*** Model 3: Mixed Rasch model with three classes
# tammodel <- "
# ANALYSIS:
#   TYPE=MIXTURE ;
#   NCLASSES(3);
#   NSTARTS(20,25);
# LAVAAN MODEL:
#   F =~ mrt1__mrt6
#   F ~~ F
# ITEM TYPE:
#   ALL(Rasch);
#     "    
# mod3 <- tamaan( tammodel , resp=dat  )
# summary(mod3)
# 
# # plot item parameters
# ipars <- mod3$itempartable_MIXTURE[ 1:6 , ]
# plot( 1:6 , ipars[,3] , type="o" , ylim=c(-3.7,2) , pch=16 ,
#         xlab="Item" , ylab="Item difficulty")
# lines( 1:6 , ipars[,4] , type="l", col=2 , lty=2)
# points( 1:6 , ipars[,4] ,  col=2 , pch=2)
# lines( 1:6 , ipars[,5] , type="l", col=3 , lty=3)
# points( 1:6 , ipars[,5] ,  col=3 , pch=17)
# 
# # model comparison
# IRT.compareModels( mod1 , mod2 , mod3 )
# ## End(Not run)

Run the code above in your browser using DataLab