# dm: Dominance or Difference Matrix Creation In orddom: Ordinal Dominance Statistics

## Description

Returns a dominance or difference matrix based on the comparison of all values of two 1-column matrices x and y

## Usage

 `1` ```dm(x, y, diff=FALSE) ```

## Arguments

 `x` 1 column matrix with n_1 values (e.g. from group X) `y` 1 column matrix with n_2 values (e.g. from group Y) `diff` If argument is set to true, the function will return a difference matrix. Otherwise, a dominance matrix is produced.

## Details

Each difference matrix cell value d_{ij} is calculated as y_j-x_i across all i=1,2,3,...,n_1 values (=rows) of x and i=1,2,3,...,n_2 values (=rows) of y. Dominance matrix cell values are calculated as sign(y_j-x_i).

## Value

Returns difference or dominance matrix with X values as rownames and with Y values as columnnames

Jens Rogmann

## References

Cliff, N. (1996). Ordinal Methods for Behavioral Data Analysis. Mahwah, NJ: Lawrence Erlbaum.

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29``` ```## Not run: > x<-t(matrix(c(1,1,2,2,2,3,3,3,4,5),1)) > y<-t(matrix(c(1,2,3,4,4,5),1)) > dm(x,y,diff=TRUE) 1 2 3 4 4 5 1 0 -1 -2 -3 -3 -4 1 0 -1 -2 -3 -3 -4 2 1 0 -1 -2 -2 -3 2 1 0 -1 -2 -2 -3 2 1 0 -1 -2 -2 -3 3 2 1 0 -1 -1 -2 3 2 1 0 -1 -1 -2 3 2 1 0 -1 -1 -2 4 3 2 1 0 0 -1 5 4 3 2 1 1 0 > dm(x,y) 1 2 3 4 4 5 1 0 -1 -1 -1 -1 -1 1 0 -1 -1 -1 -1 -1 2 1 0 -1 -1 -1 -1 2 1 0 -1 -1 -1 -1 2 1 0 -1 -1 -1 -1 3 1 1 0 -1 -1 -1 3 1 1 0 -1 -1 -1 3 1 1 0 -1 -1 -1 4 1 1 1 0 0 -1 5 1 1 1 1 1 0 ## End(Not run) ```