Description Usage Arguments Details Value References See Also Examples
View source: R/600.Nominal-odds-ratio.R
Given an input matrix, we can split it into smaller 2x2 sub-matrix and then find the Nominal Odds Ratio for each sub-matrix (subtable) keeping a reference row and column which can be defined by the user. By default the last row and column is taken as the reference.
1 | Nominal.Odds.Ratio(mat, Reference.Row.ID = NULL, Reference.Col.ID = NULL)
|
mat |
- matrix for which the sub-matrix is to be generated. |
Reference.Row.ID |
- The row to be used as reference. By default, the last row is taken as the reference. |
Reference.Col.ID |
- The column to be used as reference. By default, the last column is taken as the reference. |
This can be used as input to models. If any of the cells a,b,c or d is zero, a continuity correction of 0.5 is added to all the cells and the odds ratio is calculated. For nominal classification variables this set of basic 2x2 tables is defined in terms of a reference category, usually the cell (I,J). Then the 2x2 tables formed have in their upper diagonal cell the (i, j) cell of the initial table, for i= 1 to I -1, j=1 to J-1 and in the lower diagonal cell always the reference cell (I,J). The non-diagonal cells are the cells of the initial table that share one classification variable index with each diagonal cell, i.e., they are the cells (i,J) and (I, j).
A of dataframes with
Odds.Ratio |
Odds Ratio of the 2x2 subtable |
a |
The value of a taken from the input table |
b |
The value of b taken from the input table |
c |
The value of c taken from the input table |
d |
The value of d taken from the input table |
Index1RC |
Index reference from the input matrix for a (Row,Column) |
Index2RC |
Index reference from the input matrix for b (Row,Column) |
Index3RC |
Index reference from the input matrix for c (Row,Column) |
Index4RC |
Index reference from the input matrix for d (Row,Column) |
[1] Kateri, Maria. Contingency Table Analysis. Springer New York, 2014.
Other IxJ Inference methods: Local.Odds.Ratio
,
Plot.heatmap
, Reversal.point
,
Subtable.Odds.Ratio
,
generate.heatmap.matrix
1 2 3 4 5 | ## Here we use the default last column as the reference.
mat=matrix(c(1:9), nrow=3, ncol=3)
Nominal.Odds.Ratio(mat,Reference.Row.ID=3, Reference.Col.ID=3 ) # Same as Nominal.Odds.Ratio(mat)
## Now we change the reference row and column to 2
Nominal.Odds.Ratio(mat, 2, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.