sumstats                package:made4                R Documentation

_S_u_m_m_a_r_y _s_t_a_t_i_s_t_i_c_s _o_n _x_y _c_o-_o_r_d_i_n_a_t_e_s, _r_e_t_u_r_n_s _t_h_e _s_l_o_p_e_s _a_n_d _d_i_s_t_a_n_c_e _f_r_o_m _o_r_i_g_i_n _o_f _e_a_c_h _c_o-_o_r_d_i_n_a_t_e.

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

     Given a 'data.frame' or 'matrix' containing xy coordinates, it
     returns the slope and distance from origin of each coordinate.

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

     sumstats(array, xax = 1, yax = 2)

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

   array: A 'data.frame' or 'matrix' containing xy coordinates,
          normally a $co, $li from 'dudi' such as PCA or COA, or $ls
          from  'bga'

     xax: Numeric, an integer indicating the column of the x axis
          coordinates. Default xax=1 

     yax: Numeric, an integer indicating the column of the x axis
          coordinates. Default xax=2 

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

     In PCA or COA, the variables (upregulated genes) that are most
     associated with  a case (microarray sample), are those that are
     projected in the same direction  from the origin. 

     Variables or cases that have a greater contribution to the
     variance in the data are projected further from the origin in PCA.
     Equally variables and cases with the strong  association have a
     high chi-square value, and are projected with greater distance 
     from the origin in COA, See a description from Culhane et al.,
     2002 for more details.

     Although the projection of co-ordinates are best visualised on an
     xy plot, 'sumstats' returns the slope and distance from origin of
     each x,y coordinate in a matrix.

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

     A matrix (ncol=3) containing 


        slope 
        angle (in degrees) 
        distance from origin

     of each x,y coordinates in a matrix.

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

     Aedin Culhane

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

     data(khan)

     if (require(ade4, quiet = TRUE)) {

     khan.bga<-bga(khan$train, khan$train.classes)}

     s.var(khan.bga$bet$ls, col=as.numeric(khan$train.classes), clabel=0.8)
     st.out<-sumstats(khan.bga$bet$ls)

     # Get stats on classes  EWS and BL
     EWS<-khan$train.classes==levels(khan$train.classes)[1]
     st.out[EWS,]

     BL<-khan$train.classes==levels(khan$train.classes)[2]
     st.out[BL,]

     # Add dashed line to plot to highlight min and max slopes of class BL
     slope.BL.min<-min(st.out[BL,1])
     slope.BL.max<-max(st.out[BL,1])
     abline(c(0,slope.BL.min), col="red", lty=5)
     abline(c(0,slope.BL.max), col="red", lty=5)

