## EXAMPLE 1:
## The birthwt data frame from the MASS package were collected at Baystate
## Medical Center, Springfield, Massachusetts USA in 1986. A logistic
## regression model is run to quantify the effect of smoking during pregancy
## and delivery of a low birth weight baby, controlling for the effect of race.
library(MASS)
dat.df <- birthwt; head(dat.df)
dat.glm <- glm(low ~ smoke + race, family = binomial, data = dat.df)
table(dat.df$low)
## The study outcome (low birthweight) is relatively common so we set rare =
## FALSE
epi.evalue(x = dat.glm, measure = "odds.ratio", rare = FALSE,
conf.level = 0.95)
## $or
## var est low upp
## 1 smoke 3.054692 1.507644 6.432485
## 2 race 1.748883 1.196771 2.611134
## $rr
## var est low upp
## 1 smoke 1.747768 1.227861 2.536234
## 2 race 1.322453 1.093970 1.615900
## $eval
## var est low upp
## 1 smoke 2.890975 1.756806 NA
## 2 race 1.975469 1.414596 NA
## After controlling for the effect of race, the odds of delivering a low
## birth weight baby for smokers was 3.05 (95% CI 1.51 to 6.43) times that of
## non-smokers.
## After controlling for the effect of race, the risk of delivering a low
## birth weight baby for smokers was 1.75 (95% CI 1.23 to 2.53) times that of
## non-smokers.
## An unmeasured confounder in this study would need to be associated with both
## smoking and delivery of a low birth weight baby by a risk ratio of at
## least 2.89 each, above and beyond the measured covariates, to completely
## explain the observed risk ratio of 1.75.
## The E-value for the lower confidence limit is 1.76. To reduce the
## association enough that the lower bound of the risk ratio confidence limit
## (1.23) would include the null, an unmeasured confounder would still need
## to have associations of about 1.76 with both the exposure and the outcome.
Run the code above in your browser using DataLab