s-news
[Top] [All Lists]

calculating the z scores by apply function

To: <s-news@lists.biostat.wustl.edu>
Subject: calculating the z scores by apply function
From: "Khan, Sohail" <khan@cshl.edu>
Date: Mon, 2 Apr 2007 17:34:27 -0400
Thread-index: Acd1brB3jB9rK5OVR12lwjSaAOnocQ==
Thread-topic: calculating the z scores by apply function
Dear all,

I have a large data.frame as follows:
x1      x2      x3      x4      x5
2.56    3.02    4.00    3.87    5.25
1.25    2.20    1.75    2.32    2.14
6.02    5.98    4.99    5.32    5.66

I would like to calculate the z scores for each row.  I am using the package 
"outliers" which has a function for z cores.  I am using this function in 
apply().  However, the out put is not a matrix with the same dim() as the 
original input data.  For example, my data frame is 54675 X 15....and the 
output is reversed 15 X 54675.  I cant figure this out.  I would appreciate 
your expert advice.  Thanks.

Sohail Khan
Scientific Programmer
COLD SPRING HARBOR LABORATORY
Genome Research Center
500 Sunnyside Boulevard
Woodbury, NY 11797
(516)422-4076


<Prev in Thread] Current Thread [Next in Thread>