# [R] normalizing heteroscedastic variance

David Magee ddmagee at lbl.gov
Thu Oct 10 09:16:29 CEST 2002

```I have many sets of heteroscedastic data y.  I want to normalize each
set independently so I can compare across replicates.
Within a set, the mean of y = 0 and the slope = 0 as a function of x,
and the variance of y varies by x.
The range of y is (-1, +1) more or less and The range of x is (.6,10.5)
Imagine a looking at a cone sideways.

I split the data into range factors using
f <- round(x)
then calculated the sd for each range using
yfsd<-tapply(ma[[10]][,1], A, sd)
Now I would like to divide each element of y by yfsd
dim(y)=5000
yfsd has 10 values for the 10 factors
If I use tapply I get a vector with 10 values. This is not what I want.
Any cleaver ideas? Do I need to loop or use a while statement.
Thanks,
D

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```