piplot
Person-Item Plots for IRT Models
Base graphics plotting function for person-item plot visualization of IRT models.
- Keywords
- aplot
Usage
piplot(object, pcol = NULL, histogram = TRUE, ref = NULL, items = NULL,
xlim = NULL, names = NULL, labels = TRUE, main = "Person-Item Plot",
xlab = "Latent trait", abbreviate = FALSE, cex.axis = 0.8, cex.text = 0.5,
cex.points = 1.5, grid = TRUE, …)
Arguments
- object
a fitted model object of class
"raschmodel"
,"rsmodel"
,"pcmodel"
,"plmodel"
or"gpcmodel"
.- pcol
optional character (vector), specifying the color(s) used for the person parameter plot.
- histogram
logical. For models estimated via MML (
plmodel
s andgpcmodel
s), should a histogram of the person-wise (individual) person parameters be drawn additionally to the normal distribution density of the person parameters?- ref
argument passed over to internal calls of
threshpar
anditempar
.- items
character or numeric, specifying the items which should be visualized in the person-item plot.
- xlim
numeric, specifying the x axis limits.
- names
character, specifying labels for the items.
- labels
logical, whether to draw the number of the threshold as text below the threshold.
- main
character, specifying the overall title of the plot.
- xlab
character, specifying the x axis labels.
- abbreviate
logical or numeric, specifying whether object names are to be abbreviated. If numeric, this controls the length of the abbreviation.
- cex.axis
numeric, the magnification to be used for the axis notation relative to the current setting of
cex
.- cex.text
numeric, the magnification to be used for the symbols relative to the current setting of
cex
.- cex.points
numeric, the magnification to be used for the points relative to the current setting of
cex
.- grid
logical or color specification of horizontal grid lines. If set to
FALSE
or"transparent"
grid lines can be suppressed.- …
further arguments passed to internal calls of
lines
,points
andtext
.
Details
The person-item plot visualization illustrates the distribution of the person
parameters against the absolute item threshold parameters under a certain data
set and IRT model. For models estimated via MML (plmodel
s and
gpcmodel
s), the normal distribution density of the person parameters is
drawn. If histogram
is set to TRUE
(the default), a histogram of
the person-wise (individual) person parameters is drawn additionally. If a
multiple group model has been fitted by supplying an impact
variable,
multiple person parameter plots are drawn, each corresponding to a specific
level of this variable.
See Also
Examples
# NOT RUN {
## load verbal agression data
data("VerbalAggression", package = "psychotools")
## fit partial credit model to verbal aggression data
pcmod <- pcmodel(VerbalAggression$resp)
## create a person-item plot visualization of the fitted PCM
plot(pcmod, type = "piplot")
## just visualize the first six items and the person parameter plot
plot(pcmod, type = "piplot", items = 1:6, pcol = "lightblue")
# }
# NOT RUN {
if(requireNamespace("mirt")) {
## fit generalized partial credit model to verbal aggression data
gpcmod <- gpcmodel(VerbalAggression$resp)
## create a person-item plot visualization of the fitted GPCM
plot(gpcmod, type = "piplot")
## turn off the histogram and grid
plot(gpcmod, type = "piplot", histogram = FALSE, grid = FALSE)
## fit GPCM to verbal aggression data accounting for gender impact
mgpcmod <- gpcmodel(VerbalAggression$resp, impact = VerbalAggression$gender)
## create a person-item plot visualization of the fitted GPCM
plot(mgpcmod, type = "piplot", pcol = c("darkgreen", "darkorange"))
}
# }