R: Plot superimposed histograms of correlation coefficients

plotCorCoeff {PCIT} | R Documentation

## Plot superimposed histograms of correlation coefficients

### Description

Given a complete correlation matrix and a list of linear indices, superimpose the distributions of correlation coefficients, defined by their indices, on top of the distribution of all correlations.

Only data from the upper triangle is used to plot the distributions since a correlation matrix should be symmetrical. This means that any specified indices which fall within the diagonal or the lower triangle are effectively ignored.

### Usage

    	plotCorCoeff(m, idx, col, breaks="Scott", ...)

### Arguments

`m` | - A correlation matrix representing the raw data.
`idx` | - A list of indices for a subset of correlations to be superimposed on the plot.
`col` | - A vector of colours of equal length to idx. These are used to colour each of the distributions specified by the indices in idx.
`breaks` | - Defaults to "Scott", see the `hist` documentation for info and other options.
`...` | - Additional parameters to be passed to rect().

### Author(s)

Nathan S. Watson-Haigh

### See Also

`hist`

### Examples

    	data(PCIT)
    	m <- m[1:200,1:200]        # just use a small subset of the data
    	result <- pcit(m)

    	op <- par(mfrow=c(2,1))
    	plotCorCoeff(m, list("PCIT Significant" = idx(result)), col=c("black"))
    	plotCorCoeff(m, list("PCIT Significant" = idx(result),
    		"abs(adj) >= 0.7" = which(abs(m) >= 0.7)), col=c("black", "red"))
    	par(op)

[Package PCIT version 1.5-3 Index]