P 4 Hypothesis Testing

 

import numpy as np
import pandas as pd
from scipy import stats

path="C:\\Users\\test1.xlsx"

data = pd.read_excel(path)

group_a_scores = data['Group A']
group_b_scores = data['Group B']

alpha = 0.05
t_statistic, p_value = stats.ttest_ind(group_a_scores, group_b_scores)

if p_value <= alpha:
   print("Reject the null hypothesis. There is a significant difference.")
else:
    print("Fail to reject the null hypothesis. No significant difference.")

print("T-statistic:", t_statistic)
print("P-value:", p_value)