matched_or.data.frame {catfun} | R Documentation |
Create odds ratio and confidence interval from matched pairs data.
## S3 method for class 'data.frame'
matched_or(df, x, y, weight = NULL, alpha = 0.05,
rev = c("neither", "rows", "columns", "both"), ...)
df |
a dataframe with binary variables x and y. |
x |
binary vector, used as rows for frequency table and calculations. |
y |
binary vector, used as columns for frequency table and calculations. |
weight |
an optional vector of count weights. |
alpha |
level of significance for confidence interval. |
rev |
reverse order of cells. Options are "row", "columns", "both", and "neither" (default). |
... |
further arguments passed to or from other methods. |
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 |
gene <- data.frame(pair = seq(1:35),
ulcer = rbinom(35, 1, .7),
healthy = rbinom(35, 1, .4))
matched_or(gene, ulcer, healthy)