If the p value of a specific independent variable is less than 0.05 then it is considered to be a statistically significant variable. How to extract these variables from the dataset using Python ?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Sorry, you do not have a permission to ask a question, You must login to ask question.
You must login to add an answer.
Dipayan Sarkar
The statsmodels.regression.linear_model.OLSResults.pvalues should give you the pvalues of the respective variables. pvalues[0] should give you the pvalues of the 1st variable. You can filter out the names of the variables wherever pvalues[i]<0.05 and then use the list of variable names to filter out data as per need.
mahima_vaidya