What is the recommended way of calculating a standardized effect size for each gene in limma, preferably based on the fit object returned by lmFit
? Possibly, would that be something like
f$coefficients / f$stdev.unscaled
What is the recommended way of calculating a standardized effect size for each gene in limma, preferably based on the fit object returned by lmFit
? Possibly, would that be something like
f$coefficients / f$stdev.unscaled
Cohen's d is just logFC divided by the estimate of sigma, so in limma it is:
fit$coefficients / sqrt(fit$s2.post)
If there are two groups, and the coefficient holds the logFC between them, then this an empirical Bayes version of Cohen's d. The ordinary (not EB) Cohen's d would have fit$sigma
in place of sqrt(fit$s2.post)
.
Well, Cohen's d statistic is defined as the difference between two groups over the standard deviation. If you want to be consistent with the way other statistics are calculated in limma, you should use the posterior estimate of the standard deviation as calculated by eBayes()
, which would be accessed by sqrt(f$s2.post)
. For the ordinary sample standard deviations, use f$sigma
. As for the numerator, you should use the logFC value for whatever coefficient or contrast you are testing, which you can get from topTable()
. However, be careful if you are trying to compute this for a coefficient or contrast that does not represent a simple difference between two means, such as an interaction term.
Dear January,
im not an expert about these details but I think this post has some useful information
Thanks. I have seen this question. However, I am looking for a standardized effect size -- one that takes into account the variability. For example, a log fold change of 4 with CI ranging from 0.5 to 8 has a lower standardized effect size than a log fold change of 3 with CI from 2.5 to 3.5.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Thanks, I'll go with that.
Thanks, I'll go with that.
Thank you Gordon, a follow-up question is how to compute the the confidence interval for the Cohen'd in limma?