Hypothesis about the equality of two average values. Testing statistical hypotheses about equality of means

Consider the same problem as in the previous paragraph 3.4, but only under the condition that the sample sizes and are small (less than 30). In this case, the replacement of the general variances and in (3.15) by the corrected sample variances and can lead to a large error in the value of , and, consequently, to a large error in establishing the area of ​​acceptance of the hypothesis H0. However, if there is confidence that the unknown general and are the same(for example, if the average sizes of two batches of parts manufactured on the same machine are compared), then it is possible, using the Student's distribution, in this case to build a criterion for testing the hypothesis H0 X and Y. To do this, introduce a random variable

, (3.16)

(3.17)

The average of the corrected sample variances and , which serves as a point estimate of both identical unknown general variances and . As it turns out (see , p. 180), if the null hypothesis is true, H0 random value T has a Student's distribution with degrees of freedom, regardless of the values ​​and sample sizes. If the hypothesis H0 true, the difference should be small. That is, the experimental value T Exp. quantities T should be small. Namely, it must be within some boundaries. If it goes beyond these limits, we will consider it a refutation of the hypothesis H0, and we will allow this with a probability equal to the given significance level α .

Thus, the area of ​​acceptance of the hypothesis H0 will be some interval in which the values ​​of the random variable T must hit with probability 1- α :

The value defined by equality (3.18), for different levels of significance α and various numbers K degrees of freedom T can be found in the table of critical points of the Student's distribution (Table 4 of the Appendix). This will find the interval for accepting the hypothesis H0. And if the experimental value T Exp value T falls into this interval - the hypothesis H0 accept. Does not fall - do not accept.

Note 1. If there is no reason to consider the general variances and quantities equal X and Y, then in this case, to test the hypothesis H0 about the equality of the mathematical expectations of the quantities X and Y the use of the above Student's t-test is allowed. Only now the magnitude T number K degrees of freedom should be considered equal not , but equal (see )

(3.19)

If the corrected sample variances and differ significantly, then the second term in the last bracket of (3.19) is small compared to 0.5, so that expression (3.19) compared to expression reduces the number of degrees of freedom of a random variable T almost double. And this leads to a significant expansion of the interval for accepting the hypothesis H0 and, accordingly, to a significant narrowing of the critical area of ​​rejection of this hypothesis. And this is quite fair, since the degree of scatter of the possible values ​​of the difference will be mainly determined by the scatter of the values ​​of one of the quantities X and Y, which has a large variance. That is, information from a sample with a smaller variance, as it were, disappears, which leads to greater uncertainty in the conclusions about the hypothesis H0 .

Example 4. According to the data in the table, compare the average milk yields of cows fed different diets. When testing the null hypothesis H0 about the equality of average milk yields, accept the level of significance α =0,05.

The number of cows fed the diet

(Goals)

Average daily milk yield in terms of basic fat content

(kg/head)

Standard deviation of daily milk production of cows

(kg/head)

. Since the given tabular data were obtained on the basis of small samples with volumes =10 and =8, then to compare the mathematical expectations of the average daily milk yields of cows that received one and the other feed rations, we must use the theory outlined in this paragraph. To do this, first of all, we will find out whether the found corrected sample variances =(3.8)2=14.44 and =(4.2)2=17.64 allow us to consider the general variances and equal. To do this, we use the Fisher-Snedekor criterion (see paragraph 3.3). We have:

According to the table of critical points of the Fischer-Snedekor distribution for α =0,05; K1 =8-1=7 and K2 =10-1=9 find

And since , then we have no reason at this level of significance α =0.05 reject the hypothesis H0 about the equality of general variances and .

Now, in accordance with (3.17) and (3.16), we calculate the experimental value of the quantity T:

