point_top
point_top

Reputation: 1

P-Value Representation Using corrplot()

The code I have written produces the image attached here. I'm wanting to make the asterisks smaller in size, but I am not sure how to do this. Also, is it possible to represent different levels of significance with the number of asterisks (*=0.1, **=0.05, ***=0.001). Thanks in advance. My code and figure are below as well.

alpha_corr <- cor(Schiller_Numerical, method = "pearson") 
alpha_p <- cor.mtest(alpha_corr, method = "pearson", conf.level = 0.95, exact = FALSE)
corrplot(
  cor(alpha_corr, method = "pearson"), 
  tl.col = "black",
  tl.srt = 60,
  method = 'square', 
  order = 'hclust', 
  type = 'lower', 
  diag = TRUE, 
  tl.cex = 1, 
  title = "Heatmap For All Data",
  mar=c(0,0,2,0),
  p.mat = alpha_p$p,
  sig.level = 0.05,
  insig = "label_sig") `

current output

Upvotes: 0

Views: 65

Answers (1)

Basti
Basti

Reputation: 1763

You can find all the useful parameters you required in the corrplot() documentation : https://www.rdocumentation.org/packages/corrplot/versions/0.92/topics/corrplot

You need to modify pch.cex to adjust asdterisk size, and sig.level to specify the signficance levels as a vector.

data(mtcars)
alpha_p <- cor.mtest(mtcars, method = "pearson", conf.level = 0.95, exact = FALSE)
corrplot(
  cor(mtcars, method = "pearson"), 
  tl.col = "black",
  tl.srt = 60,
  method = 'square', 
  order = 'hclust', 
  type = 'lower', 
  diag = TRUE, 
  tl.cex = 1, 
  title = "Heatmap For All Data",
  mar=c(0,0,2,0),
  p.mat = alpha_p$p,
  sig.level = c(0.001,0.05,0.1),
  insig = "label_sig",
  pch.cex=1)

enter image description here

Upvotes: 1

Related Questions