## 15.11 Standard Error from p-value

When extracting effect sizes from published articles, it can sometimes happen that a study only reports the effect size (e.g., Cohen’s $$d$$), its $$p$$-value, but nothing more. To pool results in a meta-analysis (for example using the metagen function, see Chapter 4), however, we need some metric for the dispersion of the effect size, preferably the Standard Error ($$SE$$).

Standard errors can be calculated from Effect sizes such as Cohen’s $$d$$ or the Risk Ratio ($$RR$$) using the formula by Altman and Bland (2011). We have prepared a function called se.from.p for you which implements this formula. The function is part of the dmetar package. If you have the package installed already, you have to load it into your library first.

library(dmetar)

If you don’t want to use the dmetar package, you can find the source code for this function here. In this case, R doesn’t know this function yet, so we have to let R learn it by copying and pasting the code in its entirety into the console in the bottom left pane of RStudio, and then hit Enter ⏎. The function then requires the esc package to work.

Effect sizes based on a difference

Assuming we have a study with $$N=75$$ participants reporting an effect size of $$d=0.71$$ with $$p=0.013$$, we can calculate the standard error like this:

se.from.p(effect.size = 0.71,
p = 0.013,
N = 75,
effect.size.type= "difference")

Effect sizes based on a ratio

Assuming we have a study with $$N=200$$ participants reporting an effect size of $$OR=0.91$$ with $$p=0.05$$, we can calculate the standard error like this:

se.from.p(effect.size = 0.91,
p = 0.05,
N = 200,
effect.size.type= "ratio")

As you can see from the output, the function automatically calculates the log-transformed effect size and standard error, which is needed for usage in the metagen function (see Chapter 4.3.3).

### References

Altman, Douglas G, and J Martin Bland. 2011. “How to Obtain the Confidence Interval from a P Value.” BMJ 343. British Medical Journal Publishing Group: d2090.