🔨 Refactors analyzing into one function

This commit is contained in:
Daniel Svitan
2024-12-15 12:00:04 +01:00
parent d03ef94d4f
commit bade4ec45c
3 changed files with 40 additions and 30 deletions

18
analyze.py Normal file
View File

@@ -0,0 +1,18 @@
from typing import List
import numpy as np
import scipy.stats as stats
def analyze(name: str, data: List[np.ndarray]):
F, p = stats.f_oneway(*data)
print(f"F-stats for {name}: {F}")
print(f"p-value for {name}: {p}")
if p > 0.05:
print("statistically insignificant\n")
return
print("statistically significant")
tukey_results = stats.tukey_hsd(*data)
print(tukey_results)