get_correlation function

Get correlation value in a tidy way