[R] proc standardize & data frame x and y

zubin binabina at bellsouth.net
Sun Aug 13 02:45:14 CEST 2006


Hello!  i know these are basic but i cannot seem to find the answer thru 
my searches..

1) Can someone recommend an equivalent to SAS PROC Standardize in R?  I 
am in need to frequently standardize a data frame, with z-scores, or 
squash to 0-1 scale - is there a slick function or package someone can 
recommend?

2) Also, have data sets with a lot of predictor variables.  in the 
diabetes data frame i see that fields have been grouped to X and Y 
variables, making it very easy to identify X and Y in the regression 
techniques.  How is this done, how do you group lets say a group of 
columns into 1 matrix, within a data frame.  example: the AsIs group is 
a matrix of X variables:

 > str(diabetes)
`data.frame':   442 obs. of  3 variables:
 $ x : AsIs [1:442, 1:10] 0.038075.... -0.00188.... 0.085298.... 
-0.08906.... 0.005383.... ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : NULL
  .. ..$ : chr  "age" "sex" "bmi" "map" ...
  ..- attr(*, "class")= chr "AsIs"
 $ y : num  151 75 141 206 135 97 138 63 110 310 ...
 $ x2: AsIs [1:442, 1:64] 0.038075.... -0.00188.... 0.085298.... 
-0.08906.... 0.005383.... ...
  ..- attr(*, ".Names")= chr  "age" "age" "age" "age" ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : chr  "1" "2" "3" "4" ...
  .. ..$ : chr  "age" "sex" "bmi" "map" ...
  ..- attr(*, "class")= chr "AsIs"



More information about the R-help mailing list