How do I test the significance of a population correlation coefficient?
4 ビュー (過去 30 日間)
古いコメントを表示
I have 29 pairs of vectors, each of length 8. For each pair, I can get the Spearman correlation coefficient and test its significance using the MATLAB function corr().
How do I test the significance of the population (N=29) correlation coefficient? Is there any MATLAB function that can do that and report p-values with confidence intervals? I checked the documentation, but couldn't find any MATLAB function which does that, for example, by doing Fisher transformation.
Following up on the above question, is it appropriate/correct to do a Wilcoxon signed rank test on the median rho, using signrank()?
0 件のコメント
回答 (1 件)
Ayush Aniket
2025 年 1 月 20 日
There is no direct fundtion in MATLAB for testing the significance of the population correlation coefficient.
To assess the significance of the overall population correlation, you can compute a mean Spearman correlation (the mean of the 29 rho values). Then, you can test whether this mean correlation is significantly different from zero (no correlation). You can Fisher transform each Spearman correlation coefficient to make the distribution more normal, then compute the mean Fisher-transformed values, and finally test the significance.
rho = [...]; % Your 29 Spearman correlation coefficients
N = length(rho);
% Apply Fisher transformation
z = 0.5 * log((1 + rho) ./ (1 - rho));
% Calculate mean and standard deviation of z
z_mean = mean(z);
z_std = std(z);
% Calculate standard error
SE_z = z_std / sqrt(N);
% z-test
z_score = z_mean / SE_z;
% p-value from z-test (two-tailed)
p_value = 2 * (1 - normcdf(abs(z_score)));
The normcdf function returns the cumulative distribution function (cdf) of the standard normal distribution. Refer the following documenation to read about the function: https://www.mathworks.com/help/stats/normcdf.html
Additionally, the Wilcoxon signed-rank test could be a reasonable approach if you know that the data may not follow a normal distribution and you prefer a non-parametric test.
Both methods are valid, and the choice depends on whether you believe the data follows a normal distribution (for the Fisher transformation) or if you prefer a non-parametric approach (Wilcoxon test).
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Hypothesis Tests についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!