import numpy as np import scipy.stats as stats #from scipy.stats import norm #from scipy.stats import t time = [66, 37, 18, 31, 85, 63, 73, 83, 65, 80] print("Data of time variable is :", time) df=len(time)-1 s2 = np.var(time, ddof=1) chi_u = stats.chi2.ppf(0.975, df) chi_l = stats.chi2.ppf(0.025, df) print("Upper Critical Value of Chi2 w/ df=15 is :", chi_u) print("Lower Critical Value of Chi2 w/ df=15 is :", chi_l) LCL = (df*s2/chi_u) UCL = (df*s2/chi_l) print("Lower Value of 95% Confidence Interval is :", LCL) print("Upper Value of 95% Confidence Interval is :", UCL)