correlation            package:agricolae            R Documentation

_C_o_r_r_e_l_a_t_i_o_n _a_n_a_l_y_s_i_s. _M_e_t_h_o_d_s _o_f _P_e_a_r_s_o_n, _S_p_e_a_r_m_a_n _a_n_d _K_e_n_d_a_l_l

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

     It obtains the coefficients of correlation and p-value between all
     the variables of a data table. The methods to apply are Pearson,
     Spearman and Kendall. In case of not specifying the method, the
     Pearson method  will be used. The results are similar to SAS.

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

     correlation(x,y=NULL, method = c("pearson", "kendall", "spearman")
     ,alternative="two.sided")

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

       x: table, matrix or vector 

       y: table, matrix or vector 

  method: "pearson", "kendall", "spearman" 

alternative: "two.sided", "less", "greater" 

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

     Parameters equal to function cor()

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

  table : Numeric

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

     Felipe de Mendiburu

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

     'correl '

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

     library(agricolae)
     # example 1
     data(soil)
     analysis<-correlation(soil[,2:8],method="pearson")
     analysis

     # Example 2: correlation between pH, variable 2 and other elements from soil.
     data(soil)
     attach(soil)
     analysis<-correlation(pH,soil[,3:8],method="pearson",alternative="less")
     analysis
     detach(soil)

     # Example 3: correlation between pH and clay method kendall.
     data(soil)
     attach(soil)
     correlation(pH,clay,method="kendall", alternative="two.sided")
     detach(soil)