Next, according to the formula find number K degrees of freedom T: K=10+8-2=16. After that for n0+8-2=16. odes (3.16) we calculate the experimental value of T: α =0.05 and K\u003d 16 according to the table of critical points of Student's distribution (Table 4 of the Appendix) we find: \u003d 2.12. Thus, the interval for accepting the hypothesis H0 about the equality of the average milk yields of cows receiving diets No. 1 and No. 2 is the interval = (-2.12; 2.12). And since = - 0.79 falls into this interval, we have no reason to reject the hypothesis H0 . That is, we have the right to assume that the difference in feed rations does not affect the average daily milk yield of cows.

Note 2. In paragraphs 3.4 and 3.5 discussed above, the null hypothesis was considered H0 about equality M(X)=M(Y) under the alternative hypothesis H1 about their inequality: M(X)≠M(Y). But the alternative hypothesis H1 there may be other, for example, M(Y)>M(X). In practice, this case will take place when some improvement (positive factor) is introduced, which allows us to count on an increase in the average values ​​of a normally distributed random variable Y compared with the values ​​of the normally distributed quantity X. For example, a new feed additive has been introduced into the diet of cows, which makes it possible to count on an increase in the average milk yield of cows; an additional top dressing was introduced under the crop, which makes it possible to count on an increase in the average crop yield, etc. And I would like to find out whether this introduced factor is significant (significant) or insignificant. Then in the case of large volumes and Samples (see paragraph 3.4) as a criterion for the validity of the hypothesis H0 consider a normally distributed random variable

At a given level of significance α Hypothesis H0 about equality M(X) and M(Y) will be rejected if the experimental value of quantity is positive and larger, where

Since, under the validity of the hypothesis H0 M(Z)= 0, then

Comparison of the averages of two populations is of great practical importance. In practice, there is often a case when the average result of one series of experiments differs from the average result of another series. In this case, the question arises whether the observed discrepancy between the averages can be explained by the inevitable random errors of the experiment, or whether it is caused by certain regularities. In industry, the task of comparing averages often arises when sampling the quality of products manufactured on different installations or under different technological regimes, in financial analysis - when comparing the level of profitability of various assets, etc.

Let's formulate the task. Let there be two populations characterized by general means and and known variances and. It is necessary to test the hypothesis about the equality of the general averages, i.e. :=. To test the hypothesis, two independent samples of volumes and were taken from these populations, for which the arithmetic means and and sample variances and were found. With sufficiently large sample sizes, the sample means and have an approximately normal distribution law, respectively, and. If the hypothesis is true, the difference - has a normal distribution law with mathematical expectation and dispersion.

Therefore, when the hypothesis is fulfilled, the statistics

has a standard normal distribution N(0; 1).

Testing hypotheses about numerical values ​​of parameters

Hypotheses about numerical values ​​occur in various problems. Let be the values ​​of some parameter of products produced by the automatic line machine, and let be the given nominal value of this parameter. Each individual value can, of course, somehow deviate from the given face value. Obviously, in order to check the correct setting of this machine, you need to make sure that the average value of the parameter for the products produced on it will correspond to the nominal value, i.e. test a hypothesis against an alternative, or, or

With an arbitrary setting of the machine, it may be necessary to test the hypothesis that the accuracy of manufacturing products for a given parameter, given by dispersion, is equal to a given value, i.e. or, for example, the fact that the proportion of defective products produced by the machine is equal to the given value p 0 , i.e. etc.

Similar problems may arise, for example, in financial analysis, when, according to the sample data, it is necessary to establish whether the return on an asset of a certain type or portfolio of securities can be considered, or its risk equal to a given number; or, based on the results of a selective audit of similar documents, you need to make sure whether the percentage of errors made can be considered equal to the face value, etc.

In the general case, hypotheses of this type have the form, where is a certain parameter of the distribution under study, and is the area of ​​its specific values, consisting in a particular case of one value.

Statistical Hypothesis Testing: Hypothesis of Equal Means for Two Samples

The work is auxiliary in nature, should serve as a fragment of other laboratory work.

