psych (version 1.8.12)

manhattan: "Manhattan" plots of correlations with a set of criteria.

Description

A useful way of showing the strength of many correlations with a particular criterion is the Manhattan plot. This is just a plot of correlations ordered by some keying variable. Useful to understand the basis of items used in bestScales.

Usage

manhattan(x, criteria = NULL, keys = NULL, abs = TRUE, ylab = NULL, labels = NULL, 
log.p = FALSE,ci=.05, pch = 21, main = "Manhattan Plot of", adjust="holm",
ylim = NULL, ...)

Arguments

x

A matrix or data.frame of items or a correlation matrix.

criteria

What column names should be predicted. If a separate file, what are the variables to predict.

keys

a keys.list similar to that used in scoreItems

abs

Should we show the absolute value of the correlations.

ylab

If NULL, will label as either correlations or log (10) of correlations

labels

if NULL, will use the names of the keys

log.p

Should we show the correlations (log.p = FALSE) or the log of the probabilities of the correlations (TRUE)

ci

The probability for the upper and lower confidence intervals -- bonferroni adjusted

pch

The default plot chararcter is a filled circle

main

The title for each criterion

adjust

Which adjustment for multiple correlations should be applied ("holm", "bonferroni", "none")

ylim

If NULL will be the min and max of the data

Other graphic parameters

Value

The corelations or the log p values are returned (invisibily)

Details

When exploring the correlations of many items with a few criteria, it is useful to form scales from the most correlated items (see bestScales. To get a feeling of the distribution of items across various measures, we can display their correlations (or the log of the probabilities) grouped by some set of scale keys.

See Also

bestScales, error.dots

Examples

Run this code
# NOT RUN {
op <- par(mfrow=(c(2,3))) #we want to compare two different sets of plots
manhattan(bfi[1:25],bfi[26:28],labels=colnames(bfi)[1:25])
manhattan(bfi[1:25],bfi[26:28],log.p=TRUE)

#Do it again, but now show items by the keys.list
bfi.keys <-
  list(agree=c("-A1","A2","A3","A4","A5"),conscientious=c("C1","C2","C3","-C4","-C5"),
 extraversion=c("-E1","-E2","E3","E4","E5"),neuroticism=c("N1","N2","N3","N4","N5"),
 openness = c("O1","-O2","O3","O4","-O5"))
 manhattan(bfi[1:25],bfi[26:28],keys=bfi.keys)
manhattan(bfi[1:25],bfi[26:28],keys=bfi.keys,log.p=TRUE) 
par <- op



# }

Run the code above in your browser using DataCamp Workspace