Variance 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 standard deviation \(\sigma\) at a specified significance level. The distribution can be selected from a list box; the options are the normal, gamma, and uniform distributions. In each case, the appropriate parameters and the sample size \(n\) can be varied with input controls.

The type of test: two-sided, left-sided, or right-sided. can be selected from a list box. The boundary point \(\sigma_0\) between the null and alternative hypotheses can be varied with an input control. The probability density function of the distribution is shown in the first graph.

The test statistic is \[ V = \frac{n - 1}{\sigma_0^2} S^2 \] where \(S^2\) is the sample variance. Under the assumpation that the sampling distribution is normal and the null hypothesis true, \(V\) has the chi-square distribution with \(n - 1\) degrees of freedom. The probability density function of the test statistic is shown in the second graph. The significance level \(\alpha\) of the test can be varied with an input control, and the corresponding critical values of \(V\) are also given.

On each update, the sample density function is shown in the first graph. The value of the test statistic is shown in the second graph. The Boolean variable \(R\) takes the value 1 if the null hypothesis is rejected and 0 otherwise. The empirical density function of \(R\) is shown in the last graph and recorded in the second table. The data table records the sample variance \(S^2\), the test statistic \(V\), the \(P\)-value, and \(R\).