On the error bar and statistical significance

Take two random series of 20 values. What you can tell about their difference according to the visualization of their confidence interval: nearly nothing !

Let use this little script:
library(HelpersMG)

x <- rnorm(20, mean=11.8, sd=2)
y <- rnorm(20, mean=10, sd=2)

t <- t.test(x, y, var.equal = TRUE)
w <- series.compare(x, y, criterion = c("BIC"), var.equal = TRUE)

plot_errbar(x=1:2, y=c(mean(x), mean(y)), errbar.y=1.96*c(sd(x), sd(y)),
            las=1, bty="n", xlab="", ylab="", ylim=c(0, 20), xlim=c(0, 3))
plot_errbar(x=(1:2)+0.1, y=c(mean(x), mean(y)), errbar.y=2*c(sd(x)/sqrt(20), sd(y)/sqrt(20)),
            las=1, bty="n", xlab="", ylab="", ylim=c(0, 20), xlim=c(0, 3), add=TRUE, col="red",
            errbar.col = "red")

text(x = 1.5, y=2, labels = paste0("p = ", format(t$p.value, digits = 5)))
text(x = 1.5, y=3, labels = paste0("w = ", format(w["BICw(identical)"], digits = 5)))

legend("topright", legend=c("Standard deviation", "Standard error"), col=c("black", "red"), lty=1)


The result is this one:


First, a common mistake is to look at the dispersion of the values measured by standard deviation (in black) and then conclude about the difference or not of the mean. Clearly here there is a large overlap of standard deviation but the standard errors (i.e. how is known the average) do not overlap. This is reflected by the low p value= 0.003. But always remember that the p value is not the probability that the two series are different ! The probability that the two series are different is better measured by the w-value (Girondot and Guillon, 2018).
If you claim that the means are different and you believe that the probability that you are wrong is p = 0.003,  in reality you are wrong with a probability of 0.10 !

In conclusion:
1/ do not use p-value
2/ do not use standard deviation dispersion bars to conclude about difference of means
3/ use w-value !

Girondot, M. & Guillon, J.-M. 2018. The w-value: An alternative to t- and X2 tests. Journal of Biostatistics & Biometrics, 1, 1-4.


Commentaires

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

stepAIC from package MASS with AICc

Install treemix in ubuntu 20.04