[R] R WRONG CALCULATIONS - Please Help

Frank Schwidom
Mon, 14 Sep 2015 18:45:16 -0000

On Mon, Sep 14, 2015 at 04:11:57PM +0100, JORGE COLACO wrote:

> > X-mean
>      [,1] [,2] [,3] [,4] [,5] [,6]
> [1,] -0.8 -0.2  0.8 -1.2  0.8 -0.2
> [2,] -0.2  0.2  0.8  0.8  0.8 -1.2
> [3,] -1.2 -0.2 -0.8  0.8 -0.2  0.8
> [4,]  0.8  0.8 -1.2 -0.8 -0.2 -0.2
> [5,] -0.2 -0.2  0.8  0.8 -0.8  0.8
> >

try this:

X - mean[ col( X)]
     [,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.8 -0.2  0.8 -1.2  0.8 -0.2
[2,]  0.2 -0.2  0.8  0.8  0.8 -1.2
[3,] -0.8 -0.2 -1.2  0.8 -0.2  0.8
[4,]  1.2  0.8 -1.2 -1.2 -0.2 -0.2
[5,]  0.2 -0.2  0.8  0.8 -1.2  0.8

Regards.