Re: [R] Different value between R variance and definition of variance

2007-11-28 Thread Daniel Nordlund
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf > Of Tine > Sent: Wednesday, November 28, 2007 12:57 AM > To: r-help@r-project.org > Subject: [R] Different value between R variance and definition of variance > > Hi! > >

[R] Different value between R variance and definition of variance

2007-11-28 Thread Tine
Hi! Let us define random variable: > x = seq(0,1,length=100) If we calculate variance following definition E[(x-E(x))^2] we get: > mean( (x - mean(x))^2 ) # == mean(x^2) - mean(x)^2 0.08501684 And if we use internal R function var: > var(x) 0.08587559 Can anyone tells me why the difference?