piplot | R Documentation |
Base graphics plotting function for person-item plot visualization of IRT models.
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, ...)
object |
a fitted model object of class |
pcol |
optional character (vector), specifying the color(s) used for the person parameter plot. |
histogram |
logical. For models estimated via MML ( |
ref |
argument passed over to internal calls of |
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.text |
numeric, the magnification to be used for the symbols
relative to the current setting of |
cex.points |
numeric, the magnification to be used for the points
relative to the current setting of |
grid |
logical or color specification of horizontal grid lines. If set to
|
... |
further arguments passed to internal calls of
|
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 (nplmodel
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.
curveplot
, regionplot
,
profileplot
, infoplot
## 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")
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"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.