
Calculates Cohen's g and odds ratio for paired contingency tables, such as those that might be analyzed with McNemar or McNemar-Bowker tests.
cohenG(x, digits = 3)
A two-way contingency table. It must be square. It can have two or more levels for each dimension.
The number of significant digits in the output.
A list containing: a data frame of results of the global statistics; and a data frame of results of the pairwise statistics.
For a 2 x 2 table, where a and d are the concordant cells and b and c are discordant cells: Odds ratio is the greater of b/c or c/b; P is the greater of b/(b+c) or c/(b+c); and Cohen's g is P - 0.5. These statistics are extended to tables larger than 2 x 2.
# NOT RUN {
### 2 x 2 repeated matrix example
data(AndersonRainBarrel)
cohenG(AndersonRainBarrel)
### 3 x 3 repeated matrix
data(AndersonRainGarden)
cohenG(AndersonRainGarden)
# }
Run the code above in your browser using DataLab