| GPCMlasso-package | R Documentation |
The GPCMlasso package fits generalized partial credit models and related ordinal item response models with explanatory variables. It supports models with global covariate effects, item-specific covariate effects, and regularization terms for variable selection and the clustering of item-specific effects by fusion penalties.
The original functionality of the package focuses on the detection of differential item functioning (DIF) in generalized partial credit models. In this framework, DIF effects are explicitly parametrized and selected by penalized marginal maximum likelihood estimation. The package additionally provides tools for fitting explanatory generalized partial credit models with global and item-specific covariate effects, including full-fusion penalties to identify clusters of items with equal covariate effects.
Several variables can be considered simultaneously, and both continuous and categorical covariates can be included. The package covers generalized partial credit models and special cases such as partial credit models, rating scale models, and models for binary item responses.
Gunther Schauberger
gunther.schauberger@tum.de
Schauberger, G. and Mair, P. (2020). A regularization approach for the detection of differential item functioning in generalized partial credit models. Behavior Research Methods, 52, 279–294. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/s13428-019-01224-2")}
GPCMlasso,
ctrl_GPCMlasso,
plot.GPCMlasso,
predict.GPCMlasso,
trait.posterior
data(tenseness_small)
## Formula with five ordinal items and two covariates
form_cov <- as.formula(
paste(
"cbind(",
paste(colnames(tenseness_small)[1:5], collapse = ","),
") ~ Gender + Age"
)
)
## Not run:
## ------------------------------------------------------------
## Classical DIF analysis
## ------------------------------------------------------------
fit_dif <- GPCMlasso(
formula = form_cov,
data = tenseness_small,
model = "GPCM",
control = ctrl_GPCMlasso(
cores = 1,
l.lambda = 10,
trace = FALSE
)
)
summary(fit_dif)
plot(
fit_dif,
type = "DIF",
panels_per_page = 2,
columns = 2,
ask_new = FALSE
)
## ------------------------------------------------------------
## Explanatory GPCM-X with global and item-specific effects
## and fusion penalty
## ------------------------------------------------------------
set.seed(1860)
fit_fusion <- GPCMlasso(
formula = form_cov,
data = tenseness_small,
model = "GPCM",
main.effects = TRUE,
cv = TRUE,
control = ctrl_GPCMlasso(
cores = 1,
l.lambda = 10,
folds = 2,
penalize.main.effects = TRUE,
include.item.effects = TRUE,
fuse.per.variable = TRUE,
scale.covariate.effects = FALSE,
trace = FALSE
)
)
summary(
fit_fusion,
effect.scale = "effect"
)
## Available covariate panels
fit_fusion$design_list$x.names
plot(
fit_fusion,
type = "Variable",
panels = fit_fusion$design_list$x.names,
panels_per_page = 2,
columns = 2,
variable.scale = "effect",
select = "cv",
ask_new = FALSE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.