No competent sociological research can do without putting forward hypotheses. By and large, one can generally say that its main goal is to refute or confirm any assumption of the researcher about social reality on the basis of the empirical data he has collected. We put forward a hypothesis, collect data and draw a conclusion based on statistical material. But it is this hypothesis-data-conclusion chain that contains a lot of questions that almost any novice researcher faces. The main of these questions is the following: how to translate the hypothesis put forward by us into mathematical language so that it can then be correlated with a statistical array and, processed using the methods of mathematical statistics, be refuted or confirmed? Here we will try to answer this question using the example of testing hypotheses about the equality of means.

Testing statistical hypotheses about equality of means

A statistical hypothesis refers to various kinds of assumptions about the nature or parameters of the distribution of a random variable that can be tested based on the results in a random sample.

It should be borne in mind that testing a statistical hypothesis is probabilistic in nature. Just as we can never be 100% sure that any sample parameter matches the population parameter, we can never absolutely say whether the hypothesis we put forward is true or false.

In order to test a statistical hypothesis, you need the following:

1. Convert the meaningful hypothesis into a statistical one: formulate the null and alternative statistical hypotheses.

2. Define dependencies or our independent samples.

3. Determine the volume of samples.

4. Select a criterion.

5. Choose a significance level that controls the acceptable probability of a Type I error and determine the range of acceptable values.

7. Reject or accept the null hypothesis.

Now let's look at each of the six points in more detail.

Statement of the hypothesis

In statistical problems, it is often necessary to compare the means of two different samples. . For example, we may be interested in the difference in the average salaries of men and women, the average ages of certain groups<А>and<В>etc. Or, by forming two independent experimental groups, we can compare their means to see how different, say, the effects of two different drugs on blood pressure are, or how much group size affects students' grades. Sometimes it happens that we divide the population into two groups in pairs, that is, we are dealing with twins, married couples or the same person before and after some experiment, etc. To make it clearer, let's look at typical examples where various criteria for the equality of means are applied.

Example #1. The company has developed two different drugs that lower blood pressure (let's call them drugs X and Y) and wants to know whether or not the effects of these drugs are different in patients with hypertension. Out of 50 people with the corresponding disease, 20 are randomly selected and these 20 are randomly divided into two groups of 10 people. The first group uses the drug for a week X, the second - drug Y. Then the blood pressure is measured in all patients. Substantive hypothesis put forward: drugs X and Y have different effects on the blood pressure of patients.

Example #2. The researcher wants to know how lecture duration affects student performance. Suppose he chose the following path: out of 200 students, he randomly chose 50 people and monitored their progress for a month. He then extended the lectures by 10 minutes and over the next month looked at the progress of the same 50 students. Then he compared the results of each student before and after increasing the duration of the lecture. Substantive hypothesis put forward: Lecture duration affects student performance.

Example #3. Out of 200 students, 80 people were randomly selected, and these 80 people were divided into two groups of 40. One group was asked a question without setting:<Сколько вы готовы заплатить за натуральный йогурт?>, and the second group was asked a question about the installation:<Сколько вы готовы заплатить за натуральный йогурт, если известно, что люди, потребляющие йогуртовые культуры, страдают на 10-15% меньше от заболеваний желудка?>The researcher assumed that the positive information about the product contained in the second question would influence the respondent, and people answering the question with the installation would be willing to pay more for yogurt than those who were asked the question without the installation. Substantive hypothesis put forward: posing the question influences the response of the respondent.

Before us are three examples, each of which demonstrates the formulation of a meaningful hypothesis. Now let's transform our meaningful hypotheses into statistical ones, but first, let's say a little about statistical hypotheses in general.

The most common approach to formulating statistical hypotheses is to put forward two bilateral hypotheses:

As can be seen from the formula, the null hypothesis says that some sample parameter or, say, the difference between the parameters of two samples is equal to a certain number a. The alternative hypothesis states the opposite: the parameter of interest to us is not equal to a. Thus, these two hypotheses contain all possible outcomes.

It is also possible to formulate one-sided hypotheses:

