View source: R/multiscaleSVDxpts.R
visualize_permutation_test | R Documentation |
This function visualizes the results of a permutation test by plotting a histogram of the permutation test statistics. A red dotted line indicates the location of the original unpermuted test statistic.
visualize_permutation_test(
permutation_results,
original_stat,
stat_name,
plot_title,
bin_width = 0.1
)
permutation_results |
A numeric vector of permutation test statistics. |
original_stat |
A numeric value representing the original unpermuted test statistic. |
stat_name |
A character string representing the name of the test statistic. |
plot_title |
string for plot title |
bin_width |
optional bin width for the histogram |
A ggplot object showing the histogram of permutation test statistics with the original test statistic marked.
## Not run:
set.seed(123)
n_perms <- 1000
permutation_results <- rnorm(n_perms, mean = 0, sd = 1)
original_stat <- 2
visualize_permutation_test(permutation_results, original_stat, "Simulated Statistic")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.