Why is corrcoef returning a P-value of zero?
Ältere Kommentare anzeigen
I have two arrays, which both contain a significant number of zeros (they're observed and predicted data for sediment transport, which is often zero).
When I run corrcoef on them as-is, it returns an r-value of 0.82 and a p-value of zero... not just 0.0000 (as in, some very small number), but an actual '0' value. This seems wacky.
When I run corrcoef but exclude the elements where both arrays are zero, I get r = 0.79 and p = 10^-14.
Does anyone know what the difference is (I assume it has something to do with the way corrcoef treats zeros), and why the first approach yields a 0 p-value? Thanks so much!!
2 Kommentare
Jos (10584)
am 22 Apr. 2015
Can you describe the inputs to corrcoef more clearly? Are these vectors, arrays? Can you give an example?
dandan
am 22 Apr. 2015
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Correlation and Convolution finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!