Analysis of Three-Way Data Matrices Based on Pairwise Relation Measures