Learn R Programming

ddtlcm (version 0.2.1)

plot_tree_with_heatmap: Plot the MAP tree and class profiles (heatmap) of summarized DDT-LCM results

Description

Plot the MAP tree and class profiles (heatmap) of summarized DDT-LCM results

Usage

plot_tree_with_heatmap(
  tree_with_parameter,
  response_prob,
  item_membership_list
)

Value

a ggplot2 object. A plot with the tree structure on the left and a heatmap of item response probabilities on the right, with indication of item group memberships beneath the heatmap.

Arguments

tree_with_parameter

a "phylo4d" tree with node parameters

response_prob

a K by J matrix, where the k,j-th element is the response probability of item j for individuals in class k

item_membership_list

a list of G elements, where the g-th element contains the column indices of the observed data matrix corresponding to items in major group g

Examples

Run this code
# load the MAP tree structure obtained from the real HCHS/SOL data
data(data_synthetic)
# extract elements into the global environment
list2env(setNames(data_synthetic, names(data_synthetic)), envir = globalenv())
plot_tree_with_heatmap(tree_with_parameter, response_prob, item_membership_list)

Run the code above in your browser using DataLab