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

IRT.marginal_posterior

S3 Method for Computation of Marginal Posterior Distribution


Description

Computes marginal posterior distributions for fitted models in the CDM package.

Usage

IRT.marginal_posterior(object, dim, remove_zeroprobs=TRUE, ...)

## S3 method for class 'din'
IRT.marginal_posterior(object, dim, remove_zeroprobs=TRUE, ...)
## S3 method for class 'gdina'
IRT.marginal_posterior(object, dim, remove_zeroprobs=TRUE, ...)
## S3 method for class 'mcdina'
IRT.marginal_posterior(object, dim, remove_zeroprobs=TRUE, ...)

Arguments

object

Object of class din, gdina, mcdina

dim

Numeric or character vector indicating dimensions of posterior distribution which should be marginalized

remove_zeroprobs

Logical indicating whether classes with zero probabilities should be removed

...

Further arguments to be passed

Value

List with entries

marg_post

Marginal posterior distribution

map

MAP estimate (individual classification)

theta

Skill classes

See Also

Examples

## Not run: 
#############################################################################
# EXAMPLE 1: Dataset with three hierarchical skills
#############################################################################

# simulated data with hierarchical skills:
# skill A with 4 levels, skill B with 2 levels and skill C with 3 levels

data(data.cdm10, package="CDM"")
dat <- data.cdm10$data
Q <- data.cdm10$q.matrix
print(Q)

# define hierarchical skill structure
B <- "A1 > A2 > A3
      C1 > C2"
skill_space <- CDM::skillspace.hierarchy(B=B, skill.names=colnames(Q))
zeroprob.skillclasses <- skill_space$zeroprob.skillclasses

# estimate DINA model
mod1 <- CDM::gdina( dat, q.matrix=Q, zeroprob.skillclasses=zeroprob.skillclasses, rule="DINA")
summary(mod1)

# classification for skill A
res <- CDM::IRT.marginal_posterior(object=mod1, dim=c("A1","A2","A3") )
table(res$map)

# classification for skill B
res <- CDM::IRT.marginal_posterior(object=mod1, dim=c("B") )
table(res$map)

# classification for skill C
res <- CDM::IRT.marginal_posterior(object=mod1, dim=c("C1","C2") )
table(res$map)

## 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.