################################
# TIMSS mathematics data set
data(data.timss)
# extract data
dat <- data.timss$data
dat <- dat[ , substring( colnames(dat),1,1) == "M" ]
# extract iteminformations
iteminfo <- data.timss$item
# estimate Rasch model
mod1 <- rasch.mml2( dat )
# estimate WLEs
wle1 <- wle.rasch( dat , b = mod1$item$b )$theta
# DETECT Content Domains
detect1 <- conf.detect( data = dat , score = wle1 ,
itemcluster = iteminfo$Content.Domain )
## unweighted weighted
## DETECT 0.316 0.316
## ASSI 0.273 0.273
## RATIO 0.355 0.355
# DETECT Cognitive Domains
detect2 <- conf.detect( data = dat , score = wle1 ,
itemcluster = iteminfo$Cognitive.Domain )
## unweighted weighted
## DETECT 0.251 0.251
## ASSI 0.227 0.227
## RATIO 0.282 0.282
# DETECT Itemformat
detect3 <- conf.detect( data = dat , score = wle1 ,
itemcluster = iteminfo$Format )
## unweighted weighted
## DETECT 0.056 0.056
## ASSI 0.060 0.060
## RATIO 0.062 0.062
# DETECT Block
detect4 <- conf.detect( data = dat , score = wle1 ,
itemcluster = iteminfo$Block )
## unweighted weighted
## DETECT 0.301 0.301
## ASSI 0.193 0.193
## RATIO 0.339 0.339
# Exploratory DETECT: Application of a cluster analysis
# employing the Ward method
detect5 <- expl.detect( data = dat , score = wle1 ,
nclusters = 10 , N.est = nrow(dat) )
# Plot Cluster solution
pl <- plot( detect5$clusterfit , main = "Cluster solution" )
rect.hclust(detect5$clusterfit, k=4, border="red")
Run the code above in your browser using DataLab