Skip to content

Means

2 messages · Dmitry Berman, (Ted Harding)

#
On 18-Feb-11 20:51:40, Dmitry Berman wrote:
Using data (1:10), with N=10, as an example:

  c(SampSD=1, PopSD=sqrt(9/10))*sd((1:10))
  #   SampSD    PopSD
  # 3.027650 2.872281 

More generally, with data x and N<-length(x):

  c(SampSD=1, PopSD=sqrt((N-1)/N))*sd(x)

These are examples of commands. You could wrap the latter into
a function on the lines of:

  PopSampSD <- function(x){
    N <- length(x)
    c(SampSD=1, PopSD=sqrt((N-1)/N))*sd(x)
  }

and then:

  PopSampSD((1:10))
  #   SampSD    PopSD 
  # 3.027650 2.872281 

as before. Hoping this helps,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <ted.harding at wlandres.net>
Fax-to-email: +44 (0)870 094 0861
Date: 18-Feb-11                                       Time: 22:12:00
------------------------------ XFMail ------------------------------