Generalized Partial Credit Model
Common computations and operatoins for the GPCM
model_gpcm_prob(t, a, b, d, D = 1.702, d0 = NULL) model_gpcm_info(t, a, b, d, D = 1.702, d0 = NULL) model_gpcm_lh(u, t, a, b, d, D = 1.702, d0 = NULL, log = FALSE) model_gpcm_gendata(n_p, n_i, n_c, t = NULL, a = NULL, b = NULL, d = NULL, D = 1.702, sort_d = FALSE, t_dist = c(0, 1), a_dist = c(-0.1, 0.2), b_dist = c(0, 0.8), d_dist = c(0, 1), t_bounds = c(-3, 3), a_bounds = c(0.01, 2.5), b_bounds = c(-3, 3), d_bounds = c(-3, 3), missing = NULL, ...) model_gpcm_rescale(t, a, b, d, scale = c("t", "b"), mean = 0, sd = 1) model_gpcm_plot(a, b, d, D = 1.702, d0 = NULL, type = c("prob", "info"), item_level = FALSE, total = FALSE, xaxis = seq(-6, 6, 0.1)) model_gpcm_plot_loglh(u, a, b, d, D = 1.702, d0 = NULL, xaxis = seq(-6, 6, 0.1), verbose = FALSE)
t
: ability parameters, 1d vectora
: discrimination parameters, 1d vectorb
: item location parameters, 1d vectord
: item category parameters, 2d vectorD
: the scaling constant, default=1.702d0
: insert an initial category valueu
: observed scores (starting from 0), 2d matrixlog
: TRUE to return log-likelihoodn_p
: the number of people to be generatedn_i
: the number of items to be generatedn_c
: the number of score categoriessort_d
: TRUE
to sort d parameters for each itemt_dist
: parameters of the normal distribution used to generate t-parametersa_dist
: parameters of the lognormal distribution parameters of a-parametersb_dist
: parameters of the normal distribution used to generate b-parametersd_dist
: parameters of the normal distribution used to generate d-parameterst_bounds
: the bounds of the ability parametersa_bounds
: the bounds of the discrimination parametersb_bounds
: the bounds of the difficulty parametersd_bounds
: the bounds of the category parametersmissing
: the proportion or number of missing responses...
: additional argumentsscale
: the scale, 't' for theta or 'b' for b-parametersmean
: the mean of the new scalesd
: the standard deviation of the new scaletype
: the type of plot, prob for ICC and info for IIFCitem_level
: TRUE to add item level datatotal
: TRUE to sum values over itemsxaxis
: the values of x-axisverbose
: TRUE to print rough maximum likelihood valuesmodel_gpcm_prob
returns the resulting probabilities in a 3d array
model_gpcm_info
returns the resulting information in a 3d array
model_gpcm_lh
returns the resulting likelihood in a matrix
model_gpcm_gendata
returns the generated response matrix and parameters
model_gpcm_rescale
returns t, a, b, d parameters on the new scale
model_gpcm_plot
returns a ggplot
object
model_gpcm_plot_loglh
returns a ggplot
object
Use NA
to represent unused category.
with(model_gpcm_gendata(10, 5, 3), model_gpcm_prob(t, a, b, d)) with(model_gpcm_gendata(10, 5, 3), model_gpcm_info(t, a, b, d)) with(model_gpcm_gendata(10, 5, 3), model_gpcm_lh(u, t, a, b, d)) model_gpcm_gendata(10, 5, 3) model_gpcm_gendata(10, 5, 3, missing=.1) # Figure 1 in Muraki, 1992 (APM) b <- matrix(c(-2,0,2,-.5,0,2,-.5,0,2), nrow=3, byrow=TRUE) model_gpcm_plot(a=c(1,1,.7), b=rowMeans(b), d=rowMeans(b)-b, D=1.0, d0=0) # Figure 2 in Muraki, 1992 (APM) b <- matrix(c(.5,0,NA,0,0,0), nrow=2, byrow=TRUE) model_gpcm_plot(a=.7, b=rowMeans(b, na.rm=TRUE), d=rowMeans(b, na.rm=TRUE)-b, D=1.0, d0=0) # Figure 3 in Muraki, 1992 (APM) b <- matrix(c(1.759,-1.643,3.970,-2.764), nrow=2, byrow=TRUE) model_gpcm_plot(a=c(.778,.946), b=rowMeans(b), d=rowMeans(b)-b, D=1.0, d0=0) # Figure 1 in Muraki, 1993 (APM) b <- matrix(c(0,-2,4,0,-2,2,0,-2,0,0,-2,-2,0,-2,-4), nrow=5, byrow=TRUE) model_gpcm_plot(a=1, b=rowMeans(b), d=rowMeans(b)-b, D=1.0) # Figure 2 in Muraki, 1993 (APM) b <- matrix(c(0,-2,4,0,-2,2,0,-2,0,0,-2,-2,0,-2,-4), nrow=5, byrow=TRUE) model_gpcm_plot(a=1, b=rowMeans(b), d=rowMeans(b)-b, D=1.0, type='info', item_level=TRUE) with(model_gpcm_gendata(5, 50, 3), model_gpcm_plot_loglh(u, a, b, d))