Skip to contents

This function takes exametrika BINET output as input and generates LDPSR (Local Dependence Passing Student Rate) plots using ggplot2. LDPSR visualizes the correct response rate for items within a field, comparing the parent class and child class at each DAG edge.

Each plot corresponds to one edge in the BINET DAG structure, showing how item-level performance differs between the parent class (lower ability) and the child class (higher ability) connected through a specific field.

Usage

plotLDPSR_gg(
  data,
  title = TRUE,
  colors = NULL,
  linetype = "solid",
  show_legend = TRUE,
  legend_position = "right"
)

Arguments

data

An object of class c("exametrika", "BINET").

title

Logical or character. If TRUE (default), display an auto-generated title showing the field and class transition. If FALSE, no title. If a character string, use it as a custom title prefix.

colors

Character vector of length 2. Colors for the parent class line (colors[1]) and the child class line (colors[2]). If NULL (default), uses the package default palette.

linetype

Character or numeric specifying the line type. Default is "solid".

show_legend

Logical. If TRUE (default), display the legend identifying parent and child class lines.

legend_position

Character. Position of the legend. One of "right" (default), "top", "bottom", "left", "none".

Value

A list of ggplot objects, one for each DAG edge. Each plot shows the correct response rate profiles for the parent class and child class on items belonging to the connecting field.

Details

In BINET (Bicluster Network Model), latent classes are connected by a directed acyclic graph (DAG), where edges pass through specific fields. LDPSR shows the item-level passing rate for each such edge: the parent class line represents the correct response rate of students in the originating class, and the child class line shows the rate for students in the destination class.

The gap between the two lines indicates how much students improve on each item when transitioning from the parent class to the child class via the specified field.

Examples

# \donttest{
library(exametrika)
# BINET requires field configuration and edge structure
conf <- c(
  1, 5, 5, 5, 9, 9, 6, 6, 6, 6, 2, 7, 7, 11, 11, 7, 7,
  12, 12, 12, 2, 2, 3, 3, 4, 4, 4, 8, 8, 12, 1, 1, 6, 10, 10
)
edges_data <- data.frame(
  "From Class (Parent) >>>" = c(1, 2, 3, 4, 5, 7, 2, 4, 6, 8, 10, 6, 6, 11, 8, 9, 12),
  ">>> To Class (Child)" = c(2, 4, 5, 5, 6, 11, 3, 7, 9, 12, 12, 10, 8, 12, 12, 11, 13),
  "At Field (Locus)" = c(1, 2, 2, 3, 4, 4, 5, 5, 5, 5, 5, 7, 8, 8, 9, 9, 12)
)
tmp_file <- tempfile(fileext = ".csv")
write.csv(edges_data, file = tmp_file, row.names = FALSE)
result <- BINET(J35S515, ncls = 13, nfld = 12, conf = conf, adj_file = tmp_file)
#> No ID column detected. All columns treated as response data. Sequential IDs (Student1, Student2, ...) were generated. Use id= parameter to specify the ID column explicitly.
#> No ID column detected. All columns treated as response data. Sequential IDs (Student1, Student2, ...) were generated. Use id= parameter to specify the ID column explicitly.
unlink(tmp_file)
plots <- plotLDPSR_gg(result)
plots[[1]] # Show LDPSR for the first edge

# }