I have following data and code:
> mat <- matrix(c(120,230,84,70,130,83,13,26,18),3)
> dimnames(mat) <- list(c("good","fair","poor"),c("a","b","c"))
> mat
> mat
a b c
good 120 70 13
fair 230 130 26
poor 84 83 18
>
> chisq.test(mat)
Pearson's Chi-squared test
data: mat
X-squared = 11.411, df = 4, p-value = 0.02231
> library(vcd)
> mosaic(mat, shade=T)
The chi-squared test shows significant difference but no color is seen since residuals are small. With higher residuals, colors are seen:
?mosaic shows this information:
highlighting_fill: color vector or palette function used for a highlighted variable, if any.
How can I change fill color for above plot?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…