Learn R Programming

gap (version 1.6)

ci2ms: Effect size and standard error from confidence interval

Description

Effect size and standard error from confidence interval

Usage

ci2ms(ci, logscale = TRUE, alpha = 0.05)

Value

Based on CI, the function provides a list containing estimates

  • m effect size (log(OR))

  • s standard error

  • direction a decrease/increase (-/+) sign such that sign(m)=-1, 0, 1, is labelled "-", "0", "+", respectively as in PhenoScanner.

Arguments

ci

confidence interval (CI). The delimiter between lower and upper limit is either a hyphen (-) or en dash (–).

logscale

a flag indicating the confidence interval is based on a log-scale.

alpha

Type 1 error.

Details

Effect size is a measure of strength of the relationship between two variables in a population or parameter estimate of that population. Without loss of generality, denote m and s to be the mean and standard deviation of a sample from \(N(\mu,\sigma^2)\)). Let \(z \sim N(0,1)\) with cutoff point \(z_\alpha\), confidence limits L, U in a CI are defined as follows, $$ \begin{aligned} L & = m - z_\alpha s \cr U & = m + z_\alpha s \end{aligned} $$ \(\Rightarrow\) \(U + L = 2 m\), \(U - L=2 z_\alpha s\). Consequently, $$ \begin{aligned} m & = \frac{U + L}{2} \cr s & = \frac{U - L}{2 z_\alpha} \end{aligned} $$ Effect size in epidemiological studies on a binary outcome is typically reported as odds ratio from a logistic regression or hazard ratio from a Cox regression, \(L\equiv\log(L)\), \(U\equiv\log(U)\).

Examples

Run this code
# rs3784099 and breast cancer recurrence/mortality
ms <- ci2ms("1.28-1.72")
print(ms)
# Vector input
ci2 <- c("1.28-1.72","1.25-1.64")
ms2 <- ci2ms(ci2)
print(ms2)

Run the code above in your browser using DataLab