-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
I was going through old exercises and i just noticed that while the exercise text asks us to compute and show the correlation matrices of both linear and rank correlation, only the computation of linear correlation is shown in the solution.
I suggest adding to the solution the following code snippet for completeness:
% Spearman's rank correlation
[rSpear, pvalSpear]= corr(X, "Type", "Spearman");
SpearTab= array2table(rSpear, "RowNames",Xvars,"VariableNames",Xvars);
disp("Spearman's rank correlation:")
disp(SpearTab)
The interpretation of the pvalues of linear correlation also happen to be missing from the solution, something like this could be added after displaying the linear correlation Pvalues to complete the solution:
% Assuming a significance level of 0.05
% Since all obtained p-values are less than 0.05, we reject the null
% hypothesis of zero correlation for every pair of variables at the 5%
% significance level.