Calculate R squared