I am doing regression analysis with stepwiselm for some flow data. As predictors I have the flow from a previous pumping station, rain data, the hour and the day of the week. For flow and rain I have 25 predictors with different lag options (i.e. I have 25 columns for both rain and flow that have been delayed from 0 to 24 hours). This is all in a 4704*80 table called 'DataTable' and I would like to use stepwiselm to pick the best combination of these predictors. The code is:
mdl = stepwiselm(DataTable,'linear')
However, the rain can not have a negative effect on the flow and therefore I would like to exclude any rain predictors from the results of stepwiselm that have negative coefficients. Somehow I get rain predictors with low p-values (less than 0.05) and negative coefficients. How do I remove those?
Best Answer