Sometimes such hypotheses turn out to be more meaningful. They usually occur when the probability that our parameter may be greater (or less) a is zero, which means it is impossible.

We now formulate the null and alternative statistical hypotheses for our three examples.

Table number 1.

Example #1

Example #2

Example #3

Drugs X and Y have different effects on blood pressure in patients

Lecture length affects student performance

Asking a question influences the response of the respondent

Researcher's task

4. Find the arithmetic mean of the differences for all students, denoted

Null hypothesis

The meaning of the null hypothesis

and the averages of the general populations from which the samples with the averages are taken. The null hypothesis says that the effect of both drugs on pressure is insignificant on average, and even if the sample means are not equal, this is due only to sampling error or other reasons beyond our control.

Mean of differences for students in the general population. The null hypothesis says that in fact there is no difference between the student's average score before and after the increase in the duration of the lecture, and even if the sample mean of the differences is different from zero, this is due only to sampling error or other reasons beyond our control.

Since it is the same as in example No. 1, explanations can be found in the first column (see example 1)

Alternative hypothesis

Conclusion regarding the content hypothesis

If we accept the null hypothesis that the drugs have the same effect (there is no difference between the means), then we reject the content hypothesis, otherwise we accept the content hypothesis

If we accept the null hypothesis that lecture duration does not affect performance, then we reject the content hypothesis and vice versa

If we accept the null hypothesis - the question does not affect the choice of the respondent, then we reject the content hypothesis and vice versa.

One of the simplest cases of testing a statistical hypothesis is to test for equality between the population mean and some given value. The given value is some fixed number µ 0 obtained not from selective data. The hypotheses are as follows.

H 0: µ = µ 0 - the null hypothesis states that the unknown population mean µ is exactly equal to the given value µ 0 .

H 1: µ µ 0 - the alternative hypothesis states that the unknown population mean µ is not equal to the given value µ 0 .

Notice that there are actually three different numbers involved here that have to do with the mean:

§ µ is the unknown population mean that you are interested in;

§ µ 0 - given the value against which the hypothesis is being tested;

§ - known sample mean, which is used to make a decision on accepting the hypothesis. Of these three numbers, only this value is a random variable, as it is calculated from the sample data. notice, that is an estimate and therefore represents µ.

Hypothesis testing consists in comparing two known values ​​and µ 0 . If these values ​​differ more than would be expected by chance, then the null hypothesis µ = µ 0 is rejected because it provides information about the unknown mean µ. If the values ​​and µ 0 are close enough, then the null hypothesis µ = µ 0 is accepted. But what does “values ​​are close” mean? Where is the required boundary? Proximity must be determined based on the value, since this standard error determines the degree of randomness. Thus, if µ 0 and are separated by a sufficient number of standard errors, then this is convincing evidence that µ is not equal to µ 0 .

Exist two various methods for testing the hypothesis and obtaining the result. The first the method uses the confidence intervals discussed in the previous chapter. This is an easier method because (a) you already know how to construct and interpret a confidence interval, and (b) the confidence interval is straightforward to interpret because it is expressed in the same units as the data (e.g., dollars, number of people , the number of breakdowns). Second method (based on t-statistics) is more traditional, but less intuitive, since it consists in calculating an indicator that is not measured in the same units as the data, comparing the resulting value with the corresponding critical value from the t-table and then draw a conclusion.

Checking if the average is equal to a certain value.

The samples are drawn from a population that has a normal distribution, the data are independent.

Criteria value is calculated by the formula:

where N is the sample size;

S 2 - empirical sample variance;

A - the estimated value of the average value;

X is the average value.

The number of degrees of freedom for the t-test V = n-1.

Zero new hypothesis

H 0: X \u003d A vs. H A: X≠A. The null hypothesis about the equality of the means is rejected if the absolute value of the criterion value is greater than the upper α/2% of the point of the t-distribution taken with V degrees of freedom, that is, when │t│> t vα/2 .

