BEMM.4PL: Calibrating 4PL model via Bayesian...

View source: R/BEMM.4PL.R

BEMM.4PLR Documentation

Calibrating 4PL model via Bayesian Expectation-Maximization-Maximization (BEMM) algorithm.

Description

This function can estimate the item parameters of the 4PL model via Bayesian Expectation-Maximization-Maximization (BEMM) algorithm proposed by Zhang, Guo, & Zheng (2018, April). Both Bayesan modal estimates and maximum likelihood estimates are available. In addition, the examinees' ability and a few model fits information can be also obtained through this function.

Usage

BEMM.4PL(data, PriorA = c(0, 0.25), PriorB = c(0, 4), PriorC = c(4, 16), 
	PriorS = c(4, 16), InitialA = NA, InitialB = NA, InitialC = NA, 
	InitialS = NA, Tol = 0.0001, max.ECycle = 2000L, max.MCycle = 100L, 
	n.decimal = 3L, n.Quadpts = 31L, Theta.lim = c(-6, 6), 
	Missing = -9, ParConstraint = FALSE, BiasSE=FALSE)

Arguments

data

A matrix or data.frame consists of dichotomous data (1 for correct and 0 for wrong response), with missing data coded as in Missing (by default, Missing=-9). Each row of data represents a examinne' responses, and each column represents an item.

PriorA

The user specified logarithmic normal distribution prior for item discrimation (a) parameters in the 3PL and 4PL models. Can be:

  • A numeric with two hyperparameters mean and variance of logarithmic normal distribution for all a parameters. By default, PriorA=c(0,0.25), which means a log normal prior of mean=0 and variance=0.25 will be used for all item discrimation parameters.

  • A NA, refers to no priors will be used, so maximum likelihood estimates for item discrimation parameter will be obtained.

  • A matrix with two columns, and each row of matrix consists of two hyperparameters of log normal prior (mean and variance) for single item a parameter.

PriorB

The user specified normal distribution prior for item difficulty (b) parameters in the 3PL and 4PL models. Can be:

  • A numeric with two hyperparameters mean and variance of normal distribution for all b parameters. By default, PriorB=c(0,4), which means a normal prior of mean=0 and variance=4 will be used for all item difficulty parameters.

  • A NA, refers to no priors will be used, so maximum likelihood estimates for item difficulty parameter will be obtained.

  • A matrix with two columns, and each row of matrix consists of two hyperparameters of normal prior (mean and variance) for single item b parameter.

PriorC

The user specified Beta(x,y) distribution prior for item guessing (c) parameters in the 3PL and 4PL models. Can be:

  • A numeric with two hyperparameters x and y of Beta distribution for all c parameters. By default, PriorC=c(4,16), which means a Beta prior of mean=4/(4+16)=0.2 and variance=0.008 will be used for all item guessing parameters.

  • A NA, refers to no priors will be used, so maximum likelihood estimates for item guessing parameter will be obtained.

  • A matrix with two columns, and each row of matrix consists of two hyperparameters of Beta prior (x and y) for single item c parameter.

PriorS

The user specified Beta(x,y) distribution prior for item slipping (s) parameters in the 4PL model. Can be:

  • A numeric with two hyperparameters x and y of Beta distribution for all s parameters. By default, PriorS=c(4,16), which means a Beta prior of mean=4/(4+16)=0.2 and variance=0.008 will be used for all item slipping parameters.

  • A NA, refers to no priors will be used, so maximum likelihood estimates for item slipping parameter will be obtained.

  • A matrix with two columns, and each row of matrix consists of two hyperparameters of Beta prior (x and y) for single item s parameter.

InitialA

The user specified starting values for item discrimation (a) parameters in the 3PL and 4PL models. Can be:

  • A NA (default), refers to no specified starting values for a parameter.

  • A single number (numeric), refers to set this number to be the starting values of a for all items.

  • A numeric consists of starting values for each a parameter.

InitialB

The user specified starting values for item difficulty (b) parameters in the 3PL and 4PL models. Can be:

  • A NA (default), refers to no specified starting values for b parameter.

  • A single number (numeric), refers to set this number to be the starting values of b for all items.

  • A numeric consists of starting values for each b parameter.

InitialC

The user specified starting values for item guessing (c) parameters in the 3PL and 4PL models. Can be:

  • A NA (default), refers to no specified starting values for c parameter.

  • A single number (numeric), refers to set this number to be the starting values of c for all items.

  • A numeric consists of starting values for each c parameter.

InitialS

The user specified starting values for item slipping (s) parameters in the 4PL model. Can be:

  • A NA (default), refers to no specified starting values for s parameter.

  • A single number (numeric), refers to set this number to be the starting values of s for all items.

  • A numeric consists of starting values for each s parameter.

