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

Jonathan Rougier J.C.Rougier@durham.ac.uk
Fri, 19 May 2000 09:57:10 +0100 (BST)

On Fri, 19 May 2000, Prof Brian Ripley wrote:

> > I was surprised to find that the variance of a scalar, using
> > var(), is NA.  Surely this should be zero?
> > 
> Do you mean a vector of length 1? (S has no scalars.)  No, it should be
> NA, as sum((x-xbar)^2)/(n-1) is NaN, or, in statistical terms, one has
> no idea at all of the variability from a single sample.

I thought that might be the reason.  There is no mention of using n-1
rather than n in the denominator on the help page.  Perhaps that might be

Jonathan Rougier                       Science Laboratories
Department of Mathematical Sciences    South Road
University of Durham                   Durham DH1 3LE

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