Menu

How to find confidence boundaries. Calculating Confidence Interval in Microsoft Excel

Preparing plants for winter

Estimating Confidence Intervals

Learning objectives

Statistics considers the following two main tasks:

    We have some estimate based on sample data, and we want to make some probabilistic statement about where the true value of the parameter being estimated is.

    We have a specific hypothesis that needs to be tested based on sample data.

In this topic, we consider the first task. We also introduce the definition of the confidence interval.

The confidence interval is an interval that is built around the estimated parameter value and shows where the true value of the estimated parameter is located with a priori given probability.

Having studied the material on this topic, you:

    find out what the confidence interval of the estimate is;

    learn to classify statistical tasks;

    master the technique of constructing confidence intervals, both according to statistical formulas and using software tools;

    learn how to determine the required sample sizes to achieve certain parameters of the accuracy of statistical estimates.

Distributions of sample characteristics

T-distribution

As discussed above, the distribution of the random variable is close to the standardized normal distribution with parameters 0 and 1. Since we do not know the value of σ, we replace it with some estimate s. The quantity already has a different distribution, namely, or Student's t distribution, which is determined by the parameter n -1 (the number of degrees of freedom). This distribution is close to the normal distribution (the larger n, the closer the distributions).

In fig. 95
the Student's distribution with 30 degrees of freedom is presented. As you can see, it is very close to the normal distribution.

Similarly to the functions for working with the normal distribution NORMDIST and NORMINV, there are functions for working with the t-distribution - TDIST and TINV... An example of using these functions can be found in the TDIST.XLS file (template and solution) and in Fig. 96
.

Distributions of other characteristics

As we already know, to determine the accuracy of the estimation of the mathematical expectation, we need the t-distribution. To estimate other parameters, such as variance, different distributions are required. Two of them are the F-distribution and x 2 -distribution.

Confidence interval for mean

Confidence interval is an interval that is built around the estimated parameter value and shows where the true value of the estimated parameter is located with a priori given probability.

The construction of the confidence interval for the mean occurs in the following way:

Example

