| Type: | Package |
| Title: | Extended Graphical Model Checks for the Rasch Family of Models |
| Version: | 0.9-2 |
| Date: | 2026-03-06 |
| Description: | The function plotLRT() draws pairwise graphical model checks for the Rasch Model (RM; Rasch, 1960), the Partial Credit Model(PCM; Masters, 1982), and the Rating Scale Model (RSM; Andrich, 1978) using the output object of eRm::LRtest(). The function cLRT() provides a conditional Likelihood Ratio Test (Andersen, 1973), using the routines of 'psychotools'. Users may choose to plot the threshold parameters, the cumulative thresholds, the average thresholds per item, or the person parameters. Extended coloring options allow for automated item-wise or threshold-wise coloring. For multi-group splits, all pairwise group comparisons are drawn automatically. For more details see Andersen (1973) <doi:10.1007/BF02291180>, Andrich (1978) <doi:10.1007/BF02293814>, Masters (1982) <doi:10.1007/BF02296272> and Rasch (1960, ISBN:9780598554512). |
| Depends: | R (≥ 3.0.0) |
| License: | GPL (≥ 3) |
| Imports: | psychotools |
| Suggests: | eRm |
| NeedsCompilation: | no |
| Packaged: | 2026-03-06 07:14:46 UTC; aa |
| Author: | Rainer W. Alexandrowicz [aut, cre] |
| Maintainer: | Rainer W. Alexandrowicz <rainer.alexandrowicz@aau.at> |
| Repository: | CRAN |
| Date/Publication: | 2026-03-10 19:50:02 UTC |
Conditional Likelihood Ratio Test (cLRT) using psychotool's routines
Description
Calculates the cLRT and delivers subgroup's estimates for further processing
with plotLRT().
Usage
cLRT(dat, splitcr = "median", model = "PCM", print = TRUE, ...)
Arguments
dat |
The data set (matrix or data.frame) to be evaluated. |
splitcr |
The split criterion. One of the following:
|
model |
The model to be applied. May either contain the model's name
(i.e., |
print |
(logical) Print the cLRT result to the console (default TRUE). |
... |
Further arguments to be passed to the estimation routines. |
Value
cLRT returns an object of class cLRT with the elements
X The data set.
X.list A list of data sub-sets split by the split criterion
split The split criterion as provided.
spl.gr The split vector
nullmod Result object of the H0 model.
grpmod Result object of the H1 model (one list entry per split group.)
lrt Results of the cLRT (vector).
LR The test statistic of the cLRT.
df The degrees of freedom of the cLRT.
pvalue The p-value of the cLRT.
threshpar A data.frame of the estimated threshold parameters per group.
betapar A data.frame of the estimated cumulative threshold parameters per group.
meanpar A data.frame of the estimated threshold parameter means per item per group.
perspar A data.frame of the estimated person parameters per group.
se.beta A data.frame of the S.E. of the est. threshold parameters per group.
se.thresh A data.frame of the S.E. of the estimated cumulative threshold parameters per group.
se.mean A data.frame of the S.E. of the estimated threshold parameter means per item per group.
se.pers A data.frame of the S.E. of the estimated person parameters per group.
Author(s)
Rainer W. Alexandrowicz
Examples
library(eRm)
data(pcmdat2)
mod = cLRT(pcmdat2) # psychotools based (defaults: PCM, median split)
plotLRT(mod)
Extended Graphical Model Checks for multi-group splits of RM/PCM/RSM
Description
Draws pairwise graphical model checks for RM/PCM/RSM using the output object of eRm::LRtest() or GMX::clrt(). Supports threshold parameters, cumulative threshold parameters, mean of threshold parameters, or person parameters of the split groups.
Usage
gmx(...)
Arguments
... |
Any argument valid for |
Details
The function gmx() is superseded by plotLRT() as of
version 0.9-2 of GMX, which is the first version made available on CRAN
(for previous versions see https://osf.io/2ryd8/. It is included for
backward compatibility. The options of both functions are identical,
in fact, any call to gmx() is forwarded to plotLRT().
Value
gmx() returns a data.frame with the parameters used for plotting
(i.e., the selected thresholds, cumulative thresholds, mean item parameters,
or thetas).
Author(s)
Rainer W. Alexandrowicz
Examples
library(eRm)
data(pcmdat2)
mod = PCM(pcmdat2) # eRm based
grp = rep(1:3, each=100)
tst = LRtest(mod, splitcr=grp)
gmx(tst)
Extended Graphical Model Checks for multi-group splits of RM/PCM/RSM
Description
Draws pairwise graphical model checks for RM/PCM/RSM using the output object of eRm::LRtest() or GMX::clrt(). Supports threshold parameters, cumulative threshold parameters, mean of threshold parameters, or person parameters of the split groups.
Usage
plotLRT(
lrtobj,
type = c("thresholds", "cumulative", "means", "perspar", "betas"),
isel = NULL,
psel = NULL,
gsel = NULL,
nc = 3,
ds = 4,
dotcol = "dodgerblue",
regcol = "dodgerblue3",
regline = TRUE,
pch = 16,
xlim = NULL,
ylim = NULL,
EQlims = TRUE,
glabs = "auto",
tlabs = c("none", "numbers", "names", "identify"),
title = "none",
annot = c("r", "LRT"),
confell = TRUE,
conferr = 0.05,
confcol = grey(0.8),
extwin = TRUE,
parskip = FALSE,
...
)
Arguments
lrtobj |
Output object of a previous call to eRm::LRtest or GMX::clrt(). |
type |
Plot "betas", "thresholds" (PCM & RSM only), or person parameters ("perspar"). May be abbreviated. See details. |
isel |
Item selection: Vector of item numbers to plot (includes all
parameters of the selected items). Takes precedence over psel
and is ignored if |
psel |
Parameter selection: Vector of parameter numbers to plot.
Ignored if |
gsel |
Group selection: which subgroups to plot (numeric vector). |
nc |
Number of columns of the combined plot. The number of rows is determined automatically from the number of split groups. |
ds |
Diagram size of each single diagram. Defaults to 7x7 inch for a two-group split and 4 x 4 inch for a multi-group split. |
dotcol |
Dot color. May be a vector of length(number of parameters)
for distinguishing parameter groups (e.g., if items belong
to different domains). It also accepts the keywords
|
regcol |
Color of regression line (vertical group ~ horizontal group) |
regline |
(logical) Shall the regression line be drawn? |
pch |
Point character. May be a vector (see |
xlim |
Manually set limits of the horizontal axes (if |
ylim |
Manually set limits of the vertical axes (if |
EQlims |
Force horizontal and vertical axes to share the same range.
(i.e., xlim=ylim). Uses +/-1.2 times the maximum value of all
split groups. Takes precedence over |
glabs |
Vector of group labels or keyword |
tlabs |
Either a keyword defining point labelling:
|
title |
Either keyword "none" (default) to omit a title, keyword "auto" to print the test statistic/df/p-value of the LRT, or a custom title string. |
annot |
A string vector containing the strings |
confell |
(logical). Draw confidence ellipses. |
conferr |
Probability of an error of the first kind used for the confidence ellipses. |
confcol |
Color of the confidence ellipses. The keyword |
extwin |
(logical) Draw diagram(s) into an external window (for
better compatibility with RStudio; default: |
parskip |
Skip internal settings for graphical options (par=) to
take full control; default: |
... |
Further arguments to be passed to |
Details
In the dichotomous case, both
type="cumulative"andtype="mean"plot the item difficulty parameters.It is recommended to use factors for
splitcr=when calling eRm::LRtest().
Changes in version 0.9 of GMX:
The default type is
"thresholds"(unlike"betas"of previous versions).The former
"type=betas"is now called"type=cumulative", but"type=betas"is still supported for backward compatibility).The
"type=means"delivers the threshold means per item.The
col=argument has been renamed todotcol=.
Value
plotLRT() returns a data.frame with the parameters used for plotting
(i.e., the selected thresholds, cumulative thresholds, mean item parameters,
or thetas).
Author(s)
Rainer W. Alexandrowicz
Examples
library(eRm)
data(pcmdat2)
mod = PCM(pcmdat2) # eRm based
grp = rep(1:3, each=100)
tst = LRtest(mod, splitcr=grp)
plotLRT(tst) # thresholds (default)
plotLRT(tst,type="p") # person parameters
col = rep(c("deepskyblue","firebrick2","green3","steelblue"),each=2)
plotLRT(tst,type="t",dotcol=col,cex=2) # distinguish items
plotLRT(tst,type="t",dotcol=col,cex=2,confcol=col,tlab="nam")
col = rep(c("steelblue1","orangered2"),4) # distinguish thresholds
plotLRT(tst,type="t",dotcol=col,cex=2, confcol=col, tlab="nam")
palette(c("deepskyblue","firebrick2","green3","steelblue"))
plotLRT(tst,type="t",dotcol="items",cex=2,tlab="nam") # auto-distinguish items
palette(c("steelblue1","orangered2")) # auto-distinguish thresholds
plotLRT(tst,type="t",dotcol="thresholds",cex=2,tlab="nam")
pp = plotLRT(tst,type="p",dotcol=rainbow(7))
t(apply(pp,1,diff)) # group differences of thetas
plotLRT(tst,type="t",tlab="nam",isel=1) # plot only first item
plotLRT(tst,type="t",tlab="nam",isel=c(2,3)) # plot items 2 and 3
plotLRT(tst,type="t",tlab="nam",psel=c(1,3,5,7)) # plot threshold 1 of all items
mod = cLRT(pcmdat2) # psychotools based
plotLRT(mod)
plotLRT(mod,type="p")