Thank and sorry i should check this before asking the question.
Andrija
On Thu, Dec 8, 2011 at 3:20 PM, R. Michael Weylandt <
michael.weyla...@gmail.com> wrote:
> R FAQ 7.31 I'd imagine. (Floating point arithmetic and limitations thereof)
>
> Michael
>
> On Dec 8, 2011, at 9:15 AM, andrija djur
R FAQ 7.31 I'd imagine. (Floating point arithmetic and limitations thereof)
Michael
On Dec 8, 2011, at 9:15 AM, andrija djurovic wrote:
> Hi all. I tried to calculate sum of deviations from the weighted mean and i
> didn't get what i expected - 0. Here is an example:
>
>> wt <- c(10,25,38,22,5
Hi all. I tried to calculate sum of deviations from the weighted mean and i
didn't get what i expected - 0. Here is an example:
> wt <- c(10,25,38,22,5)
> x <- 6:10
> wm <- weighted.mean(x,wt)
> (x-wm)*wt
[1] -18.70 -21.75 4.94 24.86 10.65
> sum((x-wm)*wt)
[1] -1.24345e-14
With simple mean I
3 matches
Mail list logo