MyNixOS website logo
Description

Visualization of 'exametrika' Output Using 'ggplot2'.

Provides 'ggplot2'-based visualization functions for output objects from the 'exametrika' package, which implements test data engineering methods described in Shojima (2022, ISBN:978-981-16-9547-1). Supports a wide range of psychometric models including Item Response Theory, Latent Class Analysis, Latent Rank Analysis, Biclustering (binary, ordinal, and nominal), Bayesian Network Models, and related network models. All plot functions return 'ggplot2' objects that can be further customized by the user.

ggExametrika

R-CMD-check License: MIT

ggExametrika provides ggplot2-based visualization for the exametrika package. It supports a wide range of psychometric models:

ModelDescription
IRTItem Response Theory (2PL, 3PL, 4PL)
GRMGraded Response Model
LCALatent Class Analysis
LRALatent Rank Analysis
LRAordinalLatent Rank Analysis for ordinal data
LRAratedLatent Rank Analysis for rated data
BiclusteringSimultaneous item/student clustering (binary)
nominalBiclusteringBiclustering for nominal data
ordinalBiclusteringBiclustering for ordinal data
IRMInfinite Relational Model
LDLRALocally Dependent Latent Rank Analysis
LDBLocally Dependent Biclustering
BINETBayesian Network and Test
BNMBayesian Network Model

Reference

Shojima, Kojiro (2022) Test Data Engineering: Latent Rank Analysis, Biclustering, and Bayesian Network (Behaviormetrics: Quantitative Approaches to Human Behavior, 13), Springer, ISBN 978-981-16-9985-6

Installation

# install.packages("devtools")
devtools::install_github("kosugitti/ggExametrika")

Examples

All plot functions take exametrika output directly and return ggplot objects. Functions are named plotXXX_gg().

IRT: Item Characteristic Curve (plotICC_gg)

library(exametrika)
library(ggExametrika)

result_irt <- IRT(J15S500, model = 3)
plots <- plotICC_gg(result_irt)
plots[[5]]
combinePlots_gg(plots)

IRT: Overlay Plots (plotICC_overlay_gg, plotIIC_overlay_gg)

# All ICCs on a single plot
plotICC_overlay_gg(result_irt, show_legend = TRUE)

# All IICs on a single plot (also works with GRM)
plotIIC_overlay_gg(result_irt, items = c(1, 3, 5), show_legend = TRUE)

IRT: Item Information Curve (plotIIC_gg)

plots <- plotIIC_gg(result_irt)
combinePlots_gg(plots, selectPlots = 8:11)

IRT: Test Information Curve / Test Response Function (plotTIC_gg, plotTRF_gg)

plotTIC_gg(result_irt)
plotTRF_gg(result_irt)

GRM: Item Category Response Function (plotICRF_gg)

result_grm <- GRM(J5S1000)
plots <- plotICRF_gg(result_grm)
plots[[1]]
combinePlots_gg(plots, selectPlots = 1:5)

# GRM also supports IIC and TIC
plotIIC_gg(result_grm)
plotTIC_gg(result_grm)

LCA: Latent Class Analysis

result_lca <- LCA(J15S500, ncls = 3)

plotIRP_gg(result_lca)         # Item Reference Profile
plotFRP_gg(result_lca)         # Field Reference Profile
plotTRP_gg(result_lca)         # Test Reference Profile
plotLCD_gg(result_lca)         # Latent Class Distribution
plotCMP_gg(result_lca)         # Class Membership Profile

LRA: Latent Rank Analysis

result_lra <- LRA(J15S500, nrank = 4)

plotIRP_gg(result_lra)         # Item Reference Profile
plotFRP_gg(result_lra)         # Field Reference Profile
plotTRP_gg(result_lra)         # Test Reference Profile
plotLRD_gg(result_lra)         # Latent Rank Distribution
plotRMP_gg(result_lra)         # Rank Membership Profile

LRAordinal / LRArated

result_lra_ord <- LRA(J5S1000, nrank = 4)  # ordinal data

plotScoreFreq_gg(result_lra_ord)   # Score Frequency Distribution
plotScoreRank_gg(result_lra_ord)   # Score-Rank Heatmap
plotICRP_gg(result_lra_ord)        # Item Category Reference Profile
plotICBR_gg(result_lra_ord)        # Item Category Boundary Response (ordinal only)
plotRMP_gg(result_lra_ord)         # Rank Membership Profile

Biclustering (binary)

result_bic <- Biclustering(J35S515, nfld = 5, nrank = 6)

