[R] variance of discrete uniform distribution

Michael Erickson erickson at ucr.edu
Tue Mar 9 00:54:32 CET 2010

On Mon, Mar 8, 2010 at 3:44 PM, casperyc <casperyc at hotmail.co.uk> wrote:
> Hi Rolf Turner ,
> God, it directed to the wrong page.
> I firstly find the formula in wiki, than tried to verify the answer in R,
> now, given that 143/12 ((n^2-1)/12 ) is the correct answer for a discrete
> uniform random variable,
> I am still not sure what R is calculating there?
> why it gives me 13?

Of RT's two points, you addressed (b) continuous vs. discrete, but you
have yet to address (a) population estimate based on a sample.  Hint:
var(1:12) tries to estimate the population variance based on a sample.
 You are interested in the population variance.  They are calculated
different formulas that differ *only in the denominator*.


> Thanks!
> --
> View this message in context: http://n4.nabble.com/variance-of-discrete-uniform-distribution-tp1585328p1585355.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list