tom soyer wrote:
> oops, it should be: rms=(sum((x-mean(x))^2)/(length(x)-1))^(1/2)
>
sd(x) does the same thing.
domenico
> On 1/3/08, tom soyer <[EMAIL PROTECTED]> wrote:
>
>> Thanks Jim. Yes it does... but I calculated the root mean square (rms),
>> and couldn't reproduce the result withou
oops, it should be: rms=(sum((x-mean(x))^2)/(length(x)-1))^(1/2)
On 1/3/08, tom soyer <[EMAIL PROTECTED]> wrote:
>
> Thanks Jim. Yes it does... but I calculated the root mean square (rms),
> and couldn't reproduce the result without multiplying the rms by 2. I don't
> know why...
>
> > x=c(2,4,3,
Thanks Jim. Yes it does... but I calculated the root mean square (rms), and
couldn't reproduce the result without multiplying the rms by 2. I don't know
why...
> x=c(2,4,3,4,5)
> mean(x)
[1] 3.6
> x-mean(x)
[1] -1.6 0.4 -0.6 0.4 1.4
> scale(x)
[,1]
[1,] -1.4032928
[2,] 0.3508232
[3
Does this give you what you want?
> x=c(2,4,3,4,5)
> ?scale
> scale(x,scale=FALSE)
[,1]
[1,] -1.6
[2,] 0.4
[3,] -0.6
[4,] 0.4
[5,] 1.4
attr(,"scaled:center")
[1] 3.6
>
Default is to performance scaling: "If scale is TRUE then scaling is
done by dividing the (centered) columns of x by thei
Never mind. I forgot the scale= parameter.
On 1/3/08, tom soyer <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> The documentation for scale() states:"If center is TRUE then centering is
> done by subtracting the column means (omitting NAs) of x from their
> corresponding columns". But it seems that R is su
Hi,
The documentation for scale() states:"If center is TRUE then centering is
done by subtracting the column means (omitting NAs) of x from their
corresponding columns". But it seems that R is subtracting something else
instead of the column mean:
> x=c(2,4,3,4,5)
> mean(x)
[1] 3.6
> x-mean(x)
[1
6 matches
Mail list logo