plotFRP_gg(result_bic)         # Field Reference Profile
plotTRP_gg(result_bic)         # Test Reference Profile
plotLCD_gg(result_bic)         # Latent Class Distribution
plotLRD_gg(result_bic)         # Latent Rank Distribution
plotCMP_gg(result_bic)         # Class Membership Profile
plotRMP_gg(result_bic)         # Rank Membership Profile
plotCRV_gg(result_bic)         # Class Reference Vector
plotRRV_gg(result_bic)         # Rank Reference Vector
plotArray_gg(result_bic)       # Array Plot (heatmap)

Biclustering (nominal / ordinal)

# Nominal Biclustering
result_nom <- Biclustering(data, ncls = 3, nfld = 4)

plotFRP_gg(result_nom, stat = "mean")   # stat: "mean", "median", or "mode"
plotFCRP_gg(result_nom, style = "line") # Field Category Response Profile (style: "line" or "bar")
plotScoreField_gg(result_nom)           # Expected Score Heatmap (field x class/rank)
plotCRV_gg(result_nom, stat = "mean")   # Class Reference Vector
plotRRV_gg(result_nom, stat = "mean")   # Rank Reference Vector
plotArray_gg(result_nom)                # Array Plot

# Ordinal Biclustering (additional)
plotFCBR_gg(result_ord)                 # Field Cumulative Boundary Reference (ordinal only)

LDB: Locally Dependent Biclustering

result_ldb <- LDB(J35S515, ncls = 6, nfld = 5)

plotFRP_gg(result_ldb)         # Field Reference Profile
plotTRP_gg(result_ldb)         # Test Reference Profile
plotLRD_gg(result_ldb)         # Latent Rank Distribution
plotRMP_gg(result_ldb)         # Rank Membership Profile
plotArray_gg(result_ldb)       # Array Plot
plotFieldPIRP_gg(result_ldb)   # Field Parent Item Reference Profile
plotGraph_gg(result_ldb)       # DAG per rank

BINET: Bayesian Network and Test

result_binet <- BINET(J35S515, ncls = 6, nfld = 5)

plotFRP_gg(result_binet)       # Field Reference Profile
plotTRP_gg(result_binet)       # Test Reference Profile
plotLRD_gg(result_binet)       # Latent Rank Distribution
plotRMP_gg(result_binet)       # Rank Membership Profile
plotArray_gg(result_binet)     # Array Plot
plotGraph_gg(result_binet, show_edge_label = TRUE)  # DAG with edge labels

BNM / LDLRA: DAG Visualization (plotGraph_gg)

result_bnm <- BNM(J15S500)
plotGraph_gg(result_bnm)

result_ldlra <- LDLRA(J15S500, ncls = 5)
plotGraph_gg(result_ldlra)     # One DAG per rank

Function-Model Compatibility

IRT / GRM

FunctionIRTGRM
plotICC_ggx
plotICC_overlay_ggx
plotIIC_ggxx
plotIIC_overlay_ggxx
plotTIC_ggxx
plotTRF_ggx
plotICRF_ggx

LCA / LRA / LRAordinal / LRArated

FunctionLCALRALRAordinalLRArated
plotIRP_ggxx
plotFRP_ggxx
plotTRP_ggxx
plotLCD_ggx
plotLRD_ggx
plotCMP_ggx
plotRMP_ggxxx
plotScoreFreq_ggxx
plotScoreRank_ggxx
plotICRP_ggxx
plotICBR_ggx

Biclustering / IRM

FunctionBic.nomBic.ordBic.IRM
plotFRP_ggxxxx
plotTRP_ggxx
plotLCD_ggxxx
plotLRD_ggxxx
plotCMP_ggxxx
plotRMP_ggxx
plotCRV_ggxxx
plotRRV_ggxxx
plotArray_ggxxxx
plotFCRP_ggxx
plotFCBR_ggx
plotScoreField_ggxx

Network Models (LDLRA / LDB / BINET / BNM)

FunctionLDLRALDBBINETBNM
plotIRP_ggx
plotFRP_ggxx
plotTRP_ggxx
plotLRD_ggxxx
plotRMP_ggxxx
plotArray_ggxx
plotFieldPIRP_ggx
plotGraph_ggxxxx

Utility

FunctionDescription
combinePlots_ggArrange multiple plots in a grid

Common Plot Options

All plot functions support these customization options:

ParameterDescriptionDefault
titleTRUE (auto), FALSE (none), or character stringTRUE
colorsColor vector (colorblind-friendly default)auto
linetype"solid", "dashed", "dotted", etc."solid"
show_legendShow/hide legendTRUE
legend_position"right", "top", "bottom", "left""right"

Some functions have additional parameters:

ParameterFunctionsDescription
statplotFRP_gg, plotCRV_gg, plotRRV_gg"mean", "median", or "mode" for polytomous data
styleplotFCRP_gg"line" or "bar"
show_labelsplotRRV_ggShow value labels (uses ggrepel)

Documentation

Metadata

Version

1.1.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows