Content Disclaimer Copyright @2020. All Rights Reserved. |
Links : Home Index (Subjects) Contact StatsToDo
Explanations and References IntroductionIn binomial statistics, the relationship between the number of cases with a positive characteristics (NPos) and that without the positive characteristics (NNeg) can be expressed in two ways
This page provides the algorithms for such conversions DefinitionsNumbers
Comprison of binomial outcomes between two groups are common, particularly when collating Evidence for medical management. Usually there is a passive group, which represents the baseline or population reference, and the indexed group, which represents the group of interest or that receiving a new intervention. On this page, in order to avoid confusion, the indexed group is named group 1, and the baseline or passive group group 2 For example: In a controlled trial, 20 patients were given a new drug, and 10 improved, while 30 patients were given a placebo, and 6 improved.
The indecis can be decomposed as follows, using the same example
ReferencesJournal Evidence-Based Medicine 1997;2:103-4. Morris JA, Gardner MJ (1988) Calculating confidence intervals for relative risks (Odds ratios) and standardised ratio and rates. BMJ 296 7th May. 1313-1316 Sistrom CL, Garvan CW (2004) Proportions, Odds, and Risk. Radiology 230:12-19 Schechtman E (2002) Odds Ratio, Relative Risk, Absolute Risk Reduction, and the Number Needed to Treat - Which of These Should We Use? Value in Health 5:5:431-436
Convert Odds to Risks : Convert from Risk Difference & PEER : Convert from Risk Ratio & PEER : Convert from Odds Ratio & PEER :
The five programs for Odds/Risks conversion in R codes are as follows
Program 1: Conversion of risks to odds myDat = (" Risks 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ") df <- read.table(textConnection(myDat),header=TRUE) # conversion to data frame df$Odds <- df$Risks / (1 - df$Risks) df # display risk to odds resultsThe results are > df # display risk to odds results Risks Odds 1 0.1 0.1111111 2 0.2 0.2500000 3 0.3 0.4285714 4 0.4 0.6666667 5 0.5 1.0000000 6 0.6 1.5000000 7 0.7 2.3333333 8 0.8 4.0000000 9 0.9 9.0000000Program 2: Conversion of Odds to Risks myDat = (" Odds 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 ") df <- read.table(textConnection(myDat),header=TRUE) # conversion to data frame df$Risks <- df$Odds / (1 + df$Odds) df # display risk to odds resultsThe results are > df # display risk to odds results Odds Risks 1 0.5 0.3333333 2 1.0 0.5000000 3 1.5 0.6000000 4 2.0 0.6666667 5 2.5 0.7142857 6 3.0 0.7500000 7 3.5 0.7777778 8 4.0 0.8000000 9 4.5 0.8181818Program 3: Convert from Risk Difference (RD) and Patient Expected Event Rate (PEER) myDat = (" RD PEER -0.1 0.2 0.2 0.2 -0.3 0.5 -0.4 0.5 0.5 0.1 0.6 0.2 0.7 0.1 0.8 0.1 0.9 0.05 ") df <- read.table(textConnection(myDat),header=TRUE) # conversion to data frame risk2 <- df$PEER risk1 <- df$RD + df$PEER nnt <- ceiling(1 / abs(df$RD)) riskRatio <- risk1 / risk2 odd1 <- risk1 / (1 - risk1) odd2 <- risk2 / (1 - risk2) oddsRatio <- odd1 / odd2 df$Risk1 <- risk1 df$Risk2 <- risk2 df$NNT <- nnt df$RR <- riskRatio df$Odd1 <- odd1 df$Odd2 <- odd2 df$OR <- oddsRatio df # display results of conversion from Risk DifferenceThe results are as follows > df # display results of conversion from Risk Difference RD PEER Risk1 Risk2 NNT RR Odd1 Odd2 OR 1 -0.1 0.20 0.10 0.20 10 0.5 0.1111111 0.25000000 0.4444444 2 0.2 0.20 0.40 0.20 5 2.0 0.6666667 0.25000000 2.6666667 3 -0.3 0.50 0.20 0.50 4 0.4 0.2500000 1.00000000 0.2500000 4 -0.4 0.50 0.10 0.50 3 0.2 0.1111111 1.00000000 0.1111111 5 0.5 0.10 0.60 0.10 2 6.0 1.5000000 0.11111111 13.5000000 6 0.6 0.20 0.80 0.20 2 4.0 4.0000000 0.25000000 16.0000000 7 0.7 0.10 0.80 0.10 2 8.0 4.0000000 0.11111111 36.0000000 8 0.8 0.10 0.90 0.10 2 9.0 9.0000000 0.11111111 81.0000000 9 0.9 0.05 0.95 0.05 2 19.0 19.0000000 0.05263158 361.0000000Program 4: Convert from Risk Ratio (Relative Risks, RR) and Patient Expected Event Rate (PEER) myDat = (" RR PEER 0.5 0.2 2.0 0.2 0.4 0.5 0.2 0.5 6.0 0.1 4.0 0.2 8.0 0.1 9.0 0.1 19.0 0.05 ") df <- read.table(textConnection(myDat),header=TRUE) # conversion to data frame risk2 <- df$PEER risk1 <- df$RR * df$PEER riskDiff <- risk1 - risk2 nnt <- ceiling(1 / abs(riskDiff)) odd1 <- risk1 / (1 - risk1) odd2 <- risk2 / (1 - risk2) oddsRatio <- odd1 / odd2 df$Risk1 <- risk1 df$Risk2 <- risk2 df$RD <- riskDiff df$NNT <- nnt df$Odd1 <- odd1 df$Odd2 <- odd2 df$OR <- oddsRatio df # Display results from Risk Ratio conversionsThe results are > df # Display results from Risk Ratio conversions RR PEER Risk1 Risk2 RD NNT Odd1 Odd2 OR 1 0.5 0.20 0.10 0.20 -0.1 10 0.1111111 0.25000000 0.4444444 2 2.0 0.20 0.40 0.20 0.2 5 0.6666667 0.25000000 2.6666667 3 0.4 0.50 0.20 0.50 -0.3 4 0.2500000 1.00000000 0.2500000 4 0.2 0.50 0.10 0.50 -0.4 3 0.1111111 1.00000000 0.1111111 5 6.0 0.10 0.60 0.10 0.5 2 1.5000000 0.11111111 13.5000000 6 4.0 0.20 0.80 0.20 0.6 2 4.0000000 0.25000000 16.0000000 7 8.0 0.10 0.80 0.10 0.7 2 4.0000000 0.11111111 36.0000000 8 9.0 0.10 0.90 0.10 0.8 2 9.0000000 0.11111111 81.0000000 9 19.0 0.05 0.95 0.05 0.9 2 19.0000000 0.05263158 361.0000000Program 5: Convert from Odds Ratio (OR) and Patient Expected Event Rate (PEER) myDat = (" OR PEER 0.44 0.2 2.67 0.2 0.25 0.5 0.11 0.5 13.5 0.1 16 0.2 36 0.1 81 0.1 361 0.05 ") df <- read.table(textConnection(myDat),header=TRUE) # conversion to data frame risk2 <- df$PEER odd2 <- risk2 / (1 - risk2) odd1 <- df$OR * odd2; risk1 <- odd1 / (1 + odd1) riskDiff <- risk1 - risk2 riskRatio <- risk1 / risk2 nnt <- ceiling(1 / abs(riskDiff)) df$Odd1 <- odd1 df$Odd2 <- odd2 df$Risk1 <- risk1 df$Risk2 <- risk2 df$RD <- riskDiff df$NNT <- nnt df$RR <- riskRatio df # Display results of conversion from Odds RatioThe results are > df # Display results of conversion from Odds Ratio OR PEER Odd1 Odd2 Risk1 Risk2 RD NNT RR 1 0.44 0.20 0.1100 0.25000000 0.0990991 0.20 -0.1009009 10 0.4954955 2 2.67 0.20 0.6675 0.25000000 0.4002999 0.20 0.2002999 5 2.0014993 3 0.25 0.50 0.2500 1.00000000 0.2000000 0.50 -0.3000000 4 0.4000000 4 0.11 0.50 0.1100 1.00000000 0.0990991 0.50 -0.4009009 3 0.1981982 5 13.50 0.10 1.5000 0.11111111 0.6000000 0.10 0.5000000 2 6.0000000 6 16.00 0.20 4.0000 0.25000000 0.8000000 0.20 0.6000000 2 4.0000000 7 36.00 0.10 4.0000 0.11111111 0.8000000 0.10 0.7000000 2 8.0000000 8 81.00 0.10 9.0000 0.11111111 0.9000000 0.10 0.8000000 2 9.0000000 9 361.00 0.05 19.0000 0.05263158 0.9500000 0.05 0.9000000 2 19.0000000 |