It is helpful to be able to view your data. When you have several variables, you can form a scatterplot matrix with, for example, pairs()
. A scatterplot matrix gives you a set of 2D marginal projections of your data.
set.seed(8092)
X <- matrix(rnorm(80), ncol=4)
pairs(X)
You can also have data for different groups and want to compare their distributions. Two such distributions can be compared with a qq-plot.
set.seed(4415)
group1 <- rnorm(20)
group2 <- rnorm(20)
qqplot(group1, group2)
abline(c(0,1))
When you have several groups, it would be convenient if there were a pairs-type plot that would display a matrix of qq-plots.
colnames(X) <- c("group1", "group2", "group3", "group4")
qq.pairs(X)
Is there such a function? Is there a straightforward way to code it from scratch?