Editar

Compartilhar via


rxRiskRatio: Relative Risk Ratio and Odds Ratio

Description

Calculate the relative risk and odds ratio on a two-by-two table.

Usage

  rxRiskRatio(tbl, conf.level = 0.95, alternative = "two.sided")
  rxOddsRatio(tbl, conf.level = 0.95, alternative = "two.sided")

Arguments

tbl

two-by-two table.

conf.level

level of the confidence interval.

alternative

character string defining alternative hypothesis. Supported values are "two.sided", "less", or "greater".

Value

an object of class htest.

Author(s)

Microsoft Corporation Microsoft Technical Support

See Also

rxChiSquaredTest, rxFisherTest, rxKendallCor, rxMultiTest, rxPairwiseCrossTab

Examples


 mtcarsDF <- rxFactors(datasets::mtcars, factorInfo = c("gear", "cyl", "vs"), 
                       varsToKeep = c("gear", "cyl", "vs"), sortLevels = TRUE)
 gearVsXtabs <- rxCrossTabs(~ gear : vs, data = mtcarsDF, returnXtabs = TRUE)
 rxRiskRatio(gearVsXtabs[1:2,])
 rxOddsRatio(gearVsXtabs[1:2,])