Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

7.10.3 R Functions linconMpb, linconSpb,... > Data Management - Pg. 370

370 Introduction to Robust Estimation and Hypothesis Testing Benjamini­Hochberg method is used instead. The arguments J and p are used in the same manner as described in conjunction with the R function linconMpb. Data Management The following two R functions might help with data management. The R function fac2Mlist(x,grp.col,lev.col,pr=T) sorts p-variate data stored in the matrix (or data frame) x into groups based on the values stored in the column of x indicated by the argument grp.col. The results are stored in list mode in a manner that can be used by linconMpb and linconSpb. For example, the command z=fac2Mlist(plasma,2,c(7:8)) will create groups based on the data in column 2. The result is that z[[1]] will contain the data for the first group stored as a matrix. The first column of this matrix corresponds to data stored in column 7 of the R variable plasma and the second column corresponds to data stored in column 8. Similarly, z[[2]] will contain the data for group 2, and so on. So the command linconSpb(z) would perform all pairwise comparisons. The R function fac2BBMlist(x,grp.col,lev.col,pr=T) is like the function fac2Mlist, only it is designed to handle a between-by-between design. Now the argument grp.col is assumed to contain two values indicating the columns of x that contain the levels of the two factors. The multivariate data are stored in the columns indicated by the argument lev.col. For a J -by-K design, the result is an R variable having list mode with length JK. I Example The command z=fac2BBMlist(plasma,c(2,3),c(7,8)) will create groups based on the values in columns 2 and 3 of the R variable plasma. In this particular case, there are two levels for the rst factor (meaning that column 2 of plasma has two unique values only) and three for the second. The result will be that z[[1]], ...., z[[6]] will each contain a matrix having two columns stemming from the