View source: R/effect_measures.R
effect_measures | R Documentation |
Calculate the effect measures.
effect_measures(val0, val1, log = TRUE)
val0 |
Numeric, base value |
val1 |
Numeric, treated value |
log |
If TRUE (default) compute the effect measures on the log scale. If FALSE compute the effect measures on the natural scale. The risk difference measure (RD) is always on the natural scale. |
Calculate the effect measures and put them in a named numeric() vector.
If log = TRUE
the measures are RD (risk difference),
logRR (log of relative risk), logRR* (log of other relative risk) and
logOR (log of odds ratio). If log = FALSE
the measures are
RD (risk difference), logRR (relative risk),
logRR* (other relative risk) and logOR (odds ratio). See section 3.3 for
more details on these measures.
Named numeric vector.
val0 <- 0.25
val1 <- 0.5
# when log is required, we use default value
out <- effect_measures(val0, val1)
stopifnot(all(is.finite(out)))
# when natural scale is required, we use log = FALSE
out <- effect_measures(val0, val1, log = FALSE)
stopifnot(all(is.finite(out)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.