R FUNCTIONS FOR REGRESSION ANALYSIS