Suppose I have the following 12 x 12 matrix called my_mat
:
0.21 | 0.9 | 0.56 | 0.9 | 0.22 | 1.46 | 9.94 | 47.61 | 63.36 | 65.09 | 65.21 | 65.22 |
1.1 | 1.09 | 0.41 | 1.07 | 0.44 | 1.23 | 12.21 | 58.51 | 77.85 | 79.97 | 80.13 | 80.14 |
1.16 | 0.62 | 0.54 | 0.59 | 0.58 | 1.11 | 12.59 | 65.26 | 86.84 | 89.2 | 89.38 | 89.39 |
0.91 | 0.62 | 0.62 | 0.62 | 0.67 | 1.2 | 6.85 | 69.4 | 92.3 | 94.75 | 94.96 | 94.99 |
0.71 | 0.67 | 0.67 | 0.67 | 0.72 | 1.28 | 7.38 | 71.7 | 95.01 | 97.25 | 97.55 | 97.67 |
0.7 | 0.7 | 0.55 | 0.7 | 0.75 | 1.33 | 7.7 | 66.97 | 90.48 | 92.32 | 92.55 | 93.06 |
0.9 | 0.56 | 0.21 | 0.22 | 0.22 | 9.94 | 1.23 | 11.74 | 31.86 | 33.34 | 29.71 | 27.78 |
1.09 | 0.41 | 1.1 | 0.44 | 0.44 | 12.21 | 1.11 | 71.7 | 5 | 6.32 | 5.11 | 4.54 |
0.62 | 0.54 | 1.16 | 0.58 | 0.58 | 7.7 | 7.7 | 71.7 | 1.3 | 2.42 | 2.15 | 1.98 |
0.62 | 0.62 | 0.91 | 0.67 | 0.67 | 1.23 | 1.23 | 1.11 | 0.47 | 1.75 | 1.76 | 1.73 |
0.67 | 0.67 | 0.71 | 0.72 | 0.72 | 1.11 | 1.11 | 1.2 | 0.64 | 1.86 | 1.85 | 1.81 |
If we plot the matrix as a heatmap, we can see there exists a definite 'hotspot' region, in the upper right quadrant of the data:
library(pheatmap)
pheatmap(my_mat)
I'd like some way to express with a p-value that a given square is or is not significantly different than other squares in the matrix.
Is there some way to do this in R? Can I obtain a matrix of p-values by doing this?