r - listing p-values with correlations -


i got ordered list of correlation values matrix based on this question. include p-values this:

  var1 var2  freq  p-val 6 col3 col2  0.60  0.06 2 col2 col1 -0.38  0.28 3 col3 col1 -0.72  0.01 

i changed code use corr.test p-values, im not sure how put them in list.

require(psych) set.seed(1) df <- data.frame(     col1 = rnorm(10),     col2 = rnorm(10),     col3=rnorm(10) )  cors<-corr.test(df) listcorr<-as.data.frame.table(cors$r)[lower.tri(cors$r,diag=false),] listcorr$freq<-signif(listcorr$freq,2) listcorr<-listcorr[with(listcorr,order(-listcorr[,3])),] 

library(psych)  set.seed(1) df <- data.frame(   col1 = rnorm(10),   col2 = rnorm(10),   col3=rnorm(10) )  cors<-corr.test(df) listcorr<-as.data.frame.table(cors$r)[lower.tri(cors$r,diag=false),] listcorr$freq<-signif(listcorr$freq,2) listcorr$p.val <- signif((cors$p)[lower.tri(cors$p)], 2) listcorr<-listcorr[with(listcorr,order(-listcorr[,3])),]  > listcorr   var1 var2  freq p.val 6 col3 col2  0.60 0.064 2 col2 col1 -0.38 0.280 3 col3 col1 -0.72 0.020 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -