fix for negative values in the regression equation