Description Usage Arguments Details Value Examples
Create odds ratio and confidence interval from matched pairs data.
1 | matched_or(df, ...)
|
df |
a dataframe with binary variables x and y or a 2 x 2 frequency table/matrix. If a table or matrix, x and y must be NULL. Used to select method. |
... |
further arguments passed to or from other methods. |
The matched pairs odds ratio and confidence interval is the equivalent of calculating a Cochran-Mantel-Haenszel odds ratio where each pair is treated as a stratum.
a list with class "matched_or" with the following components:
tab |
2x2 table using for calculating risk difference |
or |
dataframe with columns corresponding to matched-pairs OR, lower bound, and upper bound of CI |
conf.level |
specified confidence level |
1 2 3 4 5 6 | set.seed(1)
gene <- data.frame(pair = seq(1:35),
ulcer = rbinom(35, 1, .7),
healthy = rbinom(35, 1, .4))
matched_or(gene, ulcer, healthy)
|
Frequency table:
healthy
ulcer 0 1
0 4 6
1 16 9
----------------------------------------
Confidence level: 95%
odds_ratio lower_bound upper_bound
1 0.375 0.1467 0.9583
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.