Testing the hypothesis that the population mean is equal to some given value. Testing statistical hypotheses about equality of means

Sometimes it turns out that the average result from the main series of experiments differs from the average result from another series of experiments. It is necessary to determine whether this difference is accidental or not, i.e. can we consider that the result of the experiment represents a sample from two independent populations with the same means, or the means of these populations are not equal.

The formal formulation of this problem is as follows: two random variables distributed according to the normal law are studied:

, Where σ – standard deviation.

It is assumed that the variances are known, but the mathematical expectations are unknown.

Let there be two series of observations of the quantities Χ and Υ.

Χ: x 1, x 2, ..., x n 1.

Υ: y 1, y 2, …, y n 2.

We put forward the following hypothesis that m x =m y. Based on observations, it is necessary to confirm or refute this hypothesis. If the null hypothesis is confirmed, then we can say that the differences between the average values ​​in the two samples are statistically insignificant, i.e. explained as a random error.

A z-test is used to test this hypothesis. For this purpose it is calculated

z-test (z-statistic), which is defined as follows:

Arithmetic mean of the series n observations.

The z-test is normally distributed with zero mathematical expectation and unit variance.

H 1: m x ≠ m y

The null hypothesis that the means are equal: H0: =

The alternative hypothesis that the means are not equal is as follows : H 1: ≠.

With an alternative hypothesis, the following options are possible: either< , либо >. Accordingly, we must apply a two-sided test. Thus, there are two critical points: and.

These points are selected from the condition:

