Description Usage Arguments Value Note Author(s) Examples
Calculates conditional probabilities using co-occurrences using Bayes' Theorem, such that P(A|B) = \frac{P(A,B)}{P(B)}, where P(A,B) = \frac{(A,B)}{N}, P(B) = \frac{(B)}{N} and N is the total number of observational units.
1 | cond_prob(a, b)
|
a |
A set of repeated observations of occurrences. |
b |
Another set of repeated observations of occurrences. |
Returns the conditional probabilities.
This is primarily a low-level function used by coNet, it may be of interest to more advanced users.
Matthew K. Lau
1 2 3 4 5 6 7 8 | A <- c(1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1)
B <- c(1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1)
cond_prob(A, B)
C <- c(1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1)
D <- c(0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0)
cond_prob(C, D)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.