Mean Test Experiment

Description

The experiment is to select a random sample of size \(n\) from a selected distribution and then test a hypothesis about the mean \(\mu\). The distribution can be selected from a list box; the options are the

In each case, the appropriate parameters can be varied with input controls. The sample size \(n\) the significance level \(\alpha\), and the boundary point \(\mu_0\) between the null and alternative hypotheses can also be varied with input controls.

The type of test—two-sided, left-sided, or right-sided—can be selected with a list box. The probability density function of the sampling distribution and the mean \(\mu\) are shown in blue in the first graph; \(\mu_0\) is shown in green.

The test can be constructed under the assumption that the distribution standard deviation is known or unknown. In the first case the test statistic is \[Z = \frac{M - \mu_0}{\sigma / \sqrt{n}}\] where \(M\) is the sample mean. Under the assumption that the sampling distribution is normal and that the null hypothesis is true, \(Z\) has the standard normal distribution. In the second case the test statistics is \[T = \frac{M - \mu_0}{S / \sqrt{n}}\] where \(S\) is the sample standard deviation. Again under the assumption that the sampling distribution is normal and the null hypothesis is true, \(T\) has the student \(t\) distribution with \(n - 1\) degrees of freedom. The probability density function of the test statistic is shown in the second graph along with a bar corresponding to the critical values of the test statistic.

On each run, the sample density function is shown in the first graph. The value of the test statistic is shown in the second graph. The third graph and the corresponding table show the empirical density function of \(R\), a Boolean variable that takes the value 1 if the null hypothesis is rejected and 0 if it is not. The values of \(M\), \(Z\) or \(T\), \(P\) and \(R\) are recorded in the data table.