Skip to content

Commit

Permalink
further corrections to formula for combining tobacco and alcohol risk
Browse files Browse the repository at this point in the history
  • Loading branch information
dosgillespie committed Jun 1, 2023
1 parent 7bcb294 commit 2ee21a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions R/RRFunc.R
Original file line number Diff line number Diff line change
Expand Up @@ -771,15 +771,17 @@ RRFunc <- function(

# Combine the tobacco and alcohol relative risks
# accounting for the synergy index
data[ , (d) := (1 + ((get(d_alc) - 1) + (get(d_tob) - 1)) * get(d_si))]
#data[ , (d) := (1 + ((get(d_alc) - 1) + (get(d_tob) - 1)) * get(d_si))]
data[ , (d) := get(d_alc) * get(d_tob) * get(d_si)] # formula changed to align with corrected formula for the synergy index from Prabhu Am J Gastroenterol 2014; 109:822–827; doi: 10.1038/ajg.2014.71

data[ , (d_si) := NULL]

} else { # If synergy should not be accounted for

# Combine the tobacco and alcohol relative risks
# *without* accounting for the synergy index
data[ , (d) := 1 + ((get(d_alc) - 1) + (get(d_tob) - 1))]
#data[ , (d) := 1 + ((get(d_alc) - 1) + (get(d_tob) - 1))]
data[ , (d) := get(d_alc) * get(d_tob)]

}

Expand Down
2 changes: 1 addition & 1 deletion R/TobAlcInt.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ TobAlcInt <- function(
alc1_tob1 <- rr[ , alc1_tob1]

#si <- (alc1_tob1 - 1) / ((alc1_tob0 - 1) + (alc0_tob1 - 1))
si <- alc1_tob1 / (alc1_tob0 + alc0_tob1)
si <- alc1_tob1 / (alc1_tob0 * alc0_tob1) # corrected to match Prabhu Am J Gastroenterol 2014; 109:822–827; doi: 10.1038/ajg.2014.71;

} else {

Expand Down

0 comments on commit 2ee21a8

Please sign in to comment.