(1) Р(-∞

(2) P(

By value we determine the left and right critical points.

,

where F(z) is the cumulative distribution function of the random variable Z, and F -1 (...) is the inverse function.

Definition: Let the function y = f(x) be defined on the segment , and let the set of values ​​of this function be the segment [α, β]. Let, further, each y from the segment [α, β] corresponds to only one value x from the segment for which f(x) = y. Then on the segment [α, β] we can define the function x = f -1 (y), assigning to each y from [α, β] the value x from for which f(x) = y. The function x = f -1 (y) is called the inverse of the function y = f(x).

The values ​​of critical points can be found using the function: =NORMSINV, by specifying the probability value () in the dialog box - to find the value , or the value (1 - ) - to find the value ).

Magnitude Z, normally distributed with parameters Z=N(0;1), distributed symmetrically:

0,05

Geometric interpretation: the probability of falling in the area where the hypothesis is rejected is equal to the sum of the shaded areas.

Testing sequence:

1. Calculate statistics Z.

2. We set the level of significance.

3. We determine critical points based on conditions (1) and (2).

4. Compare the value calculated in step 1 Z with the value of critical points:

If the value Z- statistics will be greater in absolute value than the value of the critical point, then the null hypothesis is rejected at this level of significance. This means that the two populations from which the sample is drawn are different and, therefore, the means and expectations for these samples are not equal. Otherwise, the hypothesis of equality of means is accepted, and the two populations can be considered as one in common with the same mathematical value.

There is an analysis tool in EXCEL called “two-sample Z-test for averages" (Service - data analysis - two-sample Z- test for averages). It serves to test the hypothesis about the difference between the means (mathematical expectations) of two normal distributions with known variances.

When this tool is called, a dialog box appears in which the following parameters are set:

*Hypothetical mean difference: enter the number of the expected difference between the means for the general sequence being studied. To test the hypothesis of equality of means, you must enter the value zero.

* Variance of variable 1 (known): a known value of the variance of the random variable X is introduced.

* Variance of variable 2 (known): a known value of the variance of the random variable Y is introduced.

* Labels: if activated, the first line is perceived as a heading and is not counted.

* Alpha: the significance level is set equal to the probability of making a type I error.

TASK 1:

Selected data on the diameter of the rollers in millimeters produced by machines 1 and 2 are known.

Dispersion for machine 1: = 5 mm 2.

Dispersion for machine 2: =7 mm 2.

Significance level = 0.05.

1.Using two-sample Z- test for averages check the hypothesis of equality of average values ​​for your option.

2. Check the same hypothesis using calculation formulas.

The homogeneity of two samples is checked using the Student's test (or t– criterion). Let us consider the formulation of the problem of checking the homogeneity of two samples. Let two samples of volume and be made. It is necessary to test the null hypothesis that the general means of the two samples are equal. That is, and. n 1

Before considering the methodology for solving the problem, let's consider some theoretical principles used to solve the problem. Famous mathematician W.S. Gosset (who published a number of his works under the pseudonym Student) proved that statistics t(6.4) obeys a certain distribution law, which was later called the Student distribution law (the second name of the law is “ t– distribution”).

Average value of a random variable X;

Mathematical expectation of a random variable X;

Standard deviation of the average sample volume n.

The estimate of the standard deviation of the average is calculated using formula (6.5):

Standard deviation of a random variable X.

The Student distribution has one parameter - the number of degrees of freedom.

Now let’s return to the original formulation of the problem with two samples and consider a random variable equal to the difference between the means of two samples (6.6):

(6.6)

Provided that the hypothesis of equality of general means is satisfied, (6.7) holds:

(6.7)

Let us rewrite relation (6.4) in relation to our case:

The estimate of the standard deviation can be expressed in terms of the estimate of the standard deviation of the combined population (6.9):

(6.9)

An estimate of the variance of the pooled population can be expressed in terms of variance estimates calculated from two samples and :

(6.10)

Taking into account formula (6.10), relation (6.9) can be rewritten as (6.11). Relationship (6.9) is the main calculation formula for the problem of comparing averages:

When substituting the value into formula (6.8), we will have a sample value t-criteria. According to Student distribution tables with the number of degrees of freedom and a given level of significance can be determined. Now, if , then the hypothesis about the equality of the two means is rejected.

Let's look at an example of performing calculations to test the hypothesis of the equality of two averages in EXCEL. Let's create a data table (Fig. 6.22). We will generate the data using the random number generation program of the Data Analysis package:

X1 sample from normal distribution with parameters volume;

X2 sample from a normal distribution with volume parameters;

X3 sample from normal distribution with parameters volume;

X4 sample from normal distribution with parameters volume.


Let's check the hypothesis of equality of two averages (X1-X2), (X1-X3), (X1-X4). First, let's calculate the parameters of feature samples X1-X4 (Fig. 6.23). Then we calculate the value t- criteria. Calculations will be performed using formulas (6.6) – (6.9) in EXCEL. We summarize the calculation results in a table (Fig. 6.24).

Rice. 6.22. Data table

Rice. 6.23. Parameters of feature samples X1-X4

Rice. 6.24. Summary table for calculating values t– criteria for pairs of characteristics (X1-X2), (X1-X3), (X1-X4)

According to the results shown in the table in Fig. 6.24 we can conclude that for a pair of signs (X1-X2) the hypothesis of equality of the averages of two signs is rejected, and for pairs of signs (X1-X3), (X1-X4) the hypothesis can be considered valid.

The same results can be obtained using the Two-Sample program. t-test with equal variances” of the Data Analysis package. The program interface is shown in Fig. 6.25.

Rice. 6.25. Two-Sample Program Options t- test with equal variances”

The results of calculations for testing hypotheses of equality of two average pairs of characteristics (X1-X2), (X1-X3), (X1-X4), obtained using the program are shown in Fig. 6.26-6.28.

Rice. 6.26. Calculation of value t– criterion for a pair of characteristics (X1-X2)

Rice. 6.27. Calculation of value t– criterion for a pair of characteristics (X1-X3)

Rice. 6.28. Calculation of value t– criterion for a pair of characteristics (X1-X4)

Two-sample t-test with equal variances is otherwise called t-test with independent samples. Also received wide distribution t-test with dependent samples. The situation when it is necessary to apply this criterion arises when the same random variable is measured twice. The number of observations in both cases is the same. Let us introduce notation for two successive measurements of some property of the same objects, , and denote the difference of two successive measurements:

In this case, the formula for the sample value of the criterion takes the form:

, (6.13)

(6.15)

In this case, the number of degrees of freedom is . Hypothesis testing can be performed using the Paired Two-Sample program. t-test” data analysis package (Fig. 6.29).

Rice. 6.29. Parameters of the “Paired two-sample” program t-test"

6.5. Analysis of variance – classification according to one criterion (F - criterion)

In variance analysis, a hypothesis is tested, which is a generalization of the hypothesis of the equality of two means to the case when the hypothesis of the equality of several means is tested simultaneously. Analysis of variance examines the degree of influence of one or more factor characteristics on the resulting characteristic. The idea of ​​analysis of variance belongs to R. Fischer. He used it to process the results of agronomic experiments. Analysis of variance is used to establish the significance of the influence of qualitative factors on the value under study. The English abbreviated name for analysis of variance is ANOVA (analysis variation).

The general form of data presentation with classification according to one criterion is presented in Table 6.1.

Table 6.1. Data presentation form with classification according to one characteristic

Checking whether the average is equal to a certain value.

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

The criterion value is calculated using the formula:

where N is the sample size;

S 2 - empirical sample variance;

A is the expected value of the average value;

X is the average value.

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

Zero your hypothesis

N 0: X = A versus N A: X≠A. The null hypothesis of equality of means is rejected if, in absolute value, the criterion value is greater than the upper α/2% 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

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

First, we find the sample mean (=AVERAGE(123:130) in I31) and variance (=VARIANCE(I23:I30) in I32). After this, we calculate the criterion (=(131-0.012)*ROOT(133)/132) and critical (=STUDISCOVER(0.025,133-1)) values. Since the criterion value (24.64) is greater than the critical value (2.84), the hypothesis that the mean is equal to 0.012 is rejected.

Figure 5.10 Comparing the average value with a constant

1. test hypotheses about means and variances using the parametric tests of Fisher and Cochran (Table 5.4);

2. test the hypothesis about the equality of means with unequal sample variances (to do this, remove 1 or 2 values ​​in one of the samples of your variant) (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 option.

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

Value A

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

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

The report must contain calculations of statistical characteristics.

Security questions:

1. What statistical problems are solved when studying technological processes in the food industry?

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

3. Level of significance and confidence level for the reliability of the assessment of experimental data.

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

5. What does the power of the goodness-of-fit test for analyzing experimental samples depend on?

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

7. How is the classification of agreement criteria for analyzing samples of research results on technological processes of food production carried out?

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

Example. The income of pharmacies in one of the city's microdistricts for a certain period amounted to 128; 192; 223; 398; 205; 266; 219; 260; 264; 98 (conventional units). In the neighboring microdistrict for the same time they were equal to 286; 240; 263; 266; 484; 223; 335.
For both samples, calculate the mean, corrected variance, and standard deviation. Find the range of variation, average absolute (linear) deviation, coefficient of variation, linear coefficient of variation, coefficient of oscillation.
Assuming that a given random variable is normally distributed, determine the confidence interval for the general mean (in both cases).
Using the Fisher criterion, check the hypothesis of equality of general variances. Using the Student's test, check the hypothesis about the equality of general means (the alternative hypothesis is about their inequality).
In all calculations, the significance level is α = 0.05.

We carry out the solution using the calculator Testing the hypothesis of equality of variances.
1. Find the variation indicators for the first sample.

x|x - x av |(x - x avg) 2
98 127.3 16205.29
128 97.3 9467.29
192 33.3 1108.89
205 20.3 412.09
219 6.3 39.69
223 2.3 5.29
260 34.7 1204.09
264 38.7 1497.69
266 40.7 1656.49
398 172.7 29825.29
2253 573.6 61422.1


.



Variation indicators.
.

R = X max - X min
R = 398 - 98 = 300
Average linear deviation


Each value of the series differs from the other by an average of 57.36
Dispersion


Unbiased variance estimator


.

Each value of the series differs from the average value of 225.3 by an average of 78.37
.

.

Coefficient of variation

Since v>30%, but v or

Oscillation coefficient

.
.


Using the Student's table we find:
T table (n-1;α/2) = T table (9;0.025) = 2.262

(225.3 - 59.09;225.3 + 59.09) = (166.21;284.39)

2. Find the variation indicators for the second sample.
Let's rank the row. To do this, we sort its values ​​in ascending order.
Table for calculating indicators.

x|x - x av |(x - x avg) 2
223 76.57 5863.18
240 59.57 3548.76
263 36.57 1337.47
266 33.57 1127.04
286 13.57 184.18
335 35.43 1255.18
484 184.43 34013.9
2097 439.71 47329.71

To evaluate the distribution series, we find the following indicators:
Distribution center indicators.
Simple arithmetic average


Variation indicators.
Absolute variations.
The range of variation is the difference between the maximum and minimum values ​​of the primary series characteristic.
R = X max - X min
R = 484 - 223 = 261
Average linear deviation- calculated in order to take into account the differences of all units of the population under study.


Each value of the series differs from the other by an average of 62.82
Dispersion- characterizes the measure of dispersion around its average value (a measure of dispersion, i.e. deviation from the average).


Unbiased variance estimator- consistent estimate of variance (corrected variance).


Standard deviation.

Each value of the series differs from the average value of 299.57 by an average of 82.23
Estimation of standard deviation.

Relative Variation Measures.
Relative indicators of variation include: coefficient of oscillation, linear coefficient of variation, relative linear deviation.
Coefficient of variation- a measure of the relative dispersion of population values: shows what proportion of the average value of this value is its average dispersion.

Since v ≤ 30%, the population is homogeneous and the variation is weak. The results obtained can be trusted.
Linear coefficient of variation or Relative linear deviation- characterizes the proportion of the average value of the sign of absolute deviations from the average value.

Oscillation coefficient- reflects the relative fluctuation of the extreme values ​​of the characteristic around the average.

Interval estimation of the population center.
Confidence interval for general mean.

Determine the t kp value using the Student distribution table
Using the Student's table we find:
T table (n-1;α/2) = T table (6;0.025) = 2.447

(299.57 - 82.14;299.57 + 82.14) = (217.43;381.71)
With a probability of 0.95, it can be stated that the average value with a larger sample size will not fall outside the found interval.
We test the hypothesis of equality of variances:
H 0: D x = D y ;
H 1: D x Let's find the observed value of the Fisher criterion:

Since s y 2 > s x 2, then s b 2 = s y 2, s m 2 = s x 2
Number of degrees of freedom:
f 1 = n y – 1 = 7 – 1 = 6
f 2 = n x – 1 = 10 – 1 = 9
Using the table of critical points of the Fisher–Snedecor distribution at a significance level of α = 0.05 and given numbers of degrees of freedom, we find F cr (6;9) = 3.37
Because F obs. We test the hypothesis about the equality of general means:


Let's find the experimental value of the Student's criterion:


Number of degrees of freedom f = n x + n y – 2 = 10 + 7 – 2 = 15
Determine the t kp value using the Student distribution table
Using the Student's table we find:
T table (f;α/2) = T table (15;0.025) = 2.131
Using the table of critical points of the Student distribution at a significance level of α = 0.05 and a given number of degrees of freedom, we find t cr = 2.131
Because t obs.

Let's 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, replacing the general variances and included in (3.15) with 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 unknown general and 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 distribution, and in this case to construct a criterion for testing the hypothesis H0 X And Y. To do this, introduce a random variable

, (3.16)

(3.17)

The mean of the corrected sample variances and , serving as a point estimate of both identical unknown population variances and . As it turns out (see, p. 180), if the null hypothesis is true H0 random variable T has a Student distribution with degrees of freedom regardless of sample sizes and sizes. If the hypothesis H0 is true, then the difference should be small. That is, the experimental value T Exp. quantities T should be small. Namely, it must be within certain boundaries. If it goes beyond these boundaries, we will consider it a refutation of the hypothesis. H0, and we will assume this with a probability equal to the specified significance level α .

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

The value determined by equality (3.18) for different significance levels α and various numbers K degrees of freedom of quantity T can be found in the table of critical points of the Student distribution (Table 4 of the Appendix). Thus, the hypothesis acceptance interval will be found H0. And if the experimental value T Exp values T falls into this interval - hypothesis H0 accepted. If it doesn't hit, they won't accept it.

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

(3.19)

If the corrected sample variances 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 doubled. And this leads to a significant expansion of the hypothesis acceptance interval H0 and, accordingly, to a significant narrowing of the critical area of ​​non-acceptance of this hypothesis. And this is quite fair, since the degree of spread of possible values ​​of the difference will be mainly determined by the spread of values ​​of one of the quantities X And Y, which has a large dispersion. That is, information from a sample with less variance seems to disappear, which leads to greater uncertainty in conclusions about the hypothesis H0 .

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

Number of cows receiving the diet

(Heads)

Average daily milk yield in terms of basic fat content

(kg/head)

Standard deviation of daily milk production of cows

(kg/head)

. Since the tabular data presented were obtained on the basis of small samples with volumes =10 and =8, then to compare the mathematical expectations of the average daily milk yield of cows receiving both 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 . To do this, we use the Fisher-Snedecor criterion (see paragraph 3.3). We have:

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

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

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

Further, according to the formula find the number K degrees of freedom of quantity T: K=10+8-2=16. After that for n0+8-2=16. oods (3.16) we calculate the experimental value of the value T: Y feed rations, we must use α =0.05 and K=16 from the table of critical points of the Student distribution (Table 4 of the Appendix) we find: =2.12. Thus, the hypothesis acceptance interval H0 about the equality of average milk yields of cows receiving rations No. 1 and No. 2, 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 alternative hypothesis H1 about their inequality: M(X)≠M(Y). But the alternative hypothesis H1 there may be another one, for example, M(Y)>M(X). In practice, this case will occur when some improvement (positive factor) is introduced, which allows us to count on an increase in the average value of a normally distributed random variable Y compared to the values ​​of a normally distributed quantity X. For example, a new feed additive has been introduced into the diet of cows, which makes it possible to expect an increase in the average milk yield of cows; additional fertilizing has been added to the crop, allowing us to expect an increase in the average yield of the crop, 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 significance level α Hypothesis H0 about equality M(X) And M(Y) will be rejected if the experimental value of the quantity is positive and larger, where

Since if the hypothesis is true H0 M(Z)= 0, then

CATEGORIES

POPULAR ARTICLES

2024 “kingad.ru” - ultrasound examination of human organs