The fast food restaurant is planning to expand its assortment with a new type of sandwich. In order to assess the demand for it, the manager plans to randomly select 40 visitors from those who have already tried it and invite them to rate their attitude to the new product in points from 1 to 10. The manager wants to estimate the expected number of points that the new product will receive and plot the 95% confidence interval for this estimate. How can this be done? (see file SANDWICH1.XLS (template and solution).

Solution

To solve this problem, you can use. The results are shown in Fig. 97
.

Confidence interval for cumulative value

Sometimes, based on sample data, it is required to estimate not the mathematical expectation, but the total sum of values. For example, in a situation with an auditor, it may not be of interest to estimate the average value of an account, but the sum of all accounts.

Let N - the total number of elements, n - the sample size, T 3 - the sum of the values ​​in the sample, T "- the estimate for the sum over the entire population, then , and the confidence interval is calculated by the formula, where s is the estimate of the standard deviation for the sample, is the estimate of the mean for the sample.

Example

Let's say some tax office wants to estimate the total tax refunds for 10,000 taxpayers. The taxpayer either receives a refund or pays additional taxes. Find the 95% confidence interval for the refund amount assuming the sample size is 500 people (see RETURNS SUM.XLS file (template and solution).

Solution

There is no special procedure in StatPro for this case, however, you will notice that the bounds can be obtained from the bounds for the mean based on the above formulas (Fig. 98
).

Confidence interval for proportion

Let p be the mathematical expectation of the share of customers, and p in the estimate of this share obtained from a sample of size n. It can be shown that for sufficiently large the distribution of the estimate will be close to normal with mean p and standard deviation ... In this case, the standard error of the estimate is expressed as , and the confidence interval as .

Example

The fast food restaurant is planning to expand its assortment with a new type of sandwich. In order to estimate the demand for it, the manager randomly selected 40 visitors from those who have already tried it and invited them to rate their attitude to the new product in points from 1 to 10. The manager wants to estimate the expected share of customers who rate the new product at least than 6 points (he expects these customers to be the consumers of the new product).

Solution

Initially, we create a new column based on 1 if the client's score was more than 6 points and 0 otherwise (see the file SANDWICH2.XLS (template and solution).

Method 1

Counting the quantity 1, we estimate the share, and then we use the formulas.

The z cr value is taken from special tables of the normal distribution (for example, 1.96 for the 95% confidence interval).

Using this approach and specific data to construct a 95% interval, we obtain the following results (Fig. 99
). The critical value of the parameter z cr is 1.96. The standard error of the estimate is 0.077. The lower limit of the confidence interval is 0.475. The upper limit of the confidence interval is 0.775. Thus, the manager has the right to assume with 95% confidence that the percentage of customers who rated the new product 6 points or higher will be between 47.5 and 77.5.

Method 2

This task can be solved using standard StatPro tools. To do this, it is enough to note that the share in this case coincides with the average value of the Type column. Next, let's apply StatPro / Statistical Inference / One-Sample Analysis to build the confidence interval of the mean (estimate of the expected value) for the Type column. The result obtained in this case will be very close to the result of the 1st method (Fig. 99).

Confidence interval for standard deviation

As an estimate of the standard deviation, s is used (the formula is given in Section 1). The density function of the estimate s is the chi-square function, which, like the t-distribution, has n-1 degrees of freedom. There are special functions for working with this CHIDIST and CHIINV distribution.

The confidence interval in this case will no longer be symmetrical. A schematic diagram of the boundaries is shown in Fig. 100 .

Example

The machine must produce parts with a diameter of 10 cm. However, due to various circumstances, errors occur. The quality inspector is concerned about two things: first, the average should be 10 cm; secondly, even in this case, if the deviations are large, then many parts will be rejected. Every day he makes a sample of 50 parts (see the file QUALITY CONTROL.XLS (template and solution). What conclusions can such a sample give?

Solution

Plot the 95% confidence intervals for the mean and standard deviation using StatPro / Statistical Inference / One-Sample Analysis(fig. 101
).

Further, using the assumption of a normal distribution of diameters, we calculate the proportion of defective products, setting a maximum deviation of 0.065. Using the capabilities of the substitution table (the case of two parameters), we will construct the dependence of the share of rejects on the mean and standard deviation (Fig. 102
).

Confidence interval for the difference between two means

This is one of the most important applications of statistical methods. Examples of situations.

    A clothing store manager would like to know how much more or less an average female shopper spends in a store than a man.

    The two airlines fly similar routes. The consumer organization would like to compare the difference between the average expected flight delays for both airlines.

    The company sends coupons for certain types of goods in one city and does not send in another. Managers want to compare the average purchase volumes of these items over the next two months.

    The car dealer often deals with married couples at presentations. Couples are often interviewed separately to understand their personal reactions to a presentation. The manager wants to assess the difference in ratings reported by men and women.

Independent Samples Case

The difference between the means will have a t-distribution with n 1 + n 2 - 2 degrees of freedom. The confidence interval for μ 1 - μ 2 is expressed by the ratio:

This task can be solved not only by the above formulas, but also by standard StatPro tools. To do this, it is enough to apply

Confidence interval for the difference between proportions

Let be the mathematical expectation of the shares. Let be their sample estimates constructed from samples of size n 1 and n 2, respectively. Then is the estimate for the difference. Therefore, the confidence interval for this difference is expressed as:

Here z cr is the value obtained from the normal distribution according to special tables (for example, 1.96 for the 95% confidence interval).

The standard error of the estimate is expressed in this case by the ratio:

.

Example

The store has undertaken the following market research in preparation for the big sale. The top 300 buyers were selected, which in turn were randomly divided into two groups of 150 members each. All of the selected buyers were sent invitations to participate in the sale, but only for members of the first group a coupon was attached, entitling them to a 5% discount. During the sale, purchases of all 300 selected buyers were recorded. How can a manager interpret the results and conclude on the effectiveness of coupon delivery? (see file COUPONS.XLS (template and solution)).

Solution

For our particular case, out of 150 buyers who received a discount coupon, 55 made a purchase at a sale, and among 150 who did not receive a coupon, only 35 made a purchase (Fig. 103
). Then the values ​​of the sample proportions are 0.3667 and 0.2333, respectively. And the sample difference between them is 0.1333, respectively. Assuming the confidence interval to be 95%, we find z cr = 1.96 from the normal distribution table. The computation of the standard error of the sampled difference is 0.0524. Finally, we find that the lower limit of the 95% confidence interval is 0.0307, ​​and the upper limit is 0.2359, respectively. The results can be interpreted to mean that for every 100 customers who receive a discount coupon, you can expect from 3 to 23 new customers. However, it should be borne in mind that this conclusion in itself does not mean the effectiveness of the use of coupons (since, by providing a discount, we lose in profit!). Let's demonstrate this using specific data. Suppose that the average purchase size is 400 rubles, of which 50 rubles. there is a profit of the store. Then the expected profit per 100 buyers who did not receive the coupon is:

50 0.2333 100 = 1166.50 rubles.

Similar calculations for 100 buyers who received the coupon give:

30 0.3667 100 = 1100.10 rubles.

The decrease in the average profit to 30 is due to the fact that, using the discount, customers who received the coupon will, on average, make a purchase for 380 rubles.

Thus, the final conclusion speaks of the ineffectiveness of using such coupons in this particular situation.

Comment. This task can be solved using standard StatPro tools. To do this, it suffices to reduce this problem to the problem of estimating the difference of two means by the method, and then apply StatPro / Statistical Inference / Two-Sample Analysis to build a confidence interval for the difference between two mean values.

Confidence interval length control

The length of the confidence interval depends on following conditions:

    direct data (standard deviation);

    significance level;

    sample size.

Sample size for estimating the mean

First, consider the problem in the general case. Let us designate the value of half the length of the confidence interval given to us as B (Fig. 104
). We know that the confidence interval for the mean value of some random variable X is expressed as , where ... Assuming:

and expressing n, we get.

Unfortunately, we do not know the exact value of the variance of the random variable X. In addition, we do not know the value of t cr, since it depends on n through the number of degrees of freedom. In this situation, we can proceed as follows. Instead of the variance s, we use an estimate of the variance based on any available realizations of the random variable under study. Instead of the t cr value, we use the z cr value for the normal distribution. This is quite acceptable, since the distribution density functions for the normal and t-distribution are very close (except for the case of small n). Thus, the sought formula takes the form:

.

Since the formula gives, generally speaking, non-integer results, the desired sample size is taken to be the excess rounding of the result.

Example

The fast food restaurant is planning to expand its assortment with a new type of sandwich. In order to assess the demand for it, the manager plans to randomly select a certain number of visitors from those who have already tried it, and invite them to rate their attitude to the new product in points from 1 to 10. The manager wants to estimate the expected number of points that the new one will receive. product and build a 95% confidence interval for this estimate. At the same time, he wants half the width of the confidence interval to not exceed 0.3. How many visitors should he interview?

as follows:

Here r ots is the estimate of the fraction p, and B is the given half of the length of the confidence interval. An overestimate for n can be obtained using the value r ots= 0.5. In this case, the length of the confidence interval will not exceed the given value of B for any true value of p.

Example

Let the manager from the previous example plan to estimate the proportion of customers who preferred a new type of product. He wants to construct a 90% confidence interval half the length of which does not exceed 0.05. How many clients should be included in the random sample?

Solution

In our case, the value of z cr = 1.645. Therefore, the required amount is calculated as .

If the manager had reason to believe that the desired value of p is, for example, about 0.3, then, substituting this value into the above formula, we would get a smaller value of the random sample, namely 228.

Formula for determining random sample sizes in case of difference between two means written as:

.

Example

Some computer company has a customer service center. Recently, the number of customer complaints about poor quality of service has increased. The service center mainly employs two types of employees: those who do not have much experience, but who have completed special preparatory courses, and who have extensive practical experience, but who have not completed special courses. The company wants to analyze customer complaints over the past six months and compare their average numbers for each of the two groups of employees. It is assumed that the quantities in the samples for both groups will be the same. How many employees should be included in the sample to get a 95% interval with a half length of no more than 2?

Solution

Here σ оц is an estimate of the standard deviation of both random variables under the assumption that they are close. Thus, in our task, we need to somehow get this estimate. This can be done, for example, as follows. Having looked at the data on customer complaints over the past six months, a manager may notice that for each employee, there are generally from 6 to 36 complaints. Knowing that for a normal distribution, almost all values ​​are removed from the mean by no more than three standard deviations, he can reasonably believe that:

, whence σ оц = 5.

Substituting this value in the formula, we get .

Formula for determining the size of the random sample in the case of estimating the difference between the shares looks like:

Example

A certain company has two factories producing similar products. A company manager wants to compare the proportion of defective products in both factories. According to the available information, the scrap rate at both factories is between 3 and 5%. It is supposed to build a 99% confidence interval with half the length of no more than 0.005 (or 0.5%). How many items should be taken from each factory?

Solution

Here p 1ots and p 2ots are estimates of two unknown scrap rates at the 1st and 2nd factories. If we put p 1ots = p 2ots = 0.5, then we get an overestimated value for n. But since in our case we have some a priori information about these shares, we take the upper estimate of these shares, namely 0.05. We get

When some parameters of a population are estimated from sample data, it is useful to give not only a point estimate of the parameter, but also to indicate a confidence interval that shows where the exact value of the estimated parameter may be located.

In this chapter, we also got acquainted with the quantitative ratios that allow us to construct such intervals for various parameters; learned how to control the length of the confidence interval.

Note also that the problem of estimating the sample size (the problem of planning an experiment) can be solved using the standard StatPro tools, namely StatPro / Statistical Inference / Sample Size Selection.

The confidence interval came to us from the field of statistics. This is a specific range that is used to estimate an unknown parameter with a high degree of reliability. The easiest way to explain this is with an example.

Suppose you want to investigate some random variable, for example, the server's response rate to a client request. Each time a user types the address of a specific site, the server reacts to it at a different speed. Thus, the investigated response time is random. So, the confidence interval allows us to determine the boundaries of this parameter, and then it can be argued that with a probability of 95% the server will be in the range we calculated.

Or you need to find out how many people know about the brand of the company. When the confidence interval is calculated, it will be possible, for example, to say that with 95% probability the share of consumers who know about this is in the range from 27% to 34%.

Closely related to this term is such a value as the confidence level. It represents the probability that the desired parameter is included in the confidence interval. How large our desired range will be depends on this value. The more value it takes, the narrower the confidence interval becomes, and vice versa. Usually it is set at 90%, 95% or 99%. The 95% value is the most popular.

This indicator is also influenced by the variance of observations and its definition is based on the assumption that the studied attribute obeys This statement is also known as Gauss's law. According to him, such a distribution of all probabilities of a continuous random variable is called normal, which can be described by the probability density. If the normal distribution assumption turns out to be wrong, then the estimate may turn out to be wrong.

First, let's figure out how to calculate the confidence interval for Here, two cases are possible. The variance (the degree of dispersion of a random variable) can be known or not. If it is known, then our confidence interval is calculated using the following formula:

хср - t * σ / (sqrt (n))<= α <= хср + t*σ / (sqrt(n)), где

α is a sign,

t - parameter from the Laplace distribution table,

σ is the square root of the variance.

If the variance is unknown, then it can be calculated if we know all the values ​​of the desired feature. For this, the following formula is used:

σ2 = х2ср - (хср) 2, where

х2ср - the average value of the squares of the investigated feature,

(хср) 2 - the square of the given feature.

The formula by which the confidence interval is calculated in this case changes slightly:

xcr - t * s / (sqrt (n))<= α <= хср + t*s / (sqrt(n)), где

хср - sample mean,

α is a sign,

t is a parameter that is found using the Student's distribution table t = t (ɣ; n-1),

sqrt (n) - square root of the total sample size,

s is the square root of the variance.

Consider this example. Suppose that according to the results of 7 measurements, the investigated characteristic was determined, equal to 30 and the sample variance equal to 36. It is necessary to find with a probability of 99% the confidence interval, which contains the true value of the measured parameter.

First, let's determine what t is equal to: t = t (0.99; 7-1) = 3.71. Using the above formula, we get:

xcr - t * s / (sqrt (n))<= α <= хср + t*s / (sqrt(n))

30 - 3.71 * 36 / (sqrt (7))<= α <= 30 + 3.71*36 / (sqrt(7))

21.587 <= α <= 38.413

The confidence interval for the variance is calculated both in the case of a known mean and when there is no data on the mathematical expectation, but only the value of the point unbiased estimate of the variance is known. We will not give here the formulas for calculating it, since they are quite complex and, if desired, they can always be found on the net.

We only note that it is convenient to determine the confidence interval using Excel or a network service, which is called that.

Any sample gives only an approximate idea of ​​the general population, and all sample statistical characteristics (mean, mode, variance ...) are some approximation or say the estimate of general parameters, which in most cases cannot be calculated due to the unavailability of the general population (Figure 20) ...

Figure 20. Sampling error

But you can specify the interval in which the true (general) value of the statistical characteristic lies with a certain degree of probability. This interval is called d Confidence interval (CI).

So the general average with a probability of 95% lies within

from to, (20)

where t - the tabular value of the Student criterion for α = 0.05 and f= n-1

99% CI can be found, in this case t selected for α =0,01.

What is the practical significance of the confidence interval?

    A wide confidence interval indicates that the sample mean does not accurately reflect the general mean. This is usually due to an insufficient sample size, or to its heterogeneity, i.e. high variance. Both give a large error of the mean and, accordingly, a wider CI. And this is the basis for returning to the planning stage of the study.

    CI upper and lower limits assess whether results will be clinically significant

Let us dwell in somewhat more detail on the question of the statistical and clinical significance of the results of the study of group properties. Recall that the task of statistics is to detect at least any differences in populations, based on sample data. It is the clinician's job to identify any (not all) differences that will aid diagnosis or treatment. And not always statistical conclusions are the basis for clinical conclusions. Thus, a statistically significant decrease in hemoglobin by 3 g / l is not a cause for concern. And, conversely, if some problem in the human body does not have a massive character at the level of the entire population, this is not a reason not to deal with this problem.

We will consider this provision at example.

The researchers wondered if boys who had some infectious disease were lagging behind their peers. For this purpose, a sample study was carried out, in which 10 boys who had undergone this disease took part. The results are shown in Table 23.

Table 23. Statistical processing results

lower limit

upper limit

Standards (cm)

middle

It follows from these calculations that the selective average height of 10-year-old boys who have undergone a certain infectious disease is close to the norm (132.5 cm). However, the lower limit of the confidence interval (126.6 cm) indicates that there is a 95% probability that the true average height of these children corresponds to the concept of "short height", i.e. these children are stunted.

In this example, the results of the CI calculations are clinically significant.

For the overwhelming majority of simple measurements, the so-called normal law of random errors ( Gauss's law) derived from the following empirical provisions.

1) measurement errors can take on a continuous series of values;

2) with a large number of measurements, errors of the same magnitude, but of different sign, occur equally often,

3) the greater the value of the random error, the less the probability of its occurrence.

