s-news
[Top] [All Lists]

Averaging rows

To: <s-news@lists.biostat.wustl.edu>
Subject: Averaging rows
From: "Khan, Sohail" <khan@cshl.edu>
Date: Mon, 5 Dec 2005 11:54:10 -0500
Thread-index: AcX5vIObJeuHZcISRO21/a/4qpGn+A==
Thread-topic: Averaging rows
Dear S-Plus Experts,

I have data frame as follows:

ID    ratio_1     ratio_2
X      2.5          2.0 
Y      3.6          2.1
Y      2.9          1.2
Y      3.5          4.2
Z      2.5           1.9
K      0.5           2.1
L       1.4          4.1

I would like average values of columns ratio_1, ratio_2 for all the IDs with 
multiple values, i.e. ID Y would have average ratio_1 = 3.3333, ratio_2.5.
I am a novice S_PLUS user, sorry for the trivial question. 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>