Created
September 15, 2018 03:21
-
-
Save jcheong0428/e3cd3c2c13932a3c30ad910eca0424b4 to your computer and use it in GitHub Desktop.
Correcting degrees of freedom from lmer output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Correct p-value by adjusting degrees of freedom. | |
# Degrees of freedom is divided by two and then looked up | |
# Reference: | |
# https://www.ncbi.nlm.nih.gov/pubmed/27751943 | |
# Chen, G., Taylor, P. A., Shin, Y. W., Reynolds, R. C., & Cox, R. W. (2017). Untangling the relatedness among correlations, Part II: Inter-subject correlation group analysis through linear mixed-effects modeling. Neuroimage, 147, 825-840. | |
from scipy.stats import t | |
tt = 9.83 | |
df = 17.6/2. | |
pval = t.sf(np.abs(tt), df)*2 | |
print(pval) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment