| AB_permutation_test_plot {pdt} | R Documentation | 
AB_permutation_test_plot
Description
Creates a permutation distancing test plot. Several plot options are available, e.g., to show both the observed and detrended lines.
Usage
AB_permutation_test_plot(
  x,
  x_values,
  y,
  test_statistic_function = "mean",
  de_A_trend = FALSE,
  detrend_A_position = "center",
  show_de_A_trended = FALSE,
  de_B_trend = FALSE,
  detrend_B_position = "center",
  show_de_B_trended = FALSE,
  show_plot_header = "",
  xlab = "",
  ylab = "",
  ylim = NULL,
  labels = NULL,
  line_colors = c("blue", "red", "blue", "red", "blue", "cyan"),
  show_legend = TRUE
)
Arguments
| x | factor vector to indicate conditions or phases (e.g., "A" and "B") | 
| x_values | numerical vector with distance (time markers) between observations | 
| y | numerical vector with the observed y-values | 
| test_statistic_function | character compute and compare "mean" or "median" for phase A and B | 
| de_A_trend | boolean de-trend A (optional) | 
| detrend_A_position | character c("first", "center", "last"), see detrend_A | 
| show_de_A_trended | boolean show de-trend A line (optional) | 
| de_B_trend | boolean de-trend B (optional) | 
| detrend_B_position | character c("first", "center", "last"), see detrend_B | 
| show_de_B_trended | boolean show de-trend B line (optional) | 
| show_plot_header | character header | 
| xlab | character x-axis label | 
| ylab | character y-axis label | 
| ylim | numerical vector of y-axis limits | 
| labels | character vector of labels | 
| line_colors | character vector with colors of the succeeding lines c("blue", "red", "blue", "red", "blue", "cyan"), | 
| show_legend | boolean show legend | 
Value
NULL.
Examples
pdt::AB_permutation_test_plot(
  as.factor(c(rep("A",20), rep("B",20))),
  1:40,
  c(rnorm(20), rnorm(20)+2),
  test_statistic_function="mean",
  de_A_trend=TRUE,
  detrend_A_position="center",
  show_de_A_trended=TRUE,
  de_B_trend=TRUE,
  detrend_B_position="center",
  show_de_B_trended=TRUE,
  show_plot_header="",
  xlab="",
  ylab="",
  ylim=NULL,
  labels=NULL,
  line_colors=c("blue", "red", "blue", "red", "blue", "cyan"),
  show_legend=TRUE)