View source: R/classification.R
mdlfit.gfx | R Documentation |
Tool for visually gauging the discrepancy between the observed and model-implied frequencies of observed-scores.
mdlfit.gfx(
x,
x.tickat = NULL,
y.tickat = NULL,
y.lim = NULL,
main.lab = "Observed vs. Expected Frequencies",
x.lab = "Bins",
y.lab = "Frequency",
x.grid = NULL,
y.grid = NULL
)
x |
The output object from the |
x.tickat |
The points along the x-axis that bins are to be labeled. Default is |
y.tickat |
The points along the y-axis where frequencies are to be labelled. Default is |
y.lim |
The limits of the y-axis (frequencies). Useful for keeping the scale equal across several plots. |
main.lab |
The main label (title) of the plot. |
x.lab |
The label for the x-axis (the bins). |
y.lab |
The label for the y-axis (the frequencies). |
x.grid |
Control the vertical grid-lines of the plot. Takes |
y.grid |
Control the horizontal grid-lines of the plot. Takes |
# Generate some data. 1000 respondents taking 100 item test:
set.seed(060121)
p.success <- rBeta.4P(1000, 0.25, 0.75, 5, 3)
for (i in 1:100) {
if (i == 1) {
rawdata <- matrix(nrow = 1000, ncol = 100)
}
rawdata[, i] <- rbinom(1000, 1, p.success)
}
# Analyse the accuracy and consistency of the test and store the object:
out <- LL.CA(x = rowSums(rawdata), reliability = cba(rawdata), cut = 50,
min = 0, max = 100, modelfit = c(nbins = 20, minbin = 1))
# Feed the object to the mdlfit.gfx() function:
mdlfit.gfx(out)
# Given the number of observations, the y-axis ticks are a bit crowded. We
# can make it look less crowded by changing the number of ticks, labels, and
# the grid-lines:
mdlfit.gfx(out, y.tickat = seq(0, 250, 25), y.lim = c(0, 250),
y.grid = seq(0, 250, 12.5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.