Hello

I am an "R" newbie. I have a problem with computing a variance on a vector.

> data(cars)
> variance <- function (x) mean(x^2)-mean(x)^2;
> variance(cars[,1])
[1] 27.4
> var(cars[,1])
[1] 27.95918

What did I assume/understand wrong ?

TIA

-- 
Samuel Landau

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to