This function returns a crosstab (tab) on a given data frame, and using simplified calls within the function for two variables, to return the observed and expected frequencies.
Usage
tab(df, var1, var2)
Arguments
df
data frame to read in.
var1
a first grouping variable.
var2
a second grouping variable.
Value
This function returns the observed and expected frequencies of a bivariate relationship between var1 and var2 in data frame df.