rcompanion (version 1.13.2)

cohenG: Cohen's g and odds ratio for paired contingency tables

Description

Calculates Cohen's g and odds ratio for paired contingency tables, such as those that might be analyzed with McNemar or McNemar-Bowker tests.

Usage

cohenG(x, digits = 3)

Arguments

x

A two-way contingency table. It must be square. It can have two or more levels for each dimension.

digits

The number of significant digits in the output.

Value

A list containing: a data frame of results of the global statistics; and a data frame of results of the pairwise statistics.

Details

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.

References

http://rcompanion.org/handbook/H_05.html

See Also

nominalSymmetryTest

Examples

Run this code
# 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