# What type of test does matlab use to obtain corr pvalue?

36 Ansichten (letzte 30 Tage)
Luis Jesús Olvera Lazcano am 28 Mai 2024 um 2:08
Kommentiert: Luis Jesús Olvera Lazcano am 31 Mai 2024 um 4:20
According to the documentation, the correlation pvalues indicate "If pval(a,b) is small (less than 0.05), then the correlation rho(a,b) is significantly different from zero."
But it's never specified which test was used to obtain the pvlaues.
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

Manikanta Aditya am 28 Mai 2024 um 4:09
In MATLAB, the function 'corr' can compute the correlation coefficient and its p-value. The p-value indicates the probability of obtaining a correlation as extreme as the observed value under the null hypothesis that the true correlation is zero. The test used to obtain the p-value for the correlation coefficient depends on the type of correlation you are computing.
So, the type of test used to obtain the p-values in MATLAB depends on the function used and the type of correlation (Pearson, Kendall, Spearman, etc.) being computed.
Here's an example of how to compute the Pearson correlation coefficient and its p-value:
% Example data
x = [1, 2, 3, 4, 5];
y = [2, 4, 6, 8, 10];
% Compute Pearson correlation and p-value
[R, P] = corr(x', y');
% Display results
disp(['Pearson correlation coefficient: ', num2str(R)]);
Pearson correlation coefficient: 1
disp(['P-value: ', num2str(P)]);
P-value: 1.4043e-24
MATLAB uses a t-test to compute the p-value for the Pearson correlation coefficient. For Spearman and Kendall correlation coefficients, MATLAB uses rank-based methods and approximations for hypothesis testing.
Refer the following documentation to know more Correlation coefficients:
I hope this helps.
##### 1 Kommentar-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden
Luis Jesús Olvera Lazcano am 31 Mai 2024 um 4:20
Thank you so much! That's what I was looking for!

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Noncentral t Distribution finden Sie in Help Center und File Exchange

R2022b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by