Template of Lecture 7, Problem 4 to calculate coefficient of determination
Creates a calcVariance() function