The graph of the normal Gaussian distribution is shown in Fig. 1. The equation for the curve is

where is the distribution function of random errors (errors), which characterizes the probability of an error, σ is the mean square error.

The σ value is not a random variable and characterizes the measurement process. If the measurement conditions do not change, then σ remains constant. The square of this quantity is called variance of measurements. The smaller the variance, the smaller the scatter of individual values ​​and the higher the measurement accuracy.

The exact value of the root mean square error σ, as well as the true value of the measured quantity, is unknown. There is a so-called statistical estimate of this parameter, according to which the mean square error is equal to the mean square error of the arithmetic mean. The value of which is determined by the formula

where is the result i th measurement; - the arithmetic mean of the obtained values; n- number of measurements.

The larger the number of measurements, the smaller and the more it approaches σ. If the true value of the measured value μ, its arithmetic mean value obtained as a result of measurements, and a random absolute error, then the measurement result will be written in the form.

The range of values ​​from to, in which the true value of the measured value μ falls, is called confidence interval. Since it is a random variable, the true value falls into the confidence interval with a probability α, which is called confidence level, or reliability measurements. This value is numerically equal to the area of ​​the shaded curved trapezoid. (see fig.)

All this is true for a sufficiently large number of measurements when it is close to σ. To find the confidence interval and the confidence level for a small number of measurements, which we deal with in the course of laboratory work, we use Student's probability distribution. This is the probability distribution of a random variable called Student's coefficient, gives the value of the confidence interval in fractions of the mean square error of the arithmetic mean.


