R/oddsratio.R

oddsratio <-
function (x, y = NULL, method = c("midp", "fisher", "wald", "small"), 
    conf.level = 0.95, rev = c("neither", "rows", "columns", 
        "both"), correction = FALSE, verbose = FALSE) 
{
    if (is.matrix(x) && !is.null(y)) {
        stop("y argument should be NULL")
    }
    if (is.null(y)) {
        x <- epitable(x, rev = rev)
    }
    else {
        x <- epitable(x, y, rev = rev)
    }
    method <- match.arg(method)
    if (method == "midp") {
        rr <- oddsratio.midp(x, conf.level = conf.level, verbose = verbose, 
            correction = correction)
    }
    if (method == "fisher") {
        rr <- oddsratio.fisher(x, conf.level = conf.level, verbose = verbose,
            correction = correction)
    }
    if (method == "wald") {
        rr <- oddsratio.wald(x, conf.level = conf.level, verbose = verbose, 
            correction = correction)
    }
    if (method == "small") {
        rr <- oddsratio.small(x, conf.level = conf.level, verbose = verbose, 
            correction = correction)
    }
    rr
}

Try the epitools package in your browser

Any scripts or data that you put into this service are public.

epitools documentation built on March 26, 2020, 9:14 p.m.