p-value depends on sample size

Author

Francisco Rodríguez-Sánchez

We have simulated two groups, one with mean 10 and the other with mean 12. That is, the average difference between groups is 2 units. Both groups have sd = 5.


    

How does sample size affect the p-value when testing for differences between both groups?

Choose a sample size per group and see the resulting p-value from a t-test:


    

Here we show all the resulting p-values with sampling sizes ranging from 3 to 1000: