Last data update: 2014.03.03

R: Maximum likelihood estimation of item parameters for...
ParMLER Documentation

Maximum likelihood estimation of item parameters for cognitive diagnostic models.

Description

This function returns maximum likelihood estimates of item parameters for cognitive diagnostic models when examinee ability patterns are known. This function can either be used independently or called in the JMLE function. Currently supported cognitive diagnostic models include the DINA model, the DINO model, the NIDA model, the G-NIDA model, and the R-RUM model.

Usage

ParMLE(Y, Q, alpha, model = c("DINA", "DINO", "NIDA", "GNIDA", "RRUM"))

Arguments

Y

A matrix of binary responses. Rows represent persons and columns represent items. 1=correct, 0=incorrect.

Q

The Q-matrix of the test. Rows represent items and columns represent attributes. 1=attribute required by the item, 0=attribute not required by the item.

alpha

Examinee attribute profiles. Rows represent persons and columns represent attributes. 1=examinee masters the attribute, 0=examinee does not master the attribute.

model

Currently support five models: "DINA", "DINO", "NIDA", "GNIDA", and "RRUM". The default is "DINA".

Value

For the DINA, DINO, and NIDA models:

slip

a vector of slip parameters.

guess

a vector of guessing parameters.

se.slip

a vector of the standard errors for slip parameters.

se.guess

a vector of the standard errors for guessing parameters.

For the G-NIDA model:

slip

a matrix (# items by # attributes) of slip parameters.

guess

a matrix (# items by # attributes) of guessing parameters.

se.slip

a matrix (# items by # attributes) of the standard errors for slip parameters.

se.guess

a matrix (# items by # attributes) of the standard errors for guessing parameters.

For the R-RUM model:

pi

a vector of pi parameters for each item.

r

a matrix (# items by # attributes) of r parameters.

se.pi

a vector of the standard errors for pi parameters.

se.r

a matrix (# items by # attributes) of the standard errors for r parameters.

Note that for the G-NIDA model and the R-RUM model, the item parameter estimates and standard errors are not available for the entries where the Q-matrix is 0.

Additionally, for all models:

model

The chosen model.

Q

The Q-matrix of the test.

See Also

JMLE, print.ParMLE

Examples

# Generate item and examinee profiles

natt <- 3
nitem <- 4
nperson <- 5
Q <- rbind(c(1, 0, 0), c(0, 1, 0), c(0, 0, 1), c(1, 1, 1))
alpha <- rbind(c(0, 0, 0), c(1, 0, 0), c(0, 1, 0), c(0, 0, 1), c(1, 1, 1))

# Generate DINA model-based response data

slip <- c(0.1, 0.15, 0.2, 0.25)
guess <- c(0.1, 0.15, 0.2, 0.25)
my.par <- list(slip=slip, guess=guess)

data <- matrix(NA, nperson, nitem)
eta <- matrix(NA, nperson, nitem)

for (i in 1:nperson) {
  for (j in 1:nitem) {
  eta[i, j] <- prod(alpha[i,] ^ Q[j, ])
  P <- (1 - slip[j]) ^ eta[i, j] * guess[j] ^ (1 - eta[i, j])
  u <- runif(1)
  data[i, j] <- as.numeric(u < P)
  }
}

# Using the function to estimate item parameters

parMLE.result <- ParMLE(data, Q, alpha, model="DINA")
print(parMLE.result)  # Print the estimated item parameters and standard errors
ItemFit(parMLE.result)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(NPCD)
Loading required package: BB
Loading required package: R.oo
Loading required package: R.methodsS3
R.methodsS3 v1.7.1 (2016-02-15) successfully loaded. See ?R.methodsS3 for help.
R.oo v1.20.0 (2016-02-17) successfully loaded. See ?R.oo for help.

Attaching package: 'R.oo'

The following objects are masked from 'package:methods':

    getClasses, getMethods

The following objects are masked from 'package:base':

    attach, detach, gc, load, save

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/NPCD/ParMLE.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ParMLE
> ### Title: Maximum likelihood estimation of item parameters for cognitive
> ###   diagnostic models.
> ### Aliases: ParMLE
> 
> ### ** Examples
> 
> # Generate item and examinee profiles
> 
> natt <- 3
> nitem <- 4
> nperson <- 5
> Q <- rbind(c(1, 0, 0), c(0, 1, 0), c(0, 0, 1), c(1, 1, 1))
> alpha <- rbind(c(0, 0, 0), c(1, 0, 0), c(0, 1, 0), c(0, 0, 1), c(1, 1, 1))
> 
> # Generate DINA model-based response data
> 
> slip <- c(0.1, 0.15, 0.2, 0.25)
> guess <- c(0.1, 0.15, 0.2, 0.25)
> my.par <- list(slip=slip, guess=guess)
> 
> data <- matrix(NA, nperson, nitem)
> eta <- matrix(NA, nperson, nitem)
> 
> for (i in 1:nperson) {
+   for (j in 1:nitem) {
+   eta[i, j] <- prod(alpha[i,] ^ Q[j, ])
+   P <- (1 - slip[j]) ^ eta[i, j] * guess[j] ^ (1 - eta[i, j])
+   u <- runif(1)
+   data[i, j] <- as.numeric(u < P)
+   }
+ }
> 
> # Using the function to estimate item parameters
> 
> parMLE.result <- ParMLE(data, Q, alpha, model="DINA")
> print(parMLE.result)  # Print the estimated item parameters and standard errors
The Estimated Item Parameters
Model: DINA 
Method: conditional MLE
       slip   SE.slip     guess  SE.guess
Item 1  0.0 0.0000000 0.3333333 0.2721655
Item 2  0.0 0.0000000 0.0000000 0.0000000
Item 3  0.5 0.3535534 0.3333333 0.2721655
Item 4  0.0 0.0000000 0.2500000 0.2165064
> ItemFit(parMLE.result)
       RMSEA Chisq Chisq p-value Chisq df
Item 1   NaN   NaN           NaN        6
Item 2   NaN   NaN           NaN        6
Item 3   NaN   NaN           NaN        6
Item 4   NaN   NaN           NaN        6
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>