Skip to contents

Plots null distributions of T-statistics from perm_interaction_effect(). Adds dashed lines for observed T-statistics, optional normal fit overlay, and optional density overlay.

Usage

plot_null_distribution(
  data,
  features = NULL,
  show_p = TRUE,
  show_normal = TRUE,
  title = NULL,
  x_label = NULL,
  y_label = NULL,
  bins = 50
)

Arguments

data

A list from perm_interaction_effect(), must include T_null and summary_stats.

features

Character vector of features to plot. Defaults to first 9 if NULL.

show_p

Logical. Show parametric p-values? (default TRUE)

show_normal

Logical. Overlay fitted normal curve? (default TRUE)

title

Optional plot title.

x_label

Optional string for the x-axis label.

y_label

Optional string for the y-axis label.

bins

Integer number of histogram bins (default 50)

Value

A ggplot2 object.