ScoreDCM: Score dichotomous response data using DCM and MCMC

Description Usage Arguments Value Author(s) Examples

View source: R/dcm_mcmc_scorer.R

Description

Given dichotomous response data, a Q-matrix (relation between items and attributes) and calibrated item and structural parameters ScoreDCM estimates posterior probabilities of attribute profiles of respondents using a Diagnostic Classification Model (DCM) and Markov Chain Monte Carlo (MCMC) method. The estimation procedure uses the loglinear cognitive diagnostic modeling (LDCM) framework that allows for the estimation of a host of DCMs such as DCM, DINA, C-RUM, NIDO, NIDA, NC-RUM etc.

Usage

1
2
3
ScoreDCM(observations, qmatrix, parameter.means, parameter.acov= NULL,
parameterization.method = "Mplus", is.kernel.parameters = FALSE, model.type = NULL,
nreps = 1000 , nchains = 1, initial.class = 1,  percent.reps.to.discard = 5)

Arguments

observations

a data frame or matrix of dichotomous responses in wide format (nobservations X nitems)

qmatrix

a data frame or matrix of 1s and 0s indicating relation between items and attributes. This matrix specifies which items are required for mastery of each attribute (i.e., latent variable). The matrix must be a size of nitems X nattributes

parameter.means

a numerical vector of calibrated item and structural parameters. Values must be in the order of GetParameterNames if parametrization method is Mplus and non-kernel parameters are used. If kernel parameters values are used must be in order of GetKernelParameterNames

parameter.acov

optional matrix of covariances of all model parameters. If NULL (the default) model parameters are not randomized for each iteration of MCMC

parameterization.method

optional character string of parameterization method used to calibrate parameters. If not specified then the default will be set to Mplus

is.kernel.parameters

If FALSE (the default), parameter values are of type taus and nus else they are of type kernel parameters, i.e., lambdas and gammas

model.type

If is.kernel.parameter is TRUE, model type must be one of DCM, DINA, CRUM, DINO, NIDO, NCRUM. Kernel parameters are different for each model type

nreps

The number of iterations in MCMC per chain. If not specified the default is 1000

nchains

The number of chains in MCMC. If not specified the default is 1

initial.class

The initial value of the attribute profile for each respondent. If not specified the default is 1

percent.reps.to.discard

The percent of iterations to be discarded. If not specifed then the default is 5

Value

ScoreDCM returns an object of class dcm.scorer.class; a list consisting of

inputs

a list of all input arguments to the funciton like observations, Q-matrix, parameter.means, etc.

mcmc.inputs

a list of all mcmc inputs

results

an object of all.results.class class; a list consisting of

attribute.profile.result

an object of attribute.profile.class

attribute.result

an object of attribute.class

parameter.result

an object of parameter.class

mcmc.outputs

a list of all mcmc output

The function summary is used to obtain and print a summary of MCMC runs in the form of probabilities of mastering each attribute and attribute profile probabilities. The function plot is used to plot the aggregated mean of both attribute mastery (type = "attr.means") and attribute profile probabily (type = "attr.profile.means") across all respondents. Other plot options include attribute mastery (type = "attr.profiles") and attribute profile probabilities (type = "attr.profile.profiles") of individual respondents.

Author(s)

Margi Dubal margidubal@gmail.com & Diane Losardo dlosardo@amplify.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

data(obervations.test)
data(qmatrix.test)
parameter.names <- GetParameterNames(qmatrix.test, ncol(qmatrix.test))
parameter.names
data(parameter.means.DCM.Mplus.test)
obj <- ScoreDCM(observations = observations.test, qmatrix = qmatrix.test
, parameter.means = parameter.means.DCM.Mplus.test)
summary(obj)
plot(obj)

## End(Not run)

dcmr documentation built on May 29, 2017, 10:41 p.m.

Related to ScoreDCM in dcmr...