library(epiR)
## Loading required package: survival
## Package epiR 2.0.43 is loaded
## Type help(epi.about) for summary information
## Type browseVignettes(package = 'epiR') to learn how to use epiR for applied epidemiological analyses
## 

In a hospital there were 10 cases of lung cancer among 120 smoking patients and one case of lung cancer among 120 non-smoking patients. Calculate the risk ratio of lung cancer in smokers versus non-smokers in this hospital.

ev.trt = 10
n.trt = 120
ev.ctrl = 1
n.ctrl = 120

RiskRatio = epi.dsl(ev.trt, n.trt, ev.ctrl, n.ctrl, names,
                    method = "risk.ratio",
                    conf.level = 0.95)$RR
## Warning in sqrt((1/(2 * (k - 2))) * (1 - (1/(3 * (k - 2)^2)))): NaNs produced
round(RiskRatio,3)
##   est lower  upper
## 1  10   1.3 76.906

The risk of lung cancer in smokers in 10 times(95%CI: 1.3-76.9) of the non-smokers in this hospital.

Example 2 In a hospital there were 1350 cases of lung cancer among 2646 smoking patients and 7 cases of lung cancer among 68 non-smoking patients. Calculate the odds ratio of smoking in patients with lung cancer versus others in this hospital.

ev.trt=1350; 
n.trt=2646; 
ev.ctrl=7; 
n.ctrl=68

OddsRatio = epi.dsl(ev.trt, n.trt, ev.ctrl, n.ctrl, 
                    names,
                    method = "odds.ratio",
                    conf.level = 0.95)$OR
## Warning in sqrt((1/(2 * (k - 2))) * (1 - (1/(3 * (k - 2)^2)))): NaNs produced
round(OddsRatio,3)
##     est lower  upper
## 1 9.077 4.137 19.918

The odds of smoking among lung cancer patients is 9.08(95%CI: 4.1-19.9) times of the other patients in the hospital.