Skip to content

Solution of HW 7.1 #111

@BoschiGiacomo

Description

@BoschiGiacomo

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.

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions