-
Notifications
You must be signed in to change notification settings - Fork 75
/
itemplot.Rd
148 lines (121 loc) · 4.93 KB
/
itemplot.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/itemplot.R
\name{itemplot}
\alias{itemplot}
\title{Displays item surface and information plots}
\usage{
itemplot(
object,
item,
type = "trace",
degrees = 45,
CE = FALSE,
CEalpha = 0.05,
CEdraws = 1000,
drop.zeros = FALSE,
theta_lim = c(-6, 6),
shiny = FALSE,
rot = list(xaxis = -70, yaxis = 30, zaxis = 10),
par.strip.text = list(cex = 0.7),
npts = 200,
par.settings = list(strip.background = list(col = "#9ECAE1"), strip.border = list(col =
"black")),
auto.key = list(space = "right", points = FALSE, lines = TRUE),
...
)
}
\arguments{
\item{object}{a computed model object of class \code{SingleGroupClass}
or \code{MultipleGroupClass}. Input may also be a \code{list} for comparing similar item types
(e.g., 1PL vs 2PL)}
\item{item}{a single numeric value, or the item name, indicating which item to plot}
\item{type}{plot type to use, information (\code{'info'}), standard errors (\code{'SE'}),
item trace lines (\code{'trace'}), cumulative probability plots to indicate thresholds
(\code{'threshold'}), information and standard errors (\code{'infoSE'}) or
information and trace lines (\code{'infotrace'}),
category and total information (\code{'infocat'}),
relative efficiency lines (\code{'RE'}),
expected score \code{'score'}, or information and trace line contours (\code{'infocontour'} and
\code{'tracecontour'}; not supported for \code{MultipleGroupClass} objects)}
\item{degrees}{the degrees argument to be used if there are two or three factors.
See \code{\link{iteminfo}} for more detail. A new vector will be required for three dimensional
models to override the default}
\item{CE}{logical; plot confidence envelope?}
\item{CEalpha}{area remaining in the tail for confidence envelope. Default gives 95\% confidence
region}
\item{CEdraws}{draws number of draws to use for confidence envelope}
\item{drop.zeros}{logical; drop slope values that are numerically close to zero to reduce
dimensionality? Useful in objects returned from \code{\link{bfactor}} or other confirmatory
models that contain several zero slopes}
\item{theta_lim}{lower and upper limits of the latent trait (theta) to be evaluated, and is
used in conjunction with \code{npts}. Default uses \code{c(-6,6)}}
\item{shiny}{logical; run interactive display for item plots using the \code{shiny} interface.
This primarily is an instructive tool for demonstrating how item response curves
behave when adjusting their parameters}
\item{rot}{a list of rotation coordinates to be used for 3 dimensional plots}
\item{par.strip.text}{plotting argument passed to \code{\link[lattice]{lattice}}}
\item{npts}{number of quadrature points to be used for plotting features.
Larger values make plots look smoother}
\item{par.settings}{plotting argument passed to \code{\link[lattice]{lattice}}}
\item{auto.key}{plotting argument passed to \code{\link[lattice]{lattice}}}
\item{...}{additional arguments to be passed to \code{\link[lattice]{lattice}} and \code{coef()}}
}
\description{
\code{itemplot} displays various item based IRT plots, with special options for plotting items
that contain several 0 slope parameters. Supports up to three dimensional models.
}
\examples{
\dontrun{
data(LSAT7)
fulldata <- expand.table(LSAT7)
mod1 <- mirt(fulldata,1,SE=TRUE)
mod2 <- mirt(fulldata,1, itemtype = 'Rasch')
mod3 <- mirt(fulldata,2)
itemplot(mod1, 2)
itemplot(mod1, 2, CE = TRUE)
itemplot(mod1, 2, type = 'info')
itemplot(mod1, 2, type = 'info', CE = TRUE)
mods <- list(twoPL = mod1, onePL = mod2)
itemplot(mods, 1, type = 'RE')
# multidimensional
itemplot(mod3, 4, type = 'info')
itemplot(mod3, 4, type = 'info',
col.regions = colorRampPalette(c("white", "red"))(100))
itemplot(mod3, 4, type = 'infocontour')
itemplot(mod3, 4, type = 'tracecontour')
# polytomous items
pmod <- mirt(Science, 1, SE=TRUE)
itemplot(pmod, 3)
itemplot(pmod, 3, type = 'threshold')
itemplot(pmod, 3, CE = TRUE)
itemplot(pmod, 3, type = 'score')
itemplot(pmod, 3, type = 'score', CE = TRUE)
itemplot(pmod, 3, type = 'infotrace')
itemplot(pmod, 3, type = 'infocat')
# use the directlabels package to put labels on tracelines
library(directlabels)
plt <- itemplot(pmod, 3)
direct.label(plt, 'top.points')
# change colour theme of plots
bwtheme <- standard.theme("pdf", color=FALSE)
plot(pmod, type='trace', par.settings=bwtheme)
itemplot(pmod, 1, type = 'trace', par.settings=bwtheme)
# additional modifications can be made via update().
# See ?update.trellis for further documentation
(plt <- itemplot(pmod, 1))
update(plt, ylab = expression(Prob(theta))) # ylab changed
# infoSE plot
itemplot(pmod, 1, type = 'infoSE')
# uncomment to run interactive shiny applet
# itemplot(shiny = TRUE)
}
}
\references{
Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory
Package for the R Environment. \emph{Journal of Statistical Software, 48}(6), 1-29.
\doi{10.18637/jss.v048.i06}
}
\author{
Phil Chalmers \email{rphilip.chalmers@gmail.com}
}
\keyword{plot}