data(BrendonSmall)
BrendonSmall$Calories = as.numeric(BrendonSmall$Calories)
BrendonSmall$Calories2 = BrendonSmall$Calories ^ 2
model.1 = lm(Sodium ~ Calories + Calories2, data = BrendonSmall)
efronRSquared(model.1)
efronRSquared(model.1, statistic="MAPE")
efronRSquared(actual=BrendonSmall$Sodium, residual=model.1$residuals)
efronRSquared(residual=model.1$residuals, predicted=model.1$fitted.values)
efronRSquared(actual=BrendonSmall$Sodium, predicted=model.1$fitted.values)
summary(model.1)$r.squared
Run the code above in your browser using DataLab