In the simulation programs use the following variance:
The exercise use this variance:
The solution is to multiply the variance of the simulation by:
- Statistical simulation of the variance with R-Project
> x <- c(rep(47,1),rep(48,3),rep(49,2),rep(50,8),rep(51,3),rep(52,2)
,rep(53,1));
> ni<- table(x);
> n<-sum(ni)
> var(x)*(n-1)/n
[1] 2.1475
- Statistical simulation of the variance with Mathematica
x := Join[ConstantArray[47, 1], ConstantArray[48, 3],
ConstantArray[49, 2], ConstantArray[50, 8], ConstantArray[51, 3],
ConstantArray[52, 2], ConstantArray[53, 1]];
ni := Tally [x];
n := Sum[ni[[i, 2]], {i, Length[ni]}];
(Variance[x] (n - 1))/n;
N[%]
2.1475`
|