Skip to content

Median in Classes

2 messages · Hecht Michael, F+E/ST, Dimitris Rizopoulos

#
Hello,

I've got a problem to find an effective calculation. 
There are x,y data and I want to build classes for 
the x values. For each class then I want to calculate
the median, N%-Quantiles, outliers, etc. for the 
corresponding y values and store all in a vector or matrix.

Is there a direct possibility to do this without 
storing to much temporary data?

Thank's in advance,

Michael Hecht

-------------------------------------------------
| Dipl.-Math. Michael Hecht
| 66748 Dillingen / Germany
| E-Mail : mailto:michael.hecht at dillinger.de
#
you could try something like this:

dat <- data.frame(x=rep(1:4, each=25), y=rnorm(100))
tapply(dat$y, dat$x, summary)

I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Hecht Michael, F+E/ST" <Michael.Hecht at dillinger.biz>
To: "'r-help at lists.R-project.org'" <r-help at stat.math.ethz.ch>
Sent: Monday, March 21, 2005 10:59 AM
Subject: [R] Median in Classes