From J.C.Rougier@durham.ac.uk  Fri May 19 09:57:10 2000
From: J.C.Rougier@durham.ac.uk (Jonathan Rougier)
Date: Fri, 19 May 2000 09:57:10 +0100 (BST)
Subject: [Rd] variance of a scalar (PR#546)
In-Reply-To: <200005190848.JAA22344@toucan.stats.ox.ac.uk>
Message-ID: <Pine.GSO.4.20.0005190952290.10176-100000@laplace>

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
added?

Jonathan Rougier                       Science Laboratories
Department of Mathematical Sciences    South Road
University of Durham                   Durham DH1 3LE
http://www.maths.dur.ac.uk/stats/people/jcr/jcr.html

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


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