This file contains hidden or 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
import numpy as np | |
r = - 0.654 # Pearson's r from sampled data | |
z_prime = 0.5 * np.log((1 + r) / (1 - r)) | |
n = 34 # Sample size | |
se = 1 / np.sqrt(n - 3) # Sample standard error | |
CI_lower = z_prime - z_critical * se | |
CI_upper = z_prime + z_critical * se |
This file contains hidden or 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
import scipy.stats | |
import numpy as np | |
alpha = 0.05 / 2 # Two-tail test | |
z_critical = scipy.stats.norm.ppf(1 - alpha) |
This file contains hidden or 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
import scipy.stats | |
n = 25 # Number of samples n | |
df = n - 2 # Degrees of freedom | |
alpha = 0.05 # Significant level | |
# Non-direction tests for computing t-critical value | |
t_critical = scipy.stats.t.ppf(1 - alpha / 2, df) |
NewerOlder