diss                  package:amap                  R Documentation

_C_o_m_p_u_t_e _a _d_i_s_s_i_m_i_l_a_r_i_t_y _m_a_t_r_i_x

_D_e_s_c_r_i_p_t_i_o_n:

     Compute a dissimilarity matrix from a data set (containing only
     factors).

_U_s_a_g_e:

     diss(x, w=rep(1,ncol(x)) )

_A_r_g_u_m_e_n_t_s:

       x: A matrix or data frame containing only factors.

       w: A vector of weight, by default each variable has got same
          weight

_D_e_t_a_i_l_s:

     Case of N individuals described by P categorical variables: each
     element (i,j) of the signed similarities array is computed by
     sommation over the P variables of the contributions of each
     variable, multiplied by the weight of the variable. The
     contribution of a given categorical variable is +1 if the
     individual i and j are in the same class, and is -1 if they are
     not.

_V_a_l_u_e:

     A dissimilarity matrix.

_A_u_t_h_o_r(_s):

     Antoine Lucas

_S_e_e _A_l_s_o:

     'Dist', 'pop'

_E_x_a_m_p_l_e_s:

     data <-
     matrix(c(1,1,1,1,1
             ,1,2,1,2,1
             ,2,3,2,3,2
             ,2,4,3,3,2
             ,1,2,4,2,1
             ,2,3,2,3,1),ncol=5,byrow=TRUE)

     diss(data)

     ## With weights
     diss(data,w=c(1,1,2,2,3))

