mdspca                  package:psy                  R Documentation

_G_r_a_p_h_i_c_a_l _r_e_p_r_e_s_e_n_t_a_t_i_o_n _o_f _a _c_o_r_r_e_l_a_t_i_o_n _m_a_t_r_i_x _u_s_i_n_g _a _P_r_i_n_c_i_p_a_l _C_o_m_p_o_n_e_n_t _A_n_a_l_y_s_i_s

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

     Similar to many routines, the interest is in the possible
     representation of both variables and subjects (and by the way
     categorical variables) with active and supplementary points.
     Missing data are omitted.

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

     mdspca(datafile, supvar="no", supsubj="no", namesupvar=colnames(supvar,do.NULL=FALSE), namesupsubj=colnames(supsubj, do.NULL=FALSE), dimx=1, dimy=2, cx=0.75)

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

datafile: name of datafile

  supvar: matrix corresponding to supplementary variables (if any),
          supvar="no" by default

 supsubj: matrix corresponding to supplementary subjects (if any),
          supsubj="no" by default

namesupvar: names of the points corresponding to the supplementary
          variables

namesupsubj: names of the points corresponding to the supplementary
          subjects

    dimx: rank of the component displayed on the x axis (1 by default)

    dimy: rank of the component displayed on the y axis (2 by default)

      cx: size of the lettering (0.75 by default, 1 for bigger letters,
          0.5 for smaller)

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

     A diagram (two diagrams if supplementary subjects are used)

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

     Bruno Falissard

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

     data(sleep)

     mdspca(sleep[,c(2:5,7:11)])
     ## three consistent groups of variables, paradoxical sleep (in other words: dream)
     ## is negatively correlated with danger

     mdspca(sleep[,c(2:5,7:11)],supvar=sleep[,6],namesupvar="Total.sleep",supsubj=sleep[,1],namesupsubj="",cx=0.5)
     ## Total.sleep is here a supplementary variable since it is deduced
     ## from Paradoxical.sleep and Slow.wave.sleep
     ## The variable Species is displayed in the subject plane,
     ## Rabbit and Cow have a high level of danger

