Skip to contents

Convert the proportion of events in the treatment arms to risk differences and ratios (and vice versa)

Usage

convertRisks(
  eprop = NULL,
  etotal = NULL,
  rd = NULL,
  rr = NULL,
  or = NULL,
  r0 = NULL,
  n0,
  n1 = n0
)

Arguments

eprop

proportion of events in treatment arm

etotal

total number of events

rd

risk difference

rr

risk ratio

or

odds ratio

r0

risk in the control arm

n0

number of patients in the control arm

n1

number of patients in the treatment arm

Value

vector with risks in control and treatment arm (r0, r1), the risk difference (rd), risk ratio (rr) and odds ratio (or)

Examples

convertRisks(eprop=0.5,etotal=100,n0=200)
#>      eprop etotal  n0  n1   r0   r1 rd rr or
#> [1,]   0.5    100 200 200 0.25 0.25  0  1  1
convertRisks(eprop=0.6,etotal=100,n0=200)
#>      eprop etotal  n0  n1  r0  r1  rd  rr       or
#> [1,]   0.6    100 200 200 0.2 0.3 0.1 1.5 1.714286
convertRisks(rr=1.5,n0=200,r0=0.2)
#>      eprop etotal  n0  n1  r0  r1  rd  rr       or
#> [1,]   0.6    100 200 200 0.2 0.3 0.1 1.5 1.714286