I am running a stratified analysis in epi.2by2. I need help in understanding why the cohort.count option works but the case.control does not (as shown below). Any help is greatly appreciated!
compute odds ratio adjusted for sex
alltable <- table(prob1$coffeedrinker, prob1$case, prob1$sex, dnn = c("Coffee", "Case", "Sex"))
alltable
, , Sex = 1
Case
Coffee 1 0
1 140 280
0 11 56
, , Sex = 0
Case
Coffee 1 0
1 207 275
0 9 32
adjtable <- epi.2by2(alltable, method = "cohort.count", digits = 2, conf.level = 0.95, units = 100,
-
interpret = FALSE, outcome = "as.columns")
print(adjtable)
Outcome + Outcome - Total Inc risk *
Exposed + 347 555 902 38.47 (35.28 to 41.73)
Exposed - 20 88 108 18.52 (11.69 to 27.14)
Total 367 643 1010 36.34 (33.36 to 39.39)
Point estimates and 95% CIs:
Inc risk ratio (crude) 2.08 (1.39, 3.11)
Inc risk ratio (M-H) 2.00 (1.33, 2.99)
Inc risk ratio (crude:M-H) 1.04
Odds ratio (crude) 2.75 (1.66, 4.55)
Odds ratio (M-H) 2.60 (1.57, 4.32)
Odds ratio (crude:M-H) 1.06
Attrib risk in the exposed (crude) * 19.95 (11.97, 27.94)
Attrib risk in the exposed (M-H) * 18.53 (-0.68, 37.73)
Attrib risk (crude:M-H) 1.08
M-H test of homogeneity of IRRs: chi2(1) = 0.008 Pr>chi2 = 0.928
M-H test of homogeneity of ORs: chi2(1) = 0.008 Pr>chi2 = 0.928
Test that M-H adjusted OR = 1: chi2(1) = 14.540 Pr>chi2 = <0.001
Wald confidence limits
M-H: Mantel-Haenszel; CI: confidence interval
- Outcomes per 100 population units
adjtablecc <- epi.2by2(alltable, method = "case.control", digits = 2, conf.level = 0.95, units = 100,
-
interpret = FALSE, outcome = "as.columns")
Error in .rowNamesDF<-
(x, value = value) : invalid 'row.names' length
In addition: Warning message:
In cbind(c1, c2, c3, c4) :
number of rows of result is not a multiple of vector length (arg 1)