-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbox4.py
39 lines (32 loc) · 951 Bytes
/
box4.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import numpy as np
import pinn
if __name__ == "__main__":
# study design
rois = 50
# fixed a priori
effect_size = 0.5
alpha_0 = 0.05
# measured
rho_ij = 0.25
rho_uv = 0.81
# computations
comparisons = rois * (rois - 1) // 2
alpha = alpha_0 / comparisons
e_ij_n = np.ceil(
pinn.power.tt_ind_solve_power(
effect_size=effect_size, alpha=alpha, power=0.8, reliability=rho_ij
)
)
e_uv_n = np.ceil(
pinn.power.tt_ind_solve_power(
effect_size=effect_size, alpha=alpha, power=0.8, reliability=rho_uv
)
)
print(
"Sample size required for edge {ij} with reliability "
f"{rho_ij} to attain 80% power for effect size {effect_size} is {e_ij_n:.0f}"
)
print(
"Sample size required for edge {uv} with reliability "
f"{rho_uv} to attain 80% power for effect size {effect_size} is {e_uv_n:.0f}"
)