Tol

A single number (numeric), refers to convergence threshold for E-step cycles; defaults are 0.0001.

max.ECycle

A single integer, refers to maximum number of E-step cycles; defaults are 2000L.

max.MCycle

A single integer, refers to maximum number of M-step cycles; defaults are 100L.

n.Quadpts

A single integer, refers to number of quadrature points per dimension (must be larger than 5); defaults are 31L.

n.decimal

A single integer, refers to number of decimal places when outputs results.

Theta.lim

A numeric with two number, refers to the range of integration grid for each dimension; default is c(-6, 6).

Missing

A single number (numeric) to indicate which elements are missing; default is -9. The Missing cannot be 0 or 1.

ParConstraint

A logical value to indicate whether estimates parametes in a reasonable range; default is FALSE. If ParConstraint=TRUE: a in [0.001, 6], b in [-6, 6], c in [0.0001, 0.5], s in [0.0001, 0.5].

BiasSE

A logical value to determine whether directly estimating SEs from inversed Hession matrix rather than USEM method, default is FALSE.

Details

Four parameter logistic (4PL) model proposed by Barton & Lord's (1981). Transfer the unslipping (upper asymptote) parameter d to slipping parameter s by set s=1-d:

P(x = 1|\theta, a, b, c, s) = c + (1 - s - c) / (1 + exp(-D * a * (\theta - b))),

where x=1 is the correct response; theta is examinne's ability. a, b, c and s are the item discrimination, difficulty guessing and slipping parameter, respectively; D is the scaling constant 1.702. These parameter labels are capitalized in program for emphasis.

Value

This function will return a list includes following:

Est.ItemPars

A dataframe consists of the estimates of a, b, c and s parameters and corresponding estimated standard errors.

Est.Theta

A dataframe consists of the estimates of theta and corresponding estimated standard errors (EAP method).

Loglikelihood

The loglikelihood.

Iteration

The number of iterations.

EM.Map

The parameter estimation history of iterations.

fits.test

The model fits information includes G2 test, AIC, BIC and RMSEA.

Elapsed.time

The running time of the program.

InitialValues

The initial values of item parameters.

References

Barton, M. A., & Lord, F. M. (1981). An upper asymptote for the three-parameter logistic item response model. ETS Research Report Series, 1981(1), 1-8. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/j.2333-8504.1981.tb01255.x")}

Zhang, C., Guo, S., & Zheng, C. (2018, April). Bayesian Expectation-Maximization-Maximization Algorithm for the 4PLM. Paper presented at the 80th NCME Annual Meeting, New York, NY.

Examples

###Example: A brief simulation study###

#generate true values and response matrix
set.seed(10)
library(IRTBEMM)
I=500    #set the number of examinees is 500
J=10      #set the number of items is 10
true.a=runif(J,0.4,2)     #simulate true discrimination parameters
true.b=rnorm(J,0,1)       #simulate true difficulty parameters
true.c=rbeta(J,2,8)       #simulate true guessing parameters
true.s=rbeta(J,2,8)       #simulate true slipping parameters
true.th=rnorm(I,0,1)      #simulate true theta parameters
true.par=list(A=true.a, B=true.b, C=true.c, S=true.s)   #make a list
response=matrix(NA,I,J)       #Create a array to save response data
for (i in 1:I){
  #calucate the probability of 4PL
  P=Prob.model(X=true.th[i], Model='4PL', Par.est0=true.par, D=1.702)  
  response[i,]=rbinom(J,1,P)   #simulate the response
}

#To save example running time, we set the Tol to 0.1
#Obtain the Bayesian modal estimation (BME) using default priors

#Estimate model via BEMM algorithm
bme.res=BEMM.4PL(response, Tol=0.1) 

bme.res$Est.ItemPars       #show item estimates
bme.res$Est.Theta          #show ability estimates
bme.res$Loglikelihood      #show log-likelihood
bme.res$EM.Map             #show EM iteration history
bme.res$fits.test 		   #show model fits information


#Obtain the maximum likelihood estimation (MLE) by setting Prior=NA

#Estimate model via EMM algorithm
mle.res=BEMM.4PL(response, Tol=0.1,
		PriorA=NA, PriorB=NA, PriorC=NA, PriorS=NA)

mle.res$Est.ItemPars       #show item estimates
mle.res$Est.Theta          #show ability estimates
mle.res$Loglikelihood      #show log-likelihood
mle.res$EM.Map             #show EM iteration history
mle.res$fits.test 		   #show model fits information



IRTBEMM documentation built on June 7, 2023, 6:08 p.m.