#use the msq data set that shows the structure of energetic and tense arousal
small.msq <- msq[ c("active", "energetic", "vigorous", "wakeful", "wide.awake", 
"full.of.pep", "lively", "sleepy", "tired", "drowsy","intense", "jittery", "fearful",
 "tense", "clutched.up", "quiet", "still",    "placid", "calm", "at.rest") ]
small.R <- cor(small.msq,use="pairwise")
keys <- make.keys(small.R,list(
EA = c("active", "energetic", "vigorous", "wakeful", "wide.awake", "full.of.pep",
       "lively", "-sleepy", "-tired", "-drowsy"),
TA =c("intense", "jittery", "fearful", "tense", "clutched.up", "-quiet", "-still", 
       "-placid", "-calm", "-at.rest") ,
high.EA = c("active", "energetic", "vigorous", "wakeful", "wide.awake", "full.of.pep",
       "lively"),
low.EA =c("sleepy", "tired", "drowsy"),
lowTA= c("quiet", "still", "placid", "calm", "at.rest"),
highTA = c("intense", "jittery", "fearful", "tense", "clutched.up")
   ))
      
adjusted.scales <- scoreOverlap(keys,small.R)
#compare with unadjusted
confounded.scales <- cluster.cor(keys,small.R)
summary(adjusted.scales)
summary(confounded.scales)Run the code above in your browser using DataLab