var
, sd
,cor
函数{stats}
用作n-1
分母(其中n
观察数)。出于好奇,是否有等效的函数n
用作分母?
问问题
1430 次
1 回答
3
尝试这个:
library(RH2) # needs Java
library(sqldf)
n <- length(BOD$demand)
sd(BOD$demand)
sqrt((n-1)/n) * sd(BOD$demand)
sqldf("select stddev_samp(demand) as samp, stddev_pop(demand) as pop from BOD")
var(BOD$demand)
(n-1)/n * var(BOD$demand)
sqldf("select var_samp(demand) as samp, var_pop(demand) as pop from BOD")
于 2014-01-26T00:01:19.977 回答