[Rd] variance of a scalar (PR#546)

Uwe Ligges ligges@statistik.uni-dortmund.de
Fri, 19 May 2000 11:01:29 +0200


J.C.Rougier@durham.ac.uk wrote:
> 
> I was surprised to find that the variance of a scalar, using
> var(), is NA.  Surely this should be zero?

1. This is ok. var(.) is defined as:
   var(x)= (1 / (n - 1)) * sum(x - mean(x))^2
                 ^^^^^
If you has got a scalar: n - 1 = 0, so it is undefined!

> 
> Version:
>  platform = sparc-sun-solaris2.7
>  arch = sparc
>  os = solaris2.7
>  system = sparc, solaris2.7
>  status = Patched
>  major = 0
>  minor = 99.0

You should upgrade to 1.0.1

Regards,
Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._