计算标准误差(即样本均值的标准差)的公式是。但我们通常不知道总体标准差。所以我们必须首先从我们的样本 (注意:它是一个有偏的估计量)。使用这个估计的标准偏差,我们的新公式是。
我做了一个蒙特卡罗模拟,发现这个估计的标准误差系统地低于确切的标准误差。我想知道为什么会这样?如果有人能证明这一点,将不胜感激。
如果您想尝试,我在这里附上了一些 R 代码。请注意,第三个结果低于其他结果。
# draw 100000 samples, each sample has 5 data point
mat = matrix(nrow = 100000,ncol = 5)
for (i in 1:100000){
mat[i,1:5] <- rnorm(5)
}
# Method1: Calculate standard error by definition: standard error is the standard deviation of sample means
sd(rowMeans(mat))
# Method2: Calculate standard error using the population std: sigma/sqrt(n)
1/sqrt(5)
# Method3: Calculate standard error using the sample std: sigma_hat/sqrt(n)
row_std = apply(mat, 1, sd)
row_se = row_std/sqrt(5)
mean(row_se)