H 0: X< А против Н А: X >A. The null hypothesis is rejected if the criterion value is greater than the upper α% point of the t-distribution taken with V degrees of freedom, that is, when │t│> t vα .

H 0: X>A vs. H A: X< А. Нулевая гипотеза отвергается, если критериальное значение меньше нижней α% точки t-распределения, взятого с V степенями свободы.

The criterion is stable for small deviations from the normal distribution.

Example

Consider the example shown in Fig. 5.10. Let's say that we need to test the hypothesis that the sample mean (cells 123:130) is equal to 0.012.

First we find the sample mean (=AVERAGE(123:130) in I31) and the variance (=VAR(I23:I30) in I32). After that, we calculate the criterial (=(131-0.012)*ROOT(133)/132) and critical (=STEUDRASP(0.025;133-1)) values. Since the criterion value (24.64) is greater than the critical value (2.84), the hypothesis about the equality of the mean 0.012 is rejected.

Figure 5.10 Comparing mean value with constant

1. test hypotheses about means and variances using Fisher and Cochran's parametric tests (table 5.4);

2. test the hypothesis about the equality of the means with unequal variances of the samples (to do this, remove 1 or 2 values ​​in one of the samples of your version) (table 5.4);

3. check the hypothesis that the average is equal to the given value A (table 5.5) and the data from the 1st column for the variant.

Table 5.4

Task options

Experiment data
Option
2,3 2,6 2,2 2,1 2,5 2,6
1,20 1,42 17,3 23,5 2,37 2,85 35,2 26,1 2,1 2,6
5,63 5,62 26,1 27,0 5,67 2,67 35,9 25,8 5,1 5,63
2,34 2,37 23,9 23,3 2,35 2,34 33,6 23,8 2,34 2,38
7,71 7,90 28,0 25,2 2,59 2,58 35,7 26,0 7,63 7,6,1
1,2 1,6 1,7 2,6 1,9 2,8
1,13 1,15 21,6 21,2 2,13 2,16 31,7 1,12 1,12
1,45 1,47 24,7 24,8 2,45 2,47 34,8 24,5 1,49 1,45
3,57 3,59 25,9 25,7 2,55 2,59 36,0 25,7 3,58 3,58
3,3 3,6 2,5 2,4 3,4 3,5
Experiment data
Option
7,3 7,6 12,2 12,1 3,5 4,6
6,20 6,42 217,3 230,5 12,37 12,85 75,2 86,1 3,1 4,6
7,63 5,62 264,1 278,0 15,67 14,67 75,9 75,8 5,1 5,63
6,34 5,37 233,9 236,3 12,35 12,34 73,6 73,8 3,34 4,38
7,71 7,90 281,0 255,2 12,59 12,58 85,7 86,0 3,63 4,6,1
6,2 6,6 11,7 12,6 3,9 4,8
4,13 4,15 251,6 261,2 12,13 12,16 71,7 5,12 4,12
5,45 6,47 244,7 247,8 12,45 12,47 74,8 84,5 3,49 4,45
5,57 5,59 250,9 255,7 12,55 12,59 86,0 85,7 3,58 3,58
5,3 5,6 12,5 12,4 3,4 3,5

Table 5.5

A value

Options
2,2 2,2 2,2 6,5 12,2 3,5

You can use your experimental data as the initial data in the task.

The report should contain calculations of statistical characteristics.

Test questions:

1. What statistical problems are solved in the study of technological processes in the food industry?

2. How are the statistical characteristics of random variables compared?

3. Significance level and confidence level with the reliability of the experimental data assessment.

4. How are statistical hypotheses tested using goodness-of-fit tests?

5. What determines the power of the goodness of fit criterion for the analysis of experimental samples?

6. How is the selection of a criterion for solving problems of analysis of technological processes of food production carried out?

7. How is the classification of the agreement criteria for the analysis of samples of the results of studies of technological processes of food production carried out?

8. What are the requirements for sampling the results of research on technological processes for food production?