Compute R^2 of a regression