Calculates average relation