constructCor: Calculate correlations between constructs.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/calc.r

Description

Different types of correlations can be requested: PMC, Kendall tau rank correlation, Spearman rank correlation.

Usage

1
2
3
4
5
6
constructCor(
  x,
  method = c("pearson", "kendall", "spearman"),
  trim = 20,
  index = FALSE
)

Arguments

x

repgrid object.

method

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".

trim

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.

index

Whether to print the number of the construct.

Value

Returns a matrix of construct correlations.

Author(s)

Mark Heckmann

See Also

elementCor

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
   # 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]

markheckmann/OpenRepGrid documentation built on April 30, 2021, 2:33 a.m.