Distances between constructs / elements

Description
Distances between constructs and between elements are used as a measure of similarity. For elements, distance measure have the advantage that they are not affected by construct reflection as it is the case for correlations between elements (see elementCor). The following distance measures are available:


 * euclidean: Squared distance between the two vectors (L2 norm)
 * manhattan: Also called city-block-distance, absolute distance between the two vectors (L1 norm).
 * minkowski: The p norm, the pth root of the sum of the pth powers of the differences of the components.
 * maximum: Maximum distance between two components of x and y (supremum norm)
 * canberra: $$\sum(|x_i - y_i| / |x_i + y_i|)$$. Terms with zero numerator and denominator are omitted from the sum and treated as if the values were missing. This is intended for non-negative values (e.g. counts).
 * binary: The vectors are regarded as binary bits, so non-zero elements are on and zero elements are off. The distance is the proportion of bits in which only one is on amongst those in which at least one is on.

For most grid purposes, the first two options will suffice.

R-Code
In OpenRepGrid the function distance calculates various types of distances for constructs and for elements (the default is euclidean). The argument along</tt> determines if distances for 1) constructs or 2) elements are calculated. The default is to calculate distances for constructs:

> distance(fbb2003)

Distances between constructs

Distance method: euclidean

1    2     3     4     5     6     7     8     9 (1) clever - not bright         10.39  2.45  9.54  3.74  6.78  2.83  8.19  7.68 (2) disorganiz - organized            9.38  4.58  8.49  7.07  9.27  7.14  8.54 (3) listens - doesn't he                    8.89  2.45  7.21  3.46  8.43  8.43 (4) no clear v - clear view                       7.81  7.42  8.31  7.35  7.62 (5) understand - no underst                             7.07  4.00  7.28  7.28 (6) ambitious - no ambitio                                    6.32  5.57  6.56 (7) respected - not respec                                          7.94  6.71 (8) distant - warm                                                        5.10 (9) rather agg - not aggres

Distance for elements:

> distance(fbb2003, along=2)

Distances between elements

Distance method: euclidean

1    2     3     4     5     6     7     8 (1) self                      4.47  8.19  3.87  7.75  9.80  6.78  8.89 (2) my father                     10.15  4.36  8.83 11.22  4.00  9.33 (3) an old flame                         7.48  6.56  7.42 10.05  5.48 (4) an ethical person                          6.24  9.11  6.24  6.93 (5) my mother                                        9.06  8.83  4.36 (6) a rejected teacher                                    12.65  8.19 (7) as I would love to b                                         8.77 (8) a pitied person

To change the distance measure supply any unambigous string of the available distance methods to the argument dmethod</tt>. E.g. for the manhattan distance bewteen constructs: > distance(fbb2003, dmethod="manhattan")

Distances between constructs

Distance method: manhattan

1    2     3     4     5     6     7     8     9 (1) clever - not bright         28.00  4.00 23.00  8.00 16.00  6.00 15.00 17.00 (2) disorganiz - organized           24.00 11.00 22.00 16.00 24.00 19.00 19.00 (3) listens - doesn't he                   19.00  6.00 18.00  8.00 17.00 21.00 (4) no clear v - clear view                      19.00 19.00 19.00 18.00 18.00 (5) understand - no underst                            16.00  8.00 15.00 19.00 (6) ambitious - no ambitio                                   16.00 13.00 15.00 (7) respected - not respec                                         17.00 15.00 (8) distant - warm                                                       10.00 (9) rather agg - not aggres >

For other distance metrics: distance(fbb2003, dm="canb")           # canberra distance for constructs distance(fbb2003, dm="mink", p=3)      # minkowski metric to the power of 3  for constructs

distance(fbb2003, along=2, dm="man")   # manhattan distance between elements

If the distances are calculated for further processing, the printing to the console can be surpressed distance</tt> and the results can be saved into an object (here d). > d <- distance(fbb2003, out=0, trim=5) > d             (1) cle - not (2) dis - org (3) lis - doe (4) no  - cle (5) und - no  (6) amb - no (1) cle - not          0.00         10.39          2.45          9.54          3.74          6.78 (2) dis - org        10.39          0.00          9.38          4.58          8.49          7.07 (3) lis - doe         2.45          9.38          0.00          8.89          2.45          7.21 (4) no - cle          9.54          4.58          8.89          0.00          7.81          7.42 (5) und - no          3.74          8.49          2.45          7.81          0.00          7.07 (6) amb - no          6.78          7.07          7.21          7.42          7.07          0.00 (7) res - not         2.83          9.27          3.46          8.31          4.00          6.32 (8) dis - war         8.19          7.14          8.43          7.35          7.28          5.57 (9) rat - not         7.68          8.54          8.43          7.62          7.28          6.56 (7) res - not (8) dis - war (9) rat - not (1) cle - not         2.83          8.19          7.68 (2) dis - org         9.27          7.14          8.54 (3) lis - doe         3.46          8.43          8.43 (4) no - cle          8.31          7.35          7.62 (5) und - no          4.00          7.28          7.28 (6) amb - no          6.32          5.57          6.56 (7) res - not         0.00          7.94          6.71 (8) dis - war         7.94          0.00          5.10 (9) rat - not         6.71          5.10          0.00