How to select significant input variables for a multiple regression model in R?

r
regression

#1

Hello,

I am new to regression and wanted to ask how we can select important and significant input variables for our model through multiple linear regression using R? I have a large dataset and it is not possible to manually select all the intuitive significant variables.

Thanks.


#2

You can perform stepwise selection (forward, backward, both) using the stepAIC( ) function from the MASS package. stepAIC( ) performs stepwise model selection by exact AIC.