Re: [R] Standard Deviation in R

2014-06-12 Thread S Ellison
> > The formula I generally use to compute the standard deviation is the > square root of the variance where the variance is E(X^2) - (E(x))^2. Even if that is what you want, I hope you don't _implement_ it that way (eg as mean(x^2)-mean(x)^2. _Serious_ numerical rounding issues... #Example:

Re: [R] Standard Deviation in R

2014-06-11 Thread Greg Snow
The help page ?sd (I only checked version 3.1.0) has as the 1st sentence in the details section: "Like ‘var’ this uses denominator n - 1." and on the help page ?var in the details section (though down in the 3rd paragraph from the end) there is this sentence: "The denominator n - 1 is used which gi

Re: [R] Standard Deviation in R

2014-06-11 Thread arun
Hi Bob, You may check: library(multicon) ?popsd() sd(1:3) #[1] 1  popsd(1:3) #[1] 0.8164966  sd(1:3)*sqrt(2/3) #[1] 0.8164966 A.K. The formula I generally use to compute the standard deviation is the square root of the variance where the variance is E(X^2) - (E(x))^2. That is, the divisor is

Re: [R] Standard Deviation in R

2014-06-08 Thread Greg Snow
Which formula for standard deviation are you using? If you know the population mean then you should divide by n (3 in this case), but if you don't know the population mean and use the mean calculated from the sample then it is more usual to use n-1 as the denominator (this makes the variance an un

Re: [R] Standard Deviation in R

2014-06-08 Thread arun
Hi, Please check this link: http://stats.stackexchange.com/questions/25956/what-formula-is-used-for-standard-deviation-in-r A.K. It is my understanding that the R function SD finds the standard deviation of a random variable or a list. Please consider the following list: { 1, 2, 3 }. I claim t