Learn R Programming

speccurvieR (version 1.0.0)

plot_sca_test: Plot the null distribution of a joint-inference test

Description

`plot_sca_test()` visualises the output of [sca_test()]. For each test statistic it draws the permutation null distribution with the observed value marked and the permutation p-value annotated, making it easy to see how extreme the observed specification curve is relative to the sharp null.

Usage

plot_sca_test(test_result, type = "histogram", title = "")

Value

A ggplot object with one facet per test statistic.

Arguments

test_result

An object of class `"sca_test"` returned by [sca_test()].

type

A string, `"histogram"` (default) or `"density"`, selecting how the null distribution is drawn.

title

A string used as the plot title. Defaults to `""`.

Examples

Run this code
# \donttest{
result <- sca_test(y = "Salnty", x = "T_degC", controls = c("ChlorA", "O2Sat"),
                   data = bottles, n_permutations = 100, progress_bar = FALSE)
plot_sca_test(result)
# }

Run the code above in your browser using DataLab