Linear Regression, Statistics, Machine Learning, Data Science, Technology.
estimate's variance var_beta_hat = np.linalg.inv(np.dot(np.transpose(X),X))*sigma_squared_hat SE = [] t_stats = [] p_values = [] CI_s = [] for i in range(len(beta)): #standard errors SE_i = np.sqrt(var_beta_hat[i,i]) SE.append(np.round(SE_i,3)) #t-statistics t_stat = np.round(beta_hat[i,0]/SE_i,3)