**Hypothesis testing: Testing the variance**

Once we pointed out before, we are able to utilize

*Mathematica*to do hypothesis tests around the variance of the population as well as on the number of the variances of two different populations. The instructions through which we all do this come in the package

**Statistics`HypothesisTests`**.

Once more we assume we have some data *data* composed from the measurements of the specific characteristic from the random sample of people obtained from a normally distributed population. However now our null hypothesis is from the form *H*. 2 = *test* and our alternative hypothesis is of among the forms *H*1. 2 >*test*. *H*1. 2 2 *test*. where 2 may be the variance in our population, and *test* is really a known value that we’re evaluating the variance.

Given an accumulation of data *data* from the sample of the population, we test a null hypothesis about how exactly how big the variance of people even compares to the worth *test* by way of the command

VarianceTest[*data*,*test*,*Options*]

The creation of this is actually the *p* -value for that test the variance of people is *test* with different chi-square distribution.

The choices readily available for the exam from the variance act like individuals for that test from the mean, while not as numerous options are for sale to this test. They contain the choice of the entire report, provided by **FullReport->True** . the choice of the final outcome from the test because of the specs of the amount of significance *level*. **SignificanceLevel->***level*. and also the option whether the exam ought to be one-tailed or two-tailed, provided by **TwoSided->True** because the indication the test will be two-tailed using the default being for any one-tailed test. Recall when our alternative hypothesis is really a two-sided equality, only then do we execute a two-tailed test, whereas if our alternative hypothesis is really a one-sided inequality, only then do we execute a one-tailed test.

**Example 1:** The information 159.9, 187.2, 180.1, 158.1, 225.5, 163.7, and 217.3 includes the weights, in pounds, of the random sample of seven individuals obtained from a population which are distributed. The variance of the sample is offered by 753.04. Let’s test the null hypothesis *H*. 2 = 750. from the alternative hypothesis *H*1. 2 750. at an amount of value of .3.

This issue includes the testing the null hypothesis *H*. 2 = 750. against an alternate hypothesis that includes a two-sided inequality, that is a two-tailed test. Thus we test this hypothesis to an amount of value of .01 beginning with loading the right package

Out[3]= .636463,

Neglect to reject null hypothesis at significance

level -> .3>

Thus we don’t reject our null hypothesis only at that degree of significance.

**Example 2:** For that data values 1.82684, 1.80375, 1.03434, .851251, .757495, 1.24019, 1.80229, 1.31233, 1.06619, and 1.20922, there exists a variance of .157288. Let’s test the null hypothesis *H*. 2 = .24 from the alternative hypothesis *H*1. -3]

Out[5]= .316524,

Neglect to reject null hypothesis at significance

level ->0.3>

Thus we don’t reject the null hypothesis.

We are able to perform hypothesis tests on the number of the variances of two populations, 1 2 and a pair of 2. given data from each population, *data*1 and *data*2. correspondingly, by way of the command

VarianceRatioTest[*data*1,*data*2,*test*,*Options*]

This yields a *p* -value for any comparison from the ratio 1 2 / 2 2 towards the value *test* according to an *F* -ratio distribution. This function utilizes exactly the same options because the function **VarianceTest** .

**Example 3:** Suppose we have collected the information 27, 29, 22, 21, 26, 28, 24, and 29 in one population and also the data 19, 18, 24, 18, 22, and 15 from another. The variance from the first sample is 9.64286 and also the variance from the second sample is 10.2667. The number of the very first variance to the second reason is .939239. Let’s test the null hypothesis the two variances are equal, *H*. 1 2 / 2 2 = 1, from the alternative hypothesis the two variances aren’t equal, *H*1. 1 2 / 2 2 1, where 1 2 may be the variance from the first population and a pair of 2 may be the variance from the second population, in a significance degree of .10.

To check this hypothesis, we execute a two-tailed test in the significance degree of .10 while using function VarianceRatioTest around the data above. This is achieved using the program

In[7]:= **VarianceRatioTest[data1,data2,1.,****SignificanceLevel->.10,TwoSided->True]**

Out[7]= .904788,

Neglect to reject null hypothesis at significance

level -> .1>

Thus we don’t reject the null hypothesis the two variances are equal only at that degree of significance.

Exercises

Last modified: Mon Jan 28 2002