Hi,
I would like to add the levels of significance (p value) to the heatmap of matrix corrrelation in a GRAPHICAL WAY. Just look at the this short link for reproducible dataset and further details I already posted on SO. Thank in advance
http://stackoverflow.com/questions/12196756/significance-level-added-to-matrix-correlation-heatmap-using-ggplot2
Hi,
I would like to add the levels of significance (p value) to the heatmap of matrix corrrelation in a GRAPHICAL WAY. Just look at the this short link for reproducible dataset and further details I already posted on SO. Thank in advance
http://stackoverflow.com/q/12196756/1288722
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Could you provide the code for the last plot you created in your answer on stackoverflow? Thanks
ggplot(nbar.m, aes(x=row, y=variable, fill=value, alpha=valuep))+geom_tile()+scale_fill_gradientn(colours=c("red", "yellow", "green"))+theme_bw()+scale_alpha(na.value=0, range=c(1,0), guide=F)
Something like that.
I reversed the scale_alpha for the p-value so the more significant stuff shows up brighter. I know the colors suck, but you can pick whatever you want using scale_gradientn(). I also hid the legend for alpha. I still think you should adjust the scale for alpha to have >.90 = dark, .70<=x<.90 = middle, and so on... maybe instead of continuous scale, use cut() here to set the alpha more precisely.
Just an idea. What you need is something that you can look at and determine what's important. I happen to like the way this turned out (other than the colors being a bit too bright).
B
I'm at a conference this week and have only had a chance to barely look at your code. You need to split the pearson's correlation and the significance of the correlation into two separate columns of data. I think once you do that, rather than have them as a combined factor, you supply scale_color_gradientn() with the r^2 and the significance level with scale_alpha_manual().It will be at least a few days before I can look at it properly though. Good luck.On Tue, Sep 4, 2012 at 9:44 PM, doctorate <ffsa...@gmail.com> wrote:
Hi Brandon,
good idea but how? please look again at the SO site to look at the code for my attempt on that and how to do the last two heatmaps with sign in ggplot2. Thanks in advance