On 7/23/07, Bertolt Meyer <bmeyer@psychologie.hu-berlin.de> wrote:
>
> And another question: Does anybody know whether it is possible to save
> individual group-mean-centered values into a new variable?


If data is in 'x' and grouping factor is 'group', use "x - tapply(x, group,
mean)[group]"

For example:

group <- gl(2,10)
x <- rnorm(20)
x - tapply(x, group, mean)[group]




-- 
Christophe Pallier (http://www.pallier.org)

	[[alternative HTML version deleted]]

