
Different types of correlations can be requested: PMC, Kendall tau rank correlation, Spearman rank correlation.
constructCor(x, method = c("pearson", "kendall", "spearman"), trim = 20,
index = FALSE)
repgrid
object.
A character string indicating which correlation coefficient
is to be computed. One of "pearson"
(default),
"kendall"
or "spearman"
, can be abbreviated.
The default is "pearson"
.
The number of characters a construct is trimmed to (default is
20
). If NA
no trimming occurs. Trimming
simply saves space when displaying correlation of constructs
with long names.
Whether to print the number of the construct.
Returns a matrix of construct correlations.
# NOT RUN {
# three different types of correlations
constructCor(mackay1992)
constructCor(mackay1992, method="kendall")
constructCor(mackay1992, method="spearman")
# format output
constructCor(mackay1992, trim=6)
constructCor(mackay1992, index=TRUE, trim=6)
# save correlation matrix for further processing
r <- constructCor(mackay1992)
r
print(r, digits=5)
# accessing the correlation matrix
r[1, 3]
# }
Run the code above in your browser using DataLab