View source: R/convertmargin.binary.R
convertmargin.binary | R Documentation |
Function to convert non-inferiority margin between different summary measures with a binary outcome. Supported summary measures are risk difference (RD), risk ratio (RR), odds ratio (OR) and arcsine difference (AS).
convertmargin.binary(p.control.expected, NI.margin.original,
summary.measure.original, summary.measure.target)
p.control.expected |
The expected control event risk. |
NI.margin.original |
The non-inferiority margin on the original scale, i.e. using the original summary measure. |
summary.measure.original |
The original summary measure on which the non-inferiority margin is specified. One of "RD" (risk difference), "RR" (risk ratio), "OR" (odds ratio) or "AS" (arcsine difference). |
summary.measure.target |
The summary measure in which we want to convert the non-inferiority margin. One of "RD" (risk difference), "RR" (risk ratio), "OR" (odds ratio) or "AS" (arcsine difference). |
This function returns the non-inferiority margin in the target summary measure.
# Example: RD to AS
p0.expected<-0.05
NI.margin.RD<-0.05
NI.margin.AS<-convertmargin.binary(p0.expected, NI.margin.RD,"RD","AS")
# Example: RR to RD
NI.margin.RR<-2
NI.margin.RD<-convertmargin.binary(p0.expected, NI.margin.RR,"RR","RD")
# Example: RD to OR
NI.margin.OR<-convertmargin.binary(p0.expected, NI.margin.RD,"RD","OR")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.