Very nice code thank you so much Eliya! A question in passing do you know why this online calculator http://easycalculation.com/statistics/r-squared.php can find r^2 (but not r) on values: "2,2,2,2" "2,2,2,1" Is that a bug on their software? Thanks again for your help!