R/oddsratios.R

Defines functions oddsratios riskratios

Documented in oddsratios riskratios

#' Odds Ratios
#'
#' This function provides the exponentiated coefficients and confidence intervals
#' from a logistic regression model.
#'
#' @param model The generalized linear model object (from \code{glm()})
#'
#' @importFrom stats coef confint
#' @export

oddsratios <- function(model){
  cbind("OR" = exp(stats::coef(model)),
        exp(stats::confint(model)))
}

#' Risk Ratios
#'
#' This function provides the exponentiated coefficients and confidence intervals
#' from a logistic regression model.
#'
#' @param model The generalized linear model object (from \code{glm()})
#'
#' @importFrom stats coef confint
#' @export

riskratios <- function(model){
  cbind("RR" = exp(stats::coef(model)),
        exp(stats::confint(model)))
}
TysonStanley/rlm documentation built on Sept. 18, 2019, 5 a.m.