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("wave.ex2_r1.rda")
load("item.ex2_r1.rda")
load("forward.ex2_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.ex2, fontsize_col = 15)

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

plotPM(wave.ex2, col = c("gray96", "gray35"), fontsize_col = 15)

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

plotPM(wave.ex2, 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.ex2, 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.ex2)


YiFengEDMS/simPM documentation built on Dec. 31, 2019, 8:54 a.m.