Description Usage Arguments Author(s) References Examples
This function allows to generate Wright map (also called
item-person map) using ggplot()
function from the ggplot2
package. Wright map is used to display histogram of factor scores and the
item difficulty parameters estimated by the Rasch IRT model.
1 2 3 4 5 6 7 8 9 10 11 | ggWrightMap(
theta,
b,
binwidth = 0.5,
color = "blue",
size = 15,
item.names,
ylab.theta = "Respondent latent trait",
ylab.b = "Item difficulty",
rel_widths = c(1, 1)
)
|
theta |
numeric: vector of ability estimates. |
b |
numeric: vector of difficulty estimates. |
binwidth |
numeric: the width of the bins of histogram. |
color |
character: color of histogram. |
size |
text size in pts. |
item.names |
names of items to be displayed. |
ylab.theta |
character: description of y-axis for the histogram. |
ylab.b |
character: description of y-axis for the plot of difficulty estimates. |
rel_widths |
numeric: vector of length 2 specifying ratio of "facet's" widths. |
Adela Hladka
Institute of Computer Science of the Czech Academy of Sciences
hladka@cs.cas.cz
Jan Netik
Institute of Computer Science of the Czech Academy of Sciences
netik@cs.cas.cz
Patricia Martinkova
Institute of Computer Science of the Czech Academy of Sciences
martinkova@cs.cas.cz
Wright, B. & Stone, M. (1979). Best test design. MESA Press: Chicago, IL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(mirt)
data(HCI)
# fit Rasch model with the mirt package
fit <- mirt(HCI[, 1:20], model = 1, itemtype = "Rasch")
# factor scores
theta <- as.vector(fscores(fit))
# difficulty estimates using IRT parametrization
b <- coef(fit, simplify = TRUE, IRTpars = TRUE)$items[, "b"]
# Wright map
ggWrightMap(theta, b)
# Wright map with modified item names
item.names <- paste("Item", 1:20)
ggWrightMap(theta, b, item.names = item.names)
# Wright map with modified descriptions of y-axis and relative widths of plots
ggWrightMap(theta, b,
ylab.theta = "Latent trait", ylab.b = "Difficulty estimates",
rel_widths = c(2, 1)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.