The probability distribution of this quantity does not depend on σ 2, but essentially depends on the number of experiments n. With an increase in the number of experiments n the Student's distribution tends to the Gaussian distribution.

The distribution function is tabulated (Table 1). The value of the Student's coefficient is at the intersection of the line corresponding to the number of measurements n, and the column corresponding to the confidence probability α

CONFIDENCE INTERVALS FOR FREQUENCIES AND LOADS

© 2008

National Institute of Public Health, Oslo, Norway

The article describes and discusses the calculation of confidence intervals for frequencies and fractions by the methods of Wald, Wilson, Clopper - Pearson, using the angular transformation and by the Wald method with the Agresti - Cole correction. The presented material provides general information about the methods for calculating confidence intervals for frequencies and fractions and is intended to arouse the interest of the readers of the journal not only in the use of confidence intervals when presenting the results of their own research, but also in reading specialized literature before starting work on future publications.

Keywords: confidence interval, frequency, proportion

In one of the previous publications, the description of qualitative data was briefly mentioned and it was reported that their interval estimate is preferable to the point estimate for describing the frequency of occurrence of the studied characteristic in the general population. Indeed, since studies are carried out using sample data, the projection of the results onto the general population must contain an element of inaccuracy in the sample estimate. The confidence interval is a measure of the accuracy of an estimated parameter. Interestingly, in some books on basic statistics for medical professionals, the topic of confidence intervals for frequencies is completely ignored. In this article, we will consider several methods for calculating confidence intervals for frequencies, implying such characteristics of the sample as non-repetition and representativeness, as well as the independence of observations from each other. Frequency in this article is understood not as an absolute number, which shows how many times a given value occurs in the aggregate, but as a relative value that determines the proportion of research participants in whom the trait under study occurs.


In biomedical research, 95% confidence intervals are most commonly used. This confidence interval is the area that the true proportion falls within 95% of the time. In other words, we can say with 95% confidence that the true value of the frequency of occurrence of a trait in the general population will be within the 95% confidence interval.

Most statistics manuals for medical researchers report that the frequency error is calculated using the formula

where p is the frequency of occurrence of the trait in the sample (value from 0 to 1). Most Russian scientific articles indicate the value of the frequency of occurrence of a trait in the sample (p), as well as its error (s) in the form of p ± s. It is more expedient, however, to present a 95% confidence interval for the frequency of occurrence of a trait in the general population, which will include values ​​from

before.

In some manuals, it is recommended for small samples to replace the value of 1.96 with the t value for N - 1 degrees of freedom, where N is the number of observations in the sample. The value of t is found from tables for the t-distribution, which are available in almost all textbooks on statistics. The use of the t distribution for Wald's method does not provide visible advantages over other methods discussed below, and therefore is not encouraged by some authors.

The above method for calculating confidence intervals for frequencies or fractions is named after Wald in honor of Abraham Wald (1902-1950), since its widespread use began after the publication of Wald and Wolfowitz in 1939. However, the method itself was proposed by Pierre Simon Laplace (1749–1827) back in 1812.

Wald's method is very popular, but its use is associated with significant problems. The method is not recommended for small sample sizes, as well as in cases where the frequency of occurrence of the feature tends to 0 or 1 (0% or 100%) and is simply impossible for frequencies 0 and 1. In addition, the approximation of the normal distribution, which is used to calculate the error , “Does not work” in cases where n · p< 5 или n · (1 – p) < 5 . Более консервативные статистики считают, что n · p и n · (1 – p) должны быть не менее 10 . Более детальное рассмотрение метода Вальда показало, что полученные с его помощью доверительные интервалы в большинстве случаев слишком узки, то есть их применение ошибочно создает слишком оптимистичную картину, особенно при удалении частоты встречаемости признака от 0,5, или 50 % . К тому же при приближении частоты к 0 или 1 доверительный интревал может принимать отрицательные значения или превышать 1, что выглядит абсурдно для частот. Многие авторы совершенно справедливо не рекомендуют применять данный метод не только в уже упомянутых случаях, но и тогда, когда частота встречаемости признака менее 25 % или более 75 % . Таким образом, несмотря на простоту расчетов, метод Вальда может применяться лишь в очень ограниченном числе случаев. Зарубежные исследователи более категоричны в своих выводах и однозначно рекомендуют не применять этот метод для небольших выборок , а ведь именно с такими выборками часто приходится иметь дело исследователям-медикам.


Since the new variable is normally distributed, the lower and upper bounds of the 95% confidence interval for the variable φ will be φ-1.96 and φ + 1.96left ">

Instead of 1.96 for small samples, it is recommended to substitute t for N - 1 degrees of freedom. This method does not give negative values ​​and allows more accurate estimation of confidence intervals for frequencies than Wald's method. In addition, it is described in many domestic reference books on medical statistics, which, however, did not lead to its widespread use in medical research. Calculating confidence intervals using an angular transformation is not recommended for frequencies approaching 0 or 1.

This is where the description of methods for assessing confidence intervals in most books on the basics of statistics for medical researchers usually ends, and this problem is typical not only for domestic, but also for foreign literature. Both methods are based on the central limit theorem, which assumes a large sample.

Taking into account the disadvantages of estimating confidence intervals using the above methods, Clopper and Pearson proposed in 1934 a method for calculating the so-called exact confidence interval, taking into account the binomial distribution of the trait under study. This method is available in many online calculators, but the confidence intervals obtained in this way are in most cases too wide. At the same time, this method is recommended to be used in cases where a conservative assessment is required. The degree of conservatism of the method increases with decreasing sample size, especially when N< 15 . описывает применение функции биномиального распределения для анализа качественных данных с использованием MS Excel, в том числе и для определения доверительных интервалов, однако расчет последних для частот в электронных таблицах не «затабулирован» в удобном для пользователя виде, а потому, вероятно, и не используется большинством исследователей.

According to many statisticians, the most optimal estimate of the confidence intervals for frequencies is carried out by the Wilson method, proposed back in 1927, but practically not used in domestic biomedical research. This method not only makes it possible to estimate the confidence intervals for both very small and very high frequencies, but is also applicable for a small number of observations. In general terms, the confidence interval according to the Wilson formula has the form of



where takes a value of 1.96 when calculating the 95% confidence interval, N is the number of observations, and p is the frequency of occurrence of a feature in the sample. This method is available in online calculators, so its application is not problematic. and do not recommend using this method for n p< 4 или n · (1 – p) < 4 по причине слишком грубого приближения распределения р к нормальному в такой ситуации, однако зарубежные статистики считают метод Уилсона применимым и для малых выборок .

It is believed that, in addition to the Wilson method, the Wald Agresti-Cole corrected method also provides an optimal estimate of the confidence interval for frequencies. Correction according to Agresti - Cole is a replacement in Wald's formula of the frequency of occurrence of a trait in the sample (p) by p`, in the calculation of which 2 is added to the numerator, and 4 is added to the denominator, that is, p` = (X + 2) / (N + 4), where X is the number of study participants who have the trait under study, and N is the sample size. This modification leads to results very similar to the results of the Wilson formula, except for cases where the event rate approaches 0% or 100%, and the sample is small. In addition to the above-mentioned methods for calculating confidence intervals for frequencies, continuity corrections were proposed for both the Wald method and the Wilson method for small samples, but studies have shown that their use is impractical.

