cpr_classify_signif {canaper} | R Documentation |
Given the results of cpr_rand_test()
, classifies statistical significance
of a biodiversity metric. The null hypothesis is that observed value does not
lie in the extreme of the random values.
cpr_classify_signif(df, metric, one_sided = FALSE, upper = FALSE)
df |
Input data frame. |
metric |
Character vector of length 1; selected metric to classify
significance. May choose from |
one_sided |
Logical vector of length 1; is the null hypothesis
one-sided? If |
upper |
Logical vector of length 1; only applies if |
For metrics like pe
, you probably want to consider a one-sided
hypothesis testing values in the upper extreme (i.e., we are interested in
areas that have higher than expected endemism). For this, you would set
one_sided = TRUE, upper = TRUE
. For metrics like pd
, you probably want
to consider a two-sided hypothesis (i.e., we are interested in areas that
are either more diverse or less than diverse than expected at random). For
this, set one_sided = FALSE
.
Object of class data.frame with column added for statistical
significance of the selected metric. The new column name is the name of the
metric with _signif
appended. The new column is a character that may
contain the following values, depending on the null hypothesis:
< 0.01
, < 0.025
, > 0.975
, > 0.99
, not significant
(two-sided)
< 0.01
, < 0.05
, > 0.99
, > 0.95
, not significant
(one-sided)
set.seed(12345)
data(phylocom)
rand_test <- cpr_rand_test(
phylocom$comm, phylocom$phy,
null_model = "curveball", metrics = "pd", n_reps = 50
)
cpr_classify_signif(rand_test, "pd")