Learn R Programming

grmtree (version 0.1.0)

print.grmtree: Print Method for GRM Tree Objects

Description

Displays a formatted summary of a GRM (Graded Response Model) tree object. This function extends print.modelparty from the partykit package with specialized formatting for GRM trees.

Usage

# S3 method for grmtree
print(
  x,
  title = "Graded Response Model Tree",
  objfun = "negative log-likelihood",
  ...
)

Value

Invisibly returns the GRM tree object. Primarily called for its side effect of printing a formatted summary.

Arguments

x

A GRM tree object of class 'grmtree'.

title

Character string specifying the title for the print output (default: "Graded Response Model Tree").

objfun

Character string labeling the objective function (default: "negative log-likelihood").

...

Additional arguments passed to print.modelparty.

Details

The print method provides a comprehensive summary of the GRM tree, including:

  • Model formula used for fitting

  • Tree structure with node information

  • Item parameter estimates for each terminal node

  • Confidence intervals for parameters

  • Group parameters (mean and covariance)

  • Summary statistics (number of nodes, objective function value)

See Also

print.modelparty for the underlying printing infrastructure, grmtree for creating GRM tree objects

Examples

Run this code
# \donttest{
library(grmtree)
library(hlt)
data("asti", package = "hlt")
asti$resp <- data.matrix(asti[, 1:4])

# Fit GRM tree
tree <- grmtree(resp ~ gender + group,
                data = asti,
                control = grmtree.control(minbucket = 30))

# Print the tree summary
print(tree)

# Alternative syntax (automatically calls print.grmtree)
tree
# }

Run the code above in your browser using DataLab