getPValue | R Documentation |
Computes the P-value for a given numeric value 'x' based on its position within a sorted distribution. This function utilizes a binary search approach for efficient computation.
getPValue(x, sorted_Distri)
x |
A numeric value for which the P-value is to be calculated. |
sorted_Distri |
A numeric vector representing a sorted distribution. This distribution must be sorted in ascending order. |
A numeric value indicating the P-value, representing the proportion of values in 'sorted_Distri' that are greater than or equal to 'x'.
x <- rnorm(1)
sorted_dist <- sort(rnorm(100))
getPValue(x, sorted_dist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.