Plot the result of a t-test by shading the p-value area under the t-distribution

e_plot_ttest_pval(t_summary, sw_graphics = c("ggplot", "base")[2])

Arguments

t_summary

the returned object from stats::t.test()

sw_graphics

choice of ggplot or base graphics

Value

if base graphics, NULL invisibly; if ggplot, the plot grob

Examples

t_summary <- t.test(dat_mtcars_e$mpg, mu = 20, data = dat_mtcars_e)
e_plot_ttest_pval(t_summary)

t_summary <- t.test(mpg ~ am, mu = 0, data = dat_mtcars_e)
e_plot_ttest_pval(t_summary)