cohenG | R Documentation |
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,
ci = FALSE,
conf = 0.95,
type = "perc",
R = 1000,
histogram = FALSE,
digits = 3,
reportIncomplete = FALSE,
...
)
x |
A two-way contingency table. It must be square. It can have two or more levels for each dimension. |
ci |
If |
conf |
The level for the confidence interval. |
type |
The type of confidence interval to use.
Can be any of " |
R |
The number of replications to use for bootstrap. |
histogram |
If |
digits |
The number of significant digits in the output. |
reportIncomplete |
If |
... |
Additional arguments (ignored). |
For a 2 x 2 table, where a and d are the concordant cells and b and c are discordant cells: Odds ratio is b/c; P is b/(b+c); and Cohen's g is P - 0.5.
In the 2 x 2 case, the statistics are directional. That is, when cell [1, 2] in the table is greater than cell [2, 1], OR is greater than 1, P is greater than 0.5, and g is positive.
In the opposite case, OR is less than 1, P is less than 0.5, and g is negative.
In the 2 x 2 case, when the effect is small, the confidence interval for OR can pass through 1, for g can pass through 0, and for P can pass through 0.5.
For tables larger than 2 x 2, the statistics are not directional.
That is, OR is always >= 1, P is always >= 0.5, and
g is always positive.
Because of this, if type="perc"
, the confidence interval will
never cross the values for no effect
(OR = 1, P = 0.5, or g = 0).
Because of this, the confidence interval range
in this case should not
be used for statistical inference.
However, if type="norm"
, the confidence interval
may cross the values for no effect.
When the reported statistics are close to their extremes, or with small counts, the confidence intervals determined by this method may not be reliable, or the procedure may fail.
A list containing: a data frame of results of the global statistics; and a data frame of results of the pairwise statistics.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
https://rcompanion.org/handbook/H_05.html
nominalSymmetryTest
,
cohenH
### 2 x 2 repeated matrix example
data(AndersonRainBarrel)
cohenG(AndersonRainBarrel)
### 3 x 3 repeated matrix
data(AndersonRainGarden)
cohenG(AndersonRainGarden)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.