I was wondering if someone could please check this correlation task and see if I have done it correctly. The correlation is between age and salary. Many thanks.
Your answer is correct if the calculations are correct, but in terms of your answer, you should calculate the real correlation from your mean outputs where corr(x,y) = cov(x,y)/SQRT(var(x)var(y)). Since your cov(x,y) > 0 you do have positive correlation (since 789 > 34*11).
Use the formula Var[X] = E[x^2] - E[x]^2 and cov(x,y) = E[xy] - E[x]e[y]