1 #backward elimination 2 import statsmodels.regression.linear_model as sm 3 4 # add a column of ones as integer data type 5 data = np.append(arr = np.ones ((3755, 1)).astype (int), values = data, axis = 1) 6 7 # choose a significance level usually 0.05, if p>0.05 8 # for the highest values parameter, remove that value 9 x_opt = data[:,[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]] ols=sm.OLS (endog = salary, exog = x_opt).fit() 1 ols.summary()
1 #backward elimination 2 import statsmodels.regression.linear_model as sm 3 4 # add a column of ones as integer data type 5 data = np.append(arr = np.ones ((3755, 1)).astype (int), values = data, axis = 1) 6 7 # choose a significance level usually 0.05, if p>0.05 8 # for the highest values parameter, remove that value 9 x_opt = data[:,[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]] ols=sm.OLS (endog = salary, exog = x_opt).fit() 1 ols.summary()
Related questions
Question
Please explains in details the meaning of 2 attached file?
(attached file was running with Python Jupyter Notebook)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps