se.from.p | R Documentation |
This function calculates the standard error of an effect size provided the exact
p
-value and (continuous) effect size according to the formula
by Altman and Bland (2011).
se.from.p(effect.size, p, N, effect.size.type = 'difference',
calculate.g = FALSE)
effect.size |
Numeric vector or single number. The effect size, such as the
standardized mean difference, Hedges' |
p |
Numeric vector or single number. The exact |
N |
Numeric vector or single number. The total number of samples used to
calculate the effect size/ |
effect.size.type |
The type of effect sizes provided in |
calculate.g |
Logical. Calculates the standardized mean difference
corrected for small sample bias (Hedges' |
This function calculates the standard error, standard deviation and 95% confidence
interval of an effect size given the effect size and exact p
-value. The function can be used for:
effect sizes based on differences (e.g., mean differences) by setting effect.size.type
to "difference"
, or
effect sizes based on ratios (e.g. risk ratios, odds ratios or
hazard ratios) by setting effect.size.type
to "ratio"
. When ratios are used, the
function returns the log-transformed effect sizes, standard error, standard deviation and confidence interval,
which can be used for meta-analytic pooling using the metagen
function,
along with the original effect size and confidence interval.
A dataframe containing the following columns:
(log)EffectSize
: The input effect size. Log-transformed if effect.size.type
is "ratio"
.
Hedges.g
: The calculated Hedges' g values (only if calculate.g=TRUE
).
(log)StandardError
: The standard error (SE) for the effect size. Log-transformed if effect.size.type
is "ratio"
.
(log)LLCI
and (log)ULCI
: The lower and upper 95% confidence interval of the effect size. Log-transformed if effect.size.type="ratio"
.
Mathias Harrer & David Daniel Ebert
Altman D.G. & Bland J.M. (2011) How to obtain the confidence interval of a p value. BMJ 343:d2090.
# Example 1: one single effect size
se.from.p(effect.size = 0.71, p = 0.013, N = 75,
effect.size.type= "difference", calculate.g = TRUE)
# Example 2: vector of effect sizes (Odds Ratio)
effect.size = c(0.91, 1.01, 0.72, 0.43)
p = c(0.05, 0.031, 0.001, 0.09)
N = c(120, 86, 450, 123)
se.from.p(effect.size = effect.size, p = p, N = N,
effect.size.type = "ratio")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.