CorGroups               package:StatDA               R Documentation

_C_o_r_r_e_l_a_t_i_o_n _M_a_t_r_i_x _f_o_r _S_u_b-_g_r_o_u_p_s

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

     The correlation matrix for sub-groups of data is computed and
     displayed in a graphic.

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

     CorGroups(dat, grouping, labels1, labels2, legend, ndigits = 4,
     method = "pearson", ...)

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

     dat: data values (probably log10-transformed)

grouping: factor with levels for different groups 

labels1, labels2: labels for groups 

  legend: plotting legend 

 ndigits: number of digits to be used for plotting the numbers 

  method: correlation method: "pearson", "spearman" or "kendall" 

     ...: will not be used in the function

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

     The corralation is estimated with a non robust method but it is
     possible to select between the method of Pearson, Spearman and
     Kendall. The groups must be provided by the user.

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

     Graphic with the different sub-groups.

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

     Peter Filzmoser <P.Filzmoser@tuwien.ac.at>

_R_e_f_e_r_e_n_c_e_s:

     C. Reimann, P. Filzmoser, R.G. Garrett, and R. Dutter: Statistical
     Data Analysis Explained. Applied Environmental Statistics with R.
     John Wiley and Sons Inc. To appear.

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

     data(chorizon)
     x=chorizon[,c("Ca","Cu","Mg","Na","P","Sr","Zn")]

     #definition of the groups
     lit=chorizon[,"LITO"]
     litolog=rep(NA, length(lit))
     litolog[lit==10] <- 1
     litolog[lit==52] <- 2
     litolog[lit==81 | lit==82 | lit==83] <- 3
     litolog[lit==7] <- 4
     litolog <- litolog[!is.na(litolog)]
     litolog <- factor(litolog, labels=c("AB","PG","AR","LPS"))

     par(mfrow=c(1,1),mar=c(0.1,0.1,0.1,0.1))
     CorGroups(log10(x), grouping=litolog, labels1=dimnames(x)[[2]],labels2=dimnames(x)[[2]],
     legend=c("Caledonian Sediments","Basalts","Alkaline Rocks","Granites"),ndigits=2)