Let us consider the application of the above methods for calculating confidence intervals using two examples. In the first case, we study a large sample of 1,000 randomly selected study participants, of whom 450 have the trait under study (it can be a risk factor, outcome, or any other trait), which is 0.45, or 45%. In the second case, the study is carried out using a small sample, say, only 20 people, and the studied trait is present in only 1 participant in the study (5%). Confidence intervals according to Wald method, Wald method with Agresti-Cole correction, and Wilson method were calculated using an online calculator developed by Jeff Sauro (http: // www. / Wald. Htm). Continuity-corrected Wilson confidence intervals were calculated using the calculator provided by Wassar Stats: Web Site for Statistical Computation (http: // faculty.vassar.edu / lowry / prop1.html). Calculations using the angular Fisher transformation were performed “manually” using the critical value of t for 19 and 999 degrees of freedom, respectively. The calculation results are presented in the table for both examples.

Confidence intervals calculated in six different ways for the two examples described in the text

Confidence interval calculation method

P = 0.0500, or 5%

95% CI for X = 450, N = 1000, P = 0.4500, or 45%

–0,0455–0,2541

Walda with Agresti-Cole correction

<,0001–0,2541

Wilson with continuity correction

Clopper - Pearson "exact method"

Angular transformation

<0,0001–0,1967

As can be seen from the table, for the first example, the confidence interval calculated by the "generally accepted" Wald method goes into the negative region, which cannot be the case for frequencies. Unfortunately, such incidents are not uncommon in Russian literature. The traditional way of representing data in terms of frequency and its errors partially masks this problem. For example, if the frequency of occurrence of a trait (in percent) is presented as 2.1 ± 1.4, then this is not as "painful for the eyes" as 2.1% (95% CI: -0.7; 4.9), although and means the same. The Wald method with Agresti - Cole correction and calculation using the angular transformation give a lower bound tending to zero. Continuity-corrected Wilson's method and "exact method" give wider confidence intervals than Wilson's method. For the second example, all methods give approximately the same confidence intervals (differences appear only in thousandths), which is not surprising, since the frequency of occurrence of the event in this example does not differ much from 50%, and the sample size is quite large.

For readers interested in this problem, we can recommend the works of R. G. Newcombe and Brown, Cai and Dasgupta, which show the pros and cons of using 7 and 10 different methods for calculating confidence intervals, respectively. From domestic manuals, the book and is recommended, which, in addition to a detailed description of the theory, presents the methods of Wald, Wilson, as well as a method for calculating confidence intervals taking into account the binomial frequency distribution. In addition to free online calculators (http: // www. / Wald. Htm and http: // faculty. Vassar. Edu / lowry / prop1.html), confidence intervals for frequencies (and more!) Can be calculated using the CIA program ( Confidence Intervals Analysis), which can be downloaded from http: // www. medschool. soton. ac. uk / cia /.

The next article will look at one-dimensional ways to compare quality data.

Bibliography

Medical statistics in plain language: an introductory course / A. Banerji. - M.: Practical Medicine, 2007 .-- 287 p. Medical statistics /. - M.: Medical Information Agency, 2007 .-- 475 p. Biomedical statistics / S. Glants. - M.: Practice, 1998. Data types, distribution checking and descriptive statistics / // Human Ecology - 2008. - No. 1. - P. 52–58. WITH... Medical statistics: textbook /. - Rostov n / a: Phoenix, 2007 .-- 160 p. Applied Medical Statistics /,. - SPb. : Folio, 2003 .-- 428 p. F... Biometrics /. - M.: Higher school, 1990 .-- 350 p. A... Mathematical statistics in medicine /,. - M.: Finance and statistics, 2007 .-- 798 p. Mathematical statistics in clinical research /,. - M.: GEOTAR-MED, 2001 .-- 256 p. Yunkerov V. AND... Medical and statistical processing of medical research data /,. - SPb. : VmedA, 2002 .-- 266 p. Agresti A. Approximate is better than exact for interval estimation of binomial proportions / A. Agresti, B. Coull // American statistician. - 1998. - N 52. - S. 119-126. Altman D. Statistics with confidence // D. Altman, D. Machin, T. Bryant, M. J. Gardner. - London: BMJ Books, 2000 .-- 240 p. Brown L. D. Interval estimation for a binomial proportion / L. D. Brown, T. T. Cai, A. Dasgupta // Statistical science. - 2001. - N 2. - P. 101-133. Clopper C. J. The use of confidence or fiducial limits illustrated in the case of the binomial / C. J. Clopper, E. S. Pearson // Biometrika. - 1934. - N 26. - P. 404-413. Garcia-Perez M. A... On the confidence interval for the binomial parameter / M. A. Garcia-Perez // Quality and quantity. - 2005. - N 39. - P. 467–481. Motulsky H. Intuitive biostatistics // H. Motulsky. - Oxford: Oxford University Press, 1995 .-- 386 p. Newcombe R. G. Two-Sided Confidence Intervals for the Single Proportion: Comparison of Seven Methods / R. G. Newcombe // Statistics in Medicine. - 1998. - N. 17. - P. 857-872. Sauro J. Estimating completion rates from small samples using binomial confidence intervals: comparisons and recommendations / J. Sauro, J. R. Lewis // Proceedings of the human factors and ergonomics society annual meeting. - Orlando, FL, 2005. Wald A. Confidence limits for continuous distribution functions // A. Wald, J. Wolfovitz // Annals of Mathematical Statistics. - 1939. - N 10. - P. 105-118. Wilson E. B... Probable inference, the law of succession, and statistical inference / E. B. Wilson // Journal of American Statistical Association. - 1927. - N 22. - P. 209-212.

CONFIDENCE INTERVALS FOR PROPORTIONS

A. M. Grjibovski

National Institute of Public Health, Oslo, Norway

The article presents several methods for calculations confidence intervals for binomial proportions, namely, Wald, Wilson, arcsine, Agresti-Coull and exact Clopper-Pearson methods. The paper gives only general introduction to the problem of confidence interval estimation of a binomial proportion and its aim is not only to stimulate the readers to use confidence intervals when presenting results of own empirical research, but also to encourage them to consult statistics books prior to analysing own data and preparing manuscripts.

Key words: confidence interval, proportion

Contact Information:

Senior Adviser, National Institute of Public Health, Oslo, Norway