GNOME Bugzilla – Bug 607970
Confidence Level Calculation in simulation tool maybe wrong
Last modified: 2010-01-26 00:42:52 UTC
Created attachment 152179 [details] Forumula correction in confidence level in simulation tool In the original source code for the Confidence Level Calculation in the simulation tool, the calculation formula is -qnorm(alpha,mu,sigma,True,False).... However alpha should be replaced by alpha/2, i.e.: CONFIDENCE(alpha, sigma, n) = NORMSINV(1 – alpha/2) * sigma / SQRT(n) =r.qnorm(1 – alpha/2,0,1,TRUE,FALSE) * sigma / SQRT(n) source http://support.microsoft.com/kb/828124 For example: confidence(0.05,15,50) =normsinv(1-0.05/2)*15/sqrt(50) =r.qnorm(1-0.05/2,0,1,TRUE,FALSE)*15/sqrt(50) =4.15771147304903 or =-qnorm(0.05/2,0,1,TRUE,FALSE)*15/sqrt(50) =4.15771147304903 Hope this would be helpful. See attached file simulation1.c
Yes, the confidence interval is definitely not right. The suggested changes do not go quite far enough. I think we should be using the t-distribution rather than the normal distribution.
There is more wrong with this: confidence[i] should be the length of the interval, so a factor of 2 is missing. Note that we divide it by 2 when we add it to the point estimate to obtain the upper and lower bounds.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. Note that I assume that confidence[i] should be the length of the interval since it is used that way in the following calculation of the min and max. One could easily justify that "confidence" should only be half of that, corresponding to the CONFIDENCE function, but then we would also need to change the calculation of the lower and upper limits for the CI.