Description Usage Arguments Value Examples

View source: R/forEasySdcTable.R

A sort of correlation matrix useful to detect (hierarchical) relationships between the levels of factor variables.

1 |

`x` |
Input matrix or data frame containing the variables |

Output is a sort of correlation matrix.

Here we refer to ni as the number of present levels of variable i (the number of unique elements) and we refer to nij as the number of present levels obtained by crossing variable i and variable j (the number unique rows of x[,c(i,j)]).

The diagonal elements of the output matrix contains the number of present levels of each variable (=ni).

The absolute values of off-diagonal elements:

`0` |
when nij = ni*nj |

`1` |
when nij = max(ni,nj) |

`Other values` |
Computed as (ni*nj-nij)/(ni*nj-max(ni,nj)) |

So 0 means that all possible level combinations exist in the data and 1 means that the two variables are hierarchically related.

The sign of off-diagonal elements:

`positive` |
when ni<nj |

`negative` |
when ni>nj |

In cases where ni=nj elements will be positive above the diagonal and negative below.

1 2 3 4 5 6 |

SSBtools documentation built on Aug. 22, 2018, 5:05 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.