Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do the p=0 mean in a correlation matrix using rcorr?

I've been using the rcorr function from the Hmisc package in R. I figured out how it works, I can extract the results, put them in a nice table. I looked at this post: p-values of correlation coefficients. But... Just one remaining thing is bugging me: what if the p-value = 0.0000? Even when you add more digits with a print statement, p-value = 0.

print(M_rcorr$P, digits = 20)

Does that mean it is an extremely significant correlation? I mean, are the computing skills of R maxed out, and that's why it'll just return "0"?

For instance below some results.

P
              Calcification Collagen Atheroma IPH    Macrophages Mastcells Neutrophils SMCs   Vessels
Calcification               0.0000   0.3390   0.0000 0.6488      0.0000    0.0063      0.0000 0.0000 
Collagen      0.0000                 0.0000   0.8866 0.7528      0.0000    0.0044      0.0000 0.0056 
Atheroma      0.3390        0.0000            0.0000 0.0000      0.7003    0.0000      0.0000 0.0063 
IPH           0.0000        0.8866   0.0000          0.0000      0.0474    0.0000      0.0000 0.0000 
Macrophages   0.6488        0.7528   0.0000   0.0000             0.0000    0.5536      0.0000 0.0000 
Mastcells     0.0000        0.0000   0.7003   0.0474 0.0000                0.0000      0.0001 0.0000 
Neutrophils   0.0063        0.0044   0.0000   0.0000 0.5536      0.0000                0.0000 0.0000 
SMCs          0.0000        0.0000   0.0000   0.0000 0.0000      0.0001    0.0000             0.0000 
Vessels       0.0000        0.0056   0.0063   0.0000 0.0000      0.0000    0.0000      0.0000        

And when I further inspect with "test$P", I'll get this:

              Calcification     Collagen     Atheroma          IPH  Macrophages    Mastcells
Calcification            NA 3.552714e-15 3.389508e-01 6.436717e-06 6.487711e-01 8.083783e-10
Collagen       3.552714e-15           NA 0.000000e+00 8.865855e-01 7.527929e-01 3.092686e-05
Atheroma       3.389508e-01 0.000000e+00           NA 0.000000e+00 3.623466e-09 7.003210e-01
IPH            6.436717e-06 8.865855e-01 0.000000e+00           NA 1.728324e-05 4.742716e-02
Macrophages    6.487711e-01 7.527929e-01 3.623466e-09 1.728324e-05           NA 1.545497e-11
Mastcells      8.083783e-10 3.092686e-05 7.003210e-01 4.742716e-02 1.545497e-11           NA
Neutrophils    6.319943e-03 4.367848e-03 1.532108e-14 0.000000e+00 5.535871e-01 0.000000e+00
SMCs           3.185481e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 1.081798e-04
Vessels        1.372520e-05 5.565543e-03 6.339438e-03 1.666998e-06 0.000000e+00 0.000000e+00

Thanks!

Sander

like image 636
Sander W. van der Laan Avatar asked Oct 17 '25 01:10

Sander W. van der Laan


1 Answers

Ok. I figured it out. The p-value will be zero when it's very, very, very, very small, so small that R can't compute it anymore. That's the practical part of the answer, it just means it's computationally not possible anymore. That said. It's probably statistically/mathematically impossible to get a p-value of exactly zero.

Thanks for your thoughts, guys!

like image 72
Sander W. van der Laan Avatar answered Oct 18 '25 17:10

Sander W. van der Laan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!