probabilitiesFromCounts: Helper function to calculate probability from counts in dplyr...

View source: R/tidyConvertToProbabilities.R

probabilitiesFromCountsR Documentation

Helper function to calculate probability from counts in dplyr friendly manner

Description

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.

Usage

probabilitiesFromCounts(df, x1y1Var, x1Var, y1Var, totalVar)

Arguments

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)

Value

the datatable with additional columns for all the probabilities associated with each outcome (i.e. a 2x2 confusion matrix)


terminological/tidy-info-stats documentation built on Nov. 19, 2022, 11:23 p.m.