View source: R/tidyConvertToProbabilities.R
probabilitiesFromCounts | R Documentation |
The purpose of this is to calculate the probabilities of given all binary outcomes from a table of marginal frequencies in a dplyr friendly way.
probabilitiesFromCounts(df, x1y1Var, x1Var, y1Var, totalVar)
df |
a dataframe containing one observation per row |
x1y1Var |
the datatable column containing frequency of cooccurrences of events x1 and y1 (true positives) |
x1Var |
the datatable column containing frequency of occurrences of event x1 (observed positives) |
y1Var |
the datatable column containing frequency of occurrences of event y1 (predicted positives) |
totalVar |
the datatable column containing total number of events (all observations) |
the datatable with additional columns for all the probabilities associated with each outcome (i.e. a 2x2 confusion matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.