Add hypothesis test scripts
This commit is contained in:
parent
597857055a
commit
be1f0aa784
28
scripts/perform_hypothesis_tests.py
Normal file
28
scripts/perform_hypothesis_tests.py
Normal file
@ -0,0 +1,28 @@
|
||||
from scipy.stats import mannwhitneyu
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
|
||||
|
||||
filename_left = "res/flowrate_left.csv"
|
||||
filename_right = "res/flowrate_right.csv"
|
||||
filename_both = "res/flowrate_both.csv"
|
||||
|
||||
|
||||
def main():
|
||||
df_left = pd.read_csv(filename_left)
|
||||
flowrate_left = np.array(df_left["flowrate"])
|
||||
|
||||
df_right = pd.read_csv(filename_right)
|
||||
flowrate_right = np.array(df_right["flowrate"])
|
||||
|
||||
df_both = pd.read_csv(filename_both)
|
||||
flowrate_both = np.array(df_right["flowrate"])
|
||||
|
||||
U_lr, p_lr = mannwhitneyu(flowrate_left, flowrate_both, method="exact")
|
||||
U_rb, p_rb = mannwhitneyu(flowrate_right, flowrate_both, method="exact")
|
||||
|
||||
print(f"Left-Right: p = {p_lr}")
|
||||
print(f"Right-Both: p = {p_rb}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Reference in New Issue
Block a user