[R] What's going on? (strange standard deviation)

Matej Cepl matej at ceplovi.cz
Fri Nov 15 22:18:44 CET 2002


I have probably misunderstood something (again :-():

	> CEMPLOY<-TEMPLOY[!is.na(TEMPLOY)]
	> sum(CEMPLOY^2/length(CEMPLOY))-mean(CEMPLOY)^2
	[1] 30877.28
	> var(TEMPLOY,na.rm=TRUE)
	[1] 30981.25

Could anybody tell me, what's going on? I suppose that

	var=sum(x^2/N)-xbar^2

or what did I enter wrong?

	Thanks

		Matej

-- 
Matej Cepl, matej at ceplovi.cz,
Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
 
Courage is resistance of fear, mastery of fear, not absence of
fear.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list