Skip to main content
fixed a typo; added a conclusion
Source Link
Anthony
  • 1.7k
  • 15
  • 26

When one sample is fixed (as in the first set of code), the Null hypothesis is not true. This happens because, in the first set of code, s0 will have some mean that does not exactly equal 0. Because the normal distribution is continuous, the probability of drawing 1000100 i.i.d. normals with a mean of exactly 0 is 0. Therefore, the loops in the first set of code all involve t-tests where the Null hypothesis is false because they involve comparing $\mu_1$ to $\mu_2$ where $\mu_1\neq0$ and $\mu_2=0$. Because the Null is false, the distribution of p-values won't be exactly uniform.

When one sample is fixed (as in the first set of code), the Null hypothesis is not true. This happens because, in the first set of code, s0 will have some mean that does not exactly equal 0. Because the normal distribution is continuous, the probability of drawing 1000 i.i.d. normals with a mean of exactly 0 is 0. Therefore, the loops in the first set of code all involve t-tests where the Null hypothesis is false because they involve comparing $\mu_1$ to $\mu_2$ where $\mu_1\neq0$ and $\mu_2=0$.

When one sample is fixed (as in the first set of code), the Null hypothesis is not true. This happens because, in the first set of code, s0 will have some mean that does not exactly equal 0. Because the normal distribution is continuous, the probability of drawing 100 i.i.d. normals with a mean of exactly 0 is 0. Therefore, the loops in the first set of code all involve t-tests where the Null hypothesis is false because they involve comparing $\mu_1$ to $\mu_2$ where $\mu_1\neq0$ and $\mu_2=0$. Because the Null is false, the distribution of p-values won't be exactly uniform.

Source Link
Anthony
  • 1.7k
  • 15
  • 26

When one sample is fixed (as in the first set of code), the Null hypothesis is not true. This happens because, in the first set of code, s0 will have some mean that does not exactly equal 0. Because the normal distribution is continuous, the probability of drawing 1000 i.i.d. normals with a mean of exactly 0 is 0. Therefore, the loops in the first set of code all involve t-tests where the Null hypothesis is false because they involve comparing $\mu_1$ to $\mu_2$ where $\mu_1\neq0$ and $\mu_2=0$.