Learn R Programming

CDM (version 7.4-19)

skillspace.hierarchy: Creation of a Hierarchical Skill Space

Description

The function skillspace.hierarchy defines a reduced skill space for hierarchies in skills (see e.g. Leighton, Gierl, & Hunka, 2004). The function skillspace.full defines a full skill space for dichotomous skills.

Usage

skillspace.hierarchy(B, skill.names)

skillspace.full(skill.names)

Arguments

B

A matrix or a string containing restrictions of the hierarchy. If B is a \(K \times K\) matrix containing where \(K\) denotes the number of skills, then B[ii,jj]=1 means that if an examinee mastered skill jj, then he or she should also master skill ii.

Alternatively, a string can be also conveniently used for defining a hierarchy (see Examples).

skill.names

Vector of names in skills

Value

A list with following entries

R

Reachability matrix

skillspace.reduced

Reduced skill space fulfilling the specified hierarchy

skillspace.complete

Complete skill space

zeroprob.skillclasses

Indices of skill patterns in skillspace.complete which were removed for defining skillspace.reduced

Details

The reduced skill space output can be used as an argument in din or gdina to directly test for a hierarchy in attributes.

References

Leighton, J. P., Gierl, M. J., & Hunka, S. M. (2004). The attribute hierarchy method for cognitive assessment: A variation on Tatsuoka's rule space approach. Journal of Educational Measurement, 41, 205-237.

See Also

See din (Example 6) for an application of skillspace.hierarchy for model comparisons.

See the GDINA::att.structure function in the GDINA package for similar functionality.

Examples

Run this code
# NOT RUN {
#############################################################################
# EXAMPLE 1: Toy example with 3 skills
#############################################################################

K <- 3 # number of skills
skill.names <- paste0("A", 1:K )  # names of skills

# create a zero matrix for hierarchy definition
B0 <- 0*diag(K)
rownames(B0) <- colnames(B0) <- skill.names

#*** Model 1: A1 > A2 > A3
B <- B0
B[1,2] <- 1     # A1 > A2
B[2,3] <- 1     # A2 > A3

sp1 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp1$skillspace.reduced
  ##     A1 A2 A3
  ##   1  0  0  0
  ##   2  1  0  0
  ##   4  1  1  0
  ##   8  1  1  1

#*** Model 2:  A1 > A2 and A1 > A3
B <- B0
B[1,2] <- 1     # A1 > A2
B[1,3] <- 1     # A1 > A3

sp2 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp2$skillspace.reduced
  ##     A1 A2 A3
  ##   1  0  0  0
  ##   2  1  0  0
  ##   4  1  1  0
  ##   6  1  0  1
  ##   8  1  1  1

#*** Model 3: A1 > A3, A2 is not included in a hierarchical way
B <- B0
B[1,3] <- 1     # A1 > A3

sp3 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp3$skillspace.reduced
  ##     A1 A2 A3
  ##   1  0  0  0
  ##   2  1  0  0
  ##   3  0  1  0
  ##   4  1  1  0
  ##   6  1  0  1
  ##   8  1  1  1

#~~~ Hierarchy specification using strings

#*** Model 1: A1 > A2 > A3
B <- "A1 > A2
      A2 > A3"
sp1 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp1$skillspace.reduced

# Model 1 can be also written in one line for B
B <- "A1 > A2 > A3"
sp1b <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp1b$skillspace.reduced

#*** Model 2:  A1 > A2 and A1 > A3
B <- "A1 > A2
      A1 > A3"
sp2 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp2$skillspace.reduced

#*** Model 3: A1 > A3
B <- "A1 > A3"
sp3 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp3$skillspace.reduced

# }
# NOT RUN {
#############################################################################
# EXAMPLE 2: Examples from Leighton et al. (2004): Fig. 1 (p. 210)
#############################################################################

skill.names <- paste0("A",1:6) # 6 skills

#*** Model 1: Linear hierarchy (A)
B <- "A1 > A2 > A3 > A4 > A5 > A6"
sp1 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp1$skillspace.reduced

#*** Model 2: Convergent hierarchy (B)
B <- "A1 > A2 > A3
      A2 > A4
      A3 > A5 > A6
      A4 > A5 > A6"
sp2 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp2$skillspace.reduced

#*** Model 3: Divergent hierarchy (C)
B <- "A1 > A2 > A3
      A1 > A4 > A5
      A1 > A4 > A6"
sp3 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp3$skillspace.reduced

#*** Model 4: Unstructured hierarchy (D)
B <- "A1 > A2 \n A1 > A3 \n A1 > A4 \n A1 > A5 \n A1 > A6"
# This specification of B is equivalent to writing separate lines:
# B <- "A1 > A2
#       A1 > A3
#       A1 > A4
#       A1 > A5
#       A1 > A6"
sp4 <- CDM::skillspace.hierarchy( B=B, skill.names=skill.names )
sp4$skillspace.reduced
# }

Run the code above in your browser using DataLab