knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Visualize the Results

To visualize the missing data patterns of the optimal PHPM design, we can use the plotPM() function with the simPM() object. It will plot the missing data pattern matrix so people can have a more intuitive understanding of the optimal design that was selected.

setwd("C:/Users/yifeng94/Desktop/simPM/simPM-git/examples")
load("new_lgm_example.rda")
load("wave.ex3_r1.rda")
load("item.ex3_r1.rda")
load("forward.ex3_r1.rda")
library(simPM)

Examples

Below is an example of the plot showing the missing data patterns for a wave-level PHPM design. It corresponds to the missing data pattern matrix in the output summary. By default, the plot will use red ("firebrick") to indicate missingness and beige ("antiquewhite1") to indicate complete data. In the plot, each row represents a unique missing data pattern. Each column represents an observed variable. The number of participants assigned to each missing data pattern is labeled by the missing data pattern.

plotPM(wave.lgm, fontsize_col = 15)

We can change the color scheme of the plot by setting col =.

plotPM(wave.lgm, col = c("gray96", "gray35"), colbr = "Greys", fontsize_col = 15)

We can also turn off the wave label by using the labels = FALSE argument.

plotPM(wave.lgm, labels = F, col = c("gray96", "gray35"), fontsize_col = 15)

Below is an example of the plot showing the missing data patterns for a balanced item-level PHPM design. If we do not wish to include the number of participants assigned to each missing data pattern, we can turn it off by setting row.names = FALSE.

plotPM(item.ex3, row.names=F, fontsize_col = 15)

Below is an example of the plot showing the missing data patterns for an imbalanced item-level PHPM design (with forward assembly).

plotPM(forward.lgm)


YiFengEDMS/simPM documentation built on July 25, 2020, 4:08 a.m.