Skip to content
Back to formatted view

Raw Message

Message-ID: <20030514110527.70e2c85d.fharrell@virginia.edu>
Date: 2003-05-14T15:05:27Z
From: Frank E Harrell Jr
Subject: building mean/median over subgroups
In-Reply-To: <p05200f00bae8001643f9@[128.40.218.142]>

On Wed, 14 May 2003 15:25:57 +0100
Frank Mattes <f.mattes at rfc.ucl.ac.uk> wrote:

> Dear all,
> 
> I'm trying to solve the following problem, and hoping to get some 
> advise here from the group
> 
> I have a dataframe in which the same sample was measured more than 
> once on the same day. I would reorganize the dataframe to get a 
> single value (mean /median) for one day
> 
> Patient	Day	Sample	Test
> A	1	A	23
> A	1	A	36
> A	5	B	44
> A	5	B	23
> B	2	C	10
> B	2	C	5
> 
> 
> mean
> 
> Patient	Day	Sample	Test.mean
> A	1	A	29.5
> A	5	A	33.5
> B	2	C	7.5
> 
> 
> it would be great to get some help form the list.
> 
> Yours
> Frank
> -- 
> Frank Mattes, MD			e-mail:	f.mattes at ucl.ac.uk
> 

There are examples like this in Section 4.2 of http://hesweb1.med.virginia.edu/biostat/s/doc/splus.pdf

---
Frank E Harrell Jr              Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat