| plot.grmtree | R Documentation |
Visualizes a GRM (Graded Response Model) tree with different types of
terminal node plots. This function extends plot.modelparty from the
partykit package with specialized visualizations for GRM trees.
## S3 method for class 'grmtree'
plot(
x,
type = c("regions", "profile", "histogram"),
what = c("item", "threshold", "discrimination"),
tnex = 2L,
drop_terminal = TRUE,
spacing = 0.1,
...
)
x |
A GRM tree object of class 'grmtree'. |
type |
Type of terminal node plot to display:
|
what |
Type of parameters to plot when
|
tnex |
Numeric scaling factor for terminal node extension (default: 2). |
drop_terminal |
Logical indicating whether to drop terminal node IDs (default: TRUE). |
spacing |
Numeric value controlling spacing between elements (default: 0.1). |
... |
Additional arguments passed to the terminal panel functions. |
The function provides three visualization types:
Regions plot: Shows threshold parameters as colored regions, useful for visualizing the difficulty parameters across items and nodes.
Profile plot: Displays either item parameters (discrimination and average thresholds), just thresholds, or just discrimination parameters as line plots across items.
Histogram: Shows the distribution of factor scores in each node with an overlaid normal curve.
Invisibly returns the GRM tree object. Primarily called for its side effect of producing a plot.
plot.modelparty for the underlying plotting
infrastructure, grmtree for creating GRM tree objects,
plot.varimp creates a bar plot of variable importance scores
library(grmtree)
library(hlt)
data("asti", package = "hlt")
asti$resp <- data.matrix(asti[, 1:4])
# Fit GRM tree with gender and group as partitioning variables
tree <- grmtree(resp ~ gender + group,
data = asti,
control = grmtree.control(minbucket = 30))
# Default regions plot
plot(tree)
# Profile plot showing item parameters
plot(tree, type = "profile")
# Profile plot showing only thresholds
plot(tree, type = "profile", what = "threshold")
# Histograms of factor scores
plot(tree, type = "histogram")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.