Description Usage Arguments Value Author(s) See Also Examples
View source: R/StabilityFunctions.R
This function calculates the p-value of a given similarity value, i.e. the probability for obtaining the same or a smaller value than the given one in a vector of random similarity values. The p-value is used to determine whether the given similarity value is significant.
1 | Pval.dist(dist.val, random.vals)
|
dist.val |
A |
random.vals |
A |
It returns a numeric
value between 0 and 1 that specifies the
p-value of the given dist.val
.
Jasmina Bogojeska
L1.dist
, kullback.leibler
,
comp.models
, stability.sim
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## The function is currently defined as
function(dist.val, random.vals) {
return((sum(random.vals <= dist.val) + 1) /(length(random.vals) + 1))
}
## Define the similarity value and a vector of random similarities
sim.val <- 0.2
rand.vals <- c(0.1, 0.24, 0.28, 0.35, 0.15, 0.5, 0.14, 0.6, 0.8, 0.3)
## Calculate the p-value of sim.val using the vector of random
## similarities
Pval.dist(dist.val = sim.val, random.vals = rand.vals)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.