calculate mean of y