View source: R/tidyConvertToProbabilities.R
probabilitiesFromCooccurrence | R Documentation |
The purpose of this is to calculate the probabilities of all binary outcomes from class data. This function is useful when you have 2 types of events (X and Y) and you either have a set of observations of their co-occurrence, containing non-unique X & Y combinations, or you have a confusion matrix of the counts of their combinations where each row has a unique combination of X and Y and a third column contains the counts of XY co-occurrences.
probabilitiesFromCooccurrence(df, groupXVars, groupYVars, countVar = NULL)
df |
a dataframe containing 2 columns defining class of event X and class of event Y and either one row per event, or a count of observations, for each class combination. df may also be grouped and in which case the grouping is preserved in the result. |
groupXVars |
the datatable column(s) defining the class of event X quoted by vars(...) |
groupYVars |
the datatable column(s) defining the class of event Y quoted by vars(...) |
countVar |
the datatable column containing the observed frequency combination of event XY. If this is missing the row count will be used instead |
A new datatable with all possible combinations of X&Y and the probabilities associated with each outcome (i.e. an N(X) by N(Y) set of binary confusion matrices)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.