#import pandas as pd import numpy as np import scipy.stats as stats #from scipy.stats import norm #from scipy.stats import t from scipy.stats.distributions import t as tdist small = [41, 45, 42, 62, 68, 54, 52, 55, 44, 60] large = [74,74,70,52,76,91,71,78,76,78,83,50,52,66,65,53,72] print("Data Frame of small is : ",f'\n{small}\n') print("Data Frame of large is : ",f'\n{small}\n') s_mean = np.mean(small) l_mean = np.mean(large) print("Mean of small is : ",s_mean) print("Mean of large is : ",l_mean) s_var = np.var(small, ddof=1) l_var = np.var(large, ddof=1) print("Variance of small is : ",s_var) print("Variance of large is : ",l_var) s_p = np.sqrt((9*s_var+16*l_var)/25) print("Standard deviation of pooled variance is : ",s_p) t_cal = (s_mean-l_mean)/(s_p*(np.sqrt((1/10)+(1/17)))) t_cal print("Calculated Value of t Statistic is : ",t_cal) res = stats.ttest_ind(a=small, b=large, equal_var=True, alternative='two-sided') print(res) t25 = tdist.ppf(0.025, df=25) t25 print("Critical value of t distribution w/ p=0.05 and df=25 is : ",t25)