source('../../Data/get_medical_savings_data.R') DF = get_medical_savings_data() DF = DF[order(DF$Percent_Savings), ] print(DF) ## The first regression: ## if( F ){ m = lm(New_Price ~ Current_Price, data=DF) print(summary(m)) plot(DF$Current_Price, DF$New_Price, type='p', xlab='Current Price', ylab='New Price') grid() abline(m) abline(a=0, b=1, col='green') } ## The second regression: ## if( T ){ m = lm(Percent_Savings ~ Current_Price, data=DF) print(summary(m)) plot(DF$Current_Price, DF$Percent_Savings, type='p', xlab='Current Price', ylab='Percent Savings') grid() abline(m) }