gpcm-methods {plink} | R Documentation |
This function computes the probability of responding in a specific category for one or more items for a given set of theta values using the partial credit model or the generalized partial credit model, depending on the included item parameters.
gpcm(x, cat, theta = seq(-4,4,0.05), D = 1.7, location = FALSE, print.mod = FALSE, ...) ## S4 method for signature 'matrix', 'numeric' gpcm(x, cat, theta, D, location, print.mod, ...) ## S4 method for signature 'data.frame', 'numeric' gpcm(x, cat, theta, D, location, print.mod, ...) ## S4 method for signature 'list', 'numeric' gpcm(x, cat, theta, D, location, print.mod, ...) ## S4 method for signature 'irt.pars', 'ANY' gpcm(x, cat, theta, D, location, print.mod, ...) ## S4 method for signature 'sep.pars', 'ANY' gpcm(x, cat, theta, D, location, print.mod, ...)
x |
an R object containing item parameters |
cat |
vector identifying the number of response categories (not the number of step parameters) for each item. |
theta |
vector of theta values for which probabilities will be computed.
If theta is not specified, an equal interval range of values from -4 to 4 is used
with an increment of 0.05 |
D |
scaling constant (for the normal metric D = 1.7, for the logistic metric D = 1) |
location |
if TRUE , the step parameters are deviations from a difficulty
parameter |
print.mod |
if TRUE , print the model that was used (i.e. Partial Credit
Model or Generalized Partial Credit Model) |
... |
further arguments passed to or from other methods |
Returns an object of class irt.prob
location
argument should be
equal to TRUE
. If a column is included for the discrimination parameters,
the location parameters should be in the second column; otherwise, they should be
in the first column. The columns for the step/step deviation parameters will always
follow the discrimination and/or location columns (or they may potententially
start in the first column).
The number of step/step deviation parameters can vary for each item. In these
instances, all cells with missing values should be filled with NA
s. For
example, for the generalized partial credit model with no location parameter, if
one item has five categories (four step parameters) and another item has three
categories (two step parameters), there should be five columns. The first column
includes the discrimination parameters and columns 2-5 include the step parameters.
The values in the last two columns for the item with three categories should be NA
.
location
should equal TRUE
and the location
parameters should be in the first column. The number of step/step deviation parameters
can vary for each item. In these instances, all cells with missing values should be
filled with NA
s (See the example in the method for x = "matrix"). "irt.pars"
. If x
contains
dichotomous items or items associated with another polytomous model, a warning
will be displayed stating that probabilities will be computed for the gpcm items only.
If x
contains parameters for multiple groups, a list of "irt.prob"
objects
will be returned.sep.pars
. If x
contains
dichotomous items or items associated with another polytomous model, a warning will be
displayed stating that probabilities will be computed for the gpcm items only.
The determination of the model (partial credit or generalized partial credit) is based on
the number of non-NA columns for each item in x
and the corresponding values in
cat
.
Jonathan P. Weeks weeksjp@gmail.com
Embretson, S. E., & Reise, S. P. (2000) Item Response Theory for Psychologists. Mahwah, New Jersey: Lawrence Erlbaum Associates
Masters, G. N. (1982) A rasch model for partial credit scoring. Psychometrika, 47, 149-174.
Masters, G. N. & Wright, B. D. (1996) The partial credit model. In W. J. van der Linden & Hambleton, R. K. (Eds.) Handbook of Modern Item Response Theory (pp. 101-121). New York: Springer-Verlag
Muraki, E. (1992) A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16, 159-176.
Muraki, E. (1996) A generalized partial credit model. In W. J. van der Linden & Hambleton, R. K. (Eds.) Handbook of Modern Item Response Theory (pp. 153-164). New York: Springer-Verlag
mixed:
compute probabilities for mixed-format items
plot:
plot item characteristic/category curves
irt.prob
, irt.pars
, sep.pars:
classes
## Partial Credit Model ## Item parameters from Embretson & Reise (2000, p. 108) item 5 b <- t(c(-2.519,-.063,.17,2.055)) x <- gpcm(b,5) plot(x) ## Generalized Partial Credit Model ## Item parameters from Embretson & Reise (2000, p. 112) items 5-7 a <- c(.683,1.073,.583) b <- matrix(c(-3.513,-.041,.182,NA,-.873,.358,-.226,1.547,-4.493,-.004,NA,NA),3,4,byrow=TRUE) pars <- cbind(a,b) # Does not include a location parameter rownames(pars) <- paste("Item",5:7,sep="") colnames(pars) <- c("a",paste("b",1:4,sep="")) cat <- c(4,5,3) x <- gpcm(pars,cat,seq(-3,3,.05)) plot(x) ## Item parameters from Muraki (1992, p. 154) a <- c(1,.5) b <- matrix(c(.25,-1.75,1.75,.75,-1.25,1.25),2,3,byrow=TRUE) pars <- cbind(a,b) # Include a location parameter rownames(pars) <- paste("Item",1:2,sep="") colnames(pars) <- c("a","b",paste("d",1:2,sep="")) cat <- c(3,3) x <- gpcm(pars,cat,location=TRUE,print.mod=TRUE) # Plot category curves for two items matplot(seq(-4,4,.05),x@prob[,2:4],xlab="Theta",ylab="Probability",ylim=c(0,1),lty=1, type="l",col="black") par(new=TRUE) matplot(seq(-4,4,.05),x@prob[,5:7],xlab="Theta",ylab="Probability",ylim=c(0,1),lty=3, type="l",col="black")