# Plotting results of a unidimensional Rasch Model
## Mock results
uni.proficiency <- rnorm(1000, mean = -0.5, sd = 1)
difficulties <- sort( rnorm( 20))
## Default map
wrightMap( uni.proficiency, difficulties)
## Density version
wrightMap( uni.proficiency, difficulties, person.side = personDens)
# Plotting results of a multidimensional Rasch Model
## Mock results
multi.proficiency <- data.frame(
d1 = rnorm(1000, mean = -0.5, sd = 1),
d2 = rnorm(1000, mean = 0.0, sd = 1),
d3 = rnorm(1000, mean = +0.5, sd = 1))
difficulties <- sort( rnorm( 20))
dev.new(width=10, height=10)
wrightMap( multi.proficiency, difficulties)
# Plotting results of a unidimensional Rating Scale Model
# Thresholds without column names will use default labels: 1, 2, 3, etc.
## Mock results
uni.proficiency <- rnorm(1000, mean = -0.5, sd = 1)
items.loc <- sort( rnorm( 20))
thresholds <- cbind(
items.loc - 0.5,
items.loc - 0.25,
items.loc + 0.25,
items.loc + 0.5)
rownames(thresholds) <- paste0("Item", 1:20)
wrightMap( uni.proficiency, thresholds)
## With transition labels (0/1, 1/2, 2/3, etc.)
wrightMap( uni.proficiency, thresholds, thr.lab.type = "transition")
# Plotting with item groups (multiple item panels by content strand)
## Mock results with content strands
uni.proficiency <- rnorm(1000, mean = -0.5, sd = 1)
# Create items with different strands (matrix without column names for default 1, 2, 3 labels)
n.items <- 15
items.loc <- sort(rnorm(n.items))
thresholds <- cbind(
items.loc - 0.5,
items.loc,
items.loc + 0.5)
rownames(thresholds) <- paste0("Item", 1:n.items)
# Assign items to content strands
strands <- c(rep("Algebra", 5), rep("Probability", 5), rep("Calculus", 5))
## Wright Map with multiple item panels
wrightMap(uni.proficiency, thresholds, item.groups = strands)
## Wright Map with no title (reclaims space at top)
wrightMap(uni.proficiency, thresholds, item.groups = strands, main.title = NULL)
## Wright Map with adjusted font sizes for group labels
wrightMap(uni.proficiency, thresholds, item.groups = strands,
item.group.cex = 0.8, axis.items.cex = 0.9)
## Wright Map with different cutpoints per panel
wrightMap(uni.proficiency, thresholds, item.groups = strands,
cutpoints = list(
Algebra = c(-1, 0),
Probability = c(0, 1),
Calculus = c(-0.5, 0.5)
))
####ConQuest integration###
fpath <- system.file("extdata", package="WrightMap")
#Partial credit model:
model1 <- CQmodel(p.est = file.path(fpath,"ex2.eap"), show = file.path(fpath,"ex2.shw"))
wrightMap(model1)
# Rating scale model:
model2 <- CQmodel(file.path(fpath,"ex2b.eap"), file.path(fpath,"ex2b-2.shw"))
wrightMap(model2, label.items.row = 2)
# Complex model
model3 <- CQmodel(file.path(fpath,"ex4a.mle"), file.path(fpath,"ex4a.shw"))
wrightMap(model3, min.logit.pad = -29, person.side = personDens)
### Skip CQmodel
wrightMap(file.path(fpath,"ex2a.eap"), file.path(fpath,"ex2a.shw"),
label.items.row = 3)
Run the code above in your browser using DataLab