This article is about erroneous outcomes of statistical tests. For closely related concepts in binary classification and testing generally, see false positives and false negatives.
In statistical hypothesis testing, a type I error is the mistaken rejection of an actually true null hypothesis (also known as a «false positive» finding or conclusion; example: «an innocent person is convicted»), while a type II error is the failure to reject a null hypothesis that is actually false (also known as a «false negative» finding or conclusion; example: «a guilty person is not convicted»).[1] Much of statistical theory revolves around the minimization of one or both of these errors, though the complete elimination of either is a statistical impossibility if the outcome is not determined by a known, observable causal process.
By selecting a low threshold (cut-off) value and modifying the alpha (α) level, the quality of the hypothesis test can be increased.[2] The knowledge of type I errors and type II errors is widely used in medical science, biometrics and computer science.[clarification needed]
Intuitively, type I errors can be thought of as errors of commission, i.e. the researcher unluckily concludes that something is the fact. For instance, consider a study where researchers compare a drug with a placebo. If the patients who are given the drug get better than the patients given the placebo by chance, it may appear that the drug is effective, but in fact the conclusion is incorrect.
In reverse, type II errors are errors of omission. In the example above, if the patients who got the drug did not get better at a higher rate than the ones who got the placebo, but this was a random fluke, that would be a type II error. The consequence of a type II error depends on the size and direction of the missed determination and the circumstances. An expensive cure for one in a million patients may be inconsequential even if it truly is a cure.
Definition[edit]
Statistical background[edit]
In statistical test theory, the notion of a statistical error is an integral part of hypothesis testing. The test goes about choosing about two competing propositions called null hypothesis, denoted by H0 and alternative hypothesis, denoted by H1. This is conceptually similar to the judgement in a court trial. The null hypothesis corresponds to the position of the defendant: just as he is presumed to be innocent until proven guilty, so is the null hypothesis presumed to be true until the data provide convincing evidence against it. The alternative hypothesis corresponds to the position against the defendant. Specifically, the null hypothesis also involves the absence of a difference or the absence of an association. Thus, the null hypothesis can never be that there is a difference or an association.
If the result of the test corresponds with reality, then a correct decision has been made. However, if the result of the test does not correspond with reality, then an error has occurred. There are two situations in which the decision is wrong. The null hypothesis may be true, whereas we reject H0. On the other hand, the alternative hypothesis H1 may be true, whereas we do not reject H0. Two types of error are distinguished: type I error and type II error.[3]
Type I error[edit]
The first kind of error is the mistaken rejection of a null hypothesis as the result of a test procedure. This kind of error is called a type I error (false positive) and is sometimes called an error of the first kind. In terms of the courtroom example, a type I error corresponds to convicting an innocent defendant.
Type II error[edit]
The second kind of error is the mistaken failure to reject the null hypothesis as the result of a test procedure. This sort of error is called a type II error (false negative) and is also referred to as an error of the second kind. In terms of the courtroom example, a type II error corresponds to acquitting a criminal.[4]
Crossover error rate[edit]
The crossover error rate (CER) is the point at which type I errors and type II errors are equal. A system with a lower CER value provides more accuracy than a system with a higher CER value.
False positive and false negative[edit]
In terms of false positives and false negatives, a positive result corresponds to rejecting the null hypothesis, while a negative result corresponds to failing to reject the null hypothesis; «false» means the conclusion drawn is incorrect. Thus, a type I error is equivalent to a false positive, and a type II error is equivalent to a false negative.
Table of error types[edit]
Tabularised relations between truth/falseness of the null hypothesis and outcomes of the test:[5]
Table of error types | Null hypothesis (H0) is |
||
---|---|---|---|
True | False | ||
Decision about null hypothesis (H0) |
Don’t reject |
Correct inference (true negative) (probability = 1−α) |
Type II error (false negative) (probability = β) |
Reject | Type I error (false positive) (probability = α) |
Correct inference (true positive) (probability = 1−β) |
Error rate[edit]
The results obtained from negative sample (left curve) overlap with the results obtained from positive samples (right curve). By moving the result cutoff value (vertical bar), the rate of false positives (FP) can be decreased, at the cost of raising the number of false negatives (FN), or vice versa (TP = True Positives, TPR = True Positive Rate, FPR = False Positive Rate, TN = True Negatives).
A perfect test would have zero false positives and zero false negatives. However, statistical methods are probabilistic, and it cannot be known for certain whether statistical conclusions are correct. Whenever there is uncertainty, there is the possibility of making an error. Considering this nature of statistics science, all statistical hypothesis tests have a probability of making type I and type II errors.[6]
- The type I error rate is the probability of rejecting the null hypothesis given that it is true. The test is designed to keep the type I error rate below a prespecified bound called the significance level, usually denoted by the Greek letter α (alpha) and is also called the alpha level. Usually, the significance level is set to 0.05 (5%), implying that it is acceptable to have a 5% probability of incorrectly rejecting the true null hypothesis.[7]
- The rate of the type II error is denoted by the Greek letter β (beta) and related to the power of a test, which equals 1−β.[8]
These two types of error rates are traded off against each other: for any given sample set, the effort to reduce one type of error generally results in increasing the other type of error.[9]
The quality of hypothesis test[edit]
The same idea can be expressed in terms of the rate of correct results and therefore used to minimize error rates and improve the quality of hypothesis test. To reduce the probability of committing a type I error, making the alpha value more stringent is quite simple and efficient. To decrease the probability of committing a type II error, which is closely associated with analyses’ power, either increasing the test’s sample size or relaxing the alpha level could increase the analyses’ power.[10] A test statistic is robust if the type I error rate is controlled.
Varying different threshold (cut-off) value could also be used to make the test either more specific or more sensitive, which in turn elevates the test quality. For example, imagine a medical test, in which an experimenter might measure the concentration of a certain protein in the blood sample. The experimenter could adjust the threshold (black vertical line in the figure) and people would be diagnosed as having diseases if any number is detected above this certain threshold. According to the image, changing the threshold would result in changes in false positives and false negatives, corresponding to movement on the curve.[11]
Example[edit]
Since in a real experiment it is impossible to avoid all type I and type II errors, it is important to consider the amount of risk one is willing to take to falsely reject H0 or accept H0. The solution to this question would be to report the p-value or significance level α of the statistic. For example, if the p-value of a test statistic result is estimated at 0.0596, then there is a probability of 5.96% that we falsely reject H0. Or, if we say, the statistic is performed at level α, like 0.05, then we allow to falsely reject H0 at 5%. A significance level α of 0.05 is relatively common, but there is no general rule that fits all scenarios.
Vehicle speed measuring[edit]
The speed limit of a freeway in the United States is 120 kilometers per hour. A device is set to measure the speed of passing vehicles. Suppose that the device will conduct three measurements of the speed of a passing vehicle, recording as a random sample X1, X2, X3. The traffic police will or will not fine the drivers depending on the average speed . That is to say, the test statistic
In addition, we suppose that the measurements X1, X2, X3 are modeled as normal distribution N(μ,4). Then, T should follow N(μ,4/3) and the parameter μ represents the true speed of passing vehicle. In this experiment, the null hypothesis H0 and the alternative hypothesis H1 should be
H0: μ=120 against H1: μ>120.
If we perform the statistic level at α=0.05, then a critical value c should be calculated to solve
According to change-of-units rule for the normal distribution. Referring to Z-table, we can get
Here, the critical region. That is to say, if the recorded speed of a vehicle is greater than critical value 121.9, the driver will be fined. However, there are still 5% of the drivers are falsely fined since the recorded average speed is greater than 121.9 but the true speed does not pass 120, which we say, a type I error.
The type II error corresponds to the case that the true speed of a vehicle is over 120 kilometers per hour but the driver is not fined. For example, if the true speed of a vehicle μ=125, the probability that the driver is not fined can be calculated as
which means, if the true speed of a vehicle is 125, the driver has the probability of 0.36% to avoid the fine when the statistic is performed at level 125 since the recorded average speed is lower than 121.9. If the true speed is closer to 121.9 than 125, then the probability of avoiding the fine will also be higher.
The tradeoffs between type I error and type II error should also be considered. That is, in this case, if the traffic police do not want to falsely fine innocent drivers, the level α can be set to a smaller value, like 0.01. However, if that is the case, more drivers whose true speed is over 120 kilometers per hour, like 125, would be more likely to avoid the fine.
Etymology[edit]
In 1928, Jerzy Neyman (1894–1981) and Egon Pearson (1895–1980), both eminent statisticians, discussed the problems associated with «deciding whether or not a particular sample may be judged as likely to have been randomly drawn from a certain population»:[12] and, as Florence Nightingale David remarked, «it is necessary to remember the adjective ‘random’ [in the term ‘random sample’] should apply to the method of drawing the sample and not to the sample itself».[13]
They identified «two sources of error», namely:
- (a) the error of rejecting a hypothesis that should have not been rejected, and
- (b) the error of failing to reject a hypothesis that should have been rejected.
In 1930, they elaborated on these two sources of error, remarking that:
…in testing hypotheses two considerations must be kept in view, we must be able to reduce the chance of rejecting a true hypothesis to as low a value as desired; the test must be so devised that it will reject the hypothesis tested when it is likely to be false.
In 1933, they observed that these «problems are rarely presented in such a form that we can discriminate with certainty between the true and false hypothesis» . They also noted that, in deciding whether to fail to reject, or reject a particular hypothesis amongst a «set of alternative hypotheses», H1, H2…, it was easy to make an error:
…[and] these errors will be of two kinds:
- (I) we reject H0 [i.e., the hypothesis to be tested] when it is true,[14]
- (II) we fail to reject H0 when some alternative hypothesis HA or H1 is true. (There are various notations for the alternative).
In all of the papers co-written by Neyman and Pearson the expression H0 always signifies «the hypothesis to be tested».
In the same paper they call these two sources of error, errors of type I and errors of type II respectively.[15]
[edit]
Null hypothesis[edit]
It is standard practice for statisticians to conduct tests in order to determine whether or not a «speculative hypothesis» concerning the observed phenomena of the world (or its inhabitants) can be supported. The results of such testing determine whether a particular set of results agrees reasonably (or does not agree) with the speculated hypothesis.
On the basis that it is always assumed, by statistical convention, that the speculated hypothesis is wrong, and the so-called «null hypothesis» that the observed phenomena simply occur by chance (and that, as a consequence, the speculated agent has no effect) – the test will determine whether this hypothesis is right or wrong. This is why the hypothesis under test is often called the null hypothesis (most likely, coined by Fisher (1935, p. 19)), because it is this hypothesis that is to be either nullified or not nullified by the test. When the null hypothesis is nullified, it is possible to conclude that data support the «alternative hypothesis» (which is the original speculated one).
The consistent application by statisticians of Neyman and Pearson’s convention of representing «the hypothesis to be tested» (or «the hypothesis to be nullified») with the expression H0 has led to circumstances where many understand the term «the null hypothesis» as meaning «the nil hypothesis» – a statement that the results in question have arisen through chance. This is not necessarily the case – the key restriction, as per Fisher (1966), is that «the null hypothesis must be exact, that is free from vagueness and ambiguity, because it must supply the basis of the ‘problem of distribution,’ of which the test of significance is the solution.»[16] As a consequence of this, in experimental science the null hypothesis is generally a statement that a particular treatment has no effect; in observational science, it is that there is no difference between the value of a particular measured variable, and that of an experimental prediction.[citation needed]
Statistical significance[edit]
If the probability of obtaining a result as extreme as the one obtained, supposing that the null hypothesis were true, is lower than a pre-specified cut-off probability (for example, 5%), then the result is said to be statistically significant and the null hypothesis is rejected.
British statistician Sir Ronald Aylmer Fisher (1890–1962) stressed that the «null hypothesis»:
… is never proved or established, but is possibly disproved, in the course of experimentation. Every experiment may be said to exist only in order to give the facts a chance of disproving the null hypothesis.
— Fisher, 1935, p.19
Application domains[edit]
Medicine[edit]
In the practice of medicine, the differences between the applications of screening and testing are considerable.
Medical screening[edit]
Screening involves relatively cheap tests that are given to large populations, none of whom manifest any clinical indication of disease (e.g., Pap smears).
Testing involves far more expensive, often invasive, procedures that are given only to those who manifest some clinical indication of disease, and are most often applied to confirm a suspected diagnosis.
For example, most states in the USA require newborns to be screened for phenylketonuria and hypothyroidism, among other congenital disorders.
Hypothesis: «The newborns have phenylketonuria and hypothyroidism»
Null Hypothesis (H0): «The newborns do not have phenylketonuria and hypothyroidism»,
Type I error (false positive): The true fact is that the newborns do not have phenylketonuria and hypothyroidism but we consider they have the disorders according to the data.
Type II error (false negative): The true fact is that the newborns have phenylketonuria and hypothyroidism but we consider they do not have the disorders according to the data.
Although they display a high rate of false positives, the screening tests are considered valuable because they greatly increase the likelihood of detecting these disorders at a far earlier stage.
The simple blood tests used to screen possible blood donors for HIV and hepatitis have a significant rate of false positives; however, physicians use much more expensive and far more precise tests to determine whether a person is actually infected with either of these viruses.
Perhaps the most widely discussed false positives in medical screening come from the breast cancer screening procedure mammography. The US rate of false positive mammograms is up to 15%, the highest in world. One consequence of the high false positive rate in the US is that, in any 10-year period, half of the American women screened receive a false positive mammogram. False positive mammograms are costly, with over $100 million spent annually in the U.S. on follow-up testing and treatment. They also cause women unneeded anxiety. As a result of the high false positive rate in the US, as many as 90–95% of women who get a positive mammogram do not have the condition. The lowest rate in the world is in the Netherlands, 1%. The lowest rates are generally in Northern Europe where mammography films are read twice and a high threshold for additional testing is set (the high threshold decreases the power of the test).
The ideal population screening test would be cheap, easy to administer, and produce zero false-negatives, if possible. Such tests usually produce more false-positives, which can subsequently be sorted out by more sophisticated (and expensive) testing.
Medical testing[edit]
False negatives and false positives are significant issues in medical testing.
Hypothesis: «The patients have the specific disease».
Null hypothesis (H0): «The patients do not have the specific disease».
Type I error (false positive): «The true fact is that the patients do not have a specific disease but the physicians judges the patients was ill according to the test reports».
False positives can also produce serious and counter-intuitive problems when the condition being searched for is rare, as in screening. If a test has a false positive rate of one in ten thousand, but only one in a million samples (or people) is a true positive, most of the positives detected by that test will be false. The probability that an observed positive result is a false positive may be calculated using Bayes’ theorem.
Type II error (false negative): «The true fact is that the disease is actually present but the test reports provide a falsely reassuring message to patients and physicians that the disease is absent».
False negatives produce serious and counter-intuitive problems, especially when the condition being searched for is common. If a test with a false negative rate of only 10% is used to test a population with a true occurrence rate of 70%, many of the negatives detected by the test will be false.
This sometimes leads to inappropriate or inadequate treatment of both the patient and their disease. A common example is relying on cardiac stress tests to detect coronary atherosclerosis, even though cardiac stress tests are known to only detect limitations of coronary artery blood flow due to advanced stenosis.
Biometrics[edit]
Biometric matching, such as for fingerprint recognition, facial recognition or iris recognition, is susceptible to type I and type II errors.
Hypothesis: «The input does not identify someone in the searched list of people»
Null hypothesis: «The input does identify someone in the searched list of people»
Type I error (false reject rate): «The true fact is that the person is someone in the searched list but the system concludes that the person is not according to the data».
Type II error (false match rate): «The true fact is that the person is not someone in the searched list but the system concludes that the person is someone whom we are looking for according to the data».
The probability of type I errors is called the «false reject rate» (FRR) or false non-match rate (FNMR), while the probability of type II errors is called the «false accept rate» (FAR) or false match rate (FMR).
If the system is designed to rarely match suspects then the probability of type II errors can be called the «false alarm rate». On the other hand, if the system is used for validation (and acceptance is the norm) then the FAR is a measure of system security, while the FRR measures user inconvenience level.
Security screening[edit]
False positives are routinely found every day in airport security screening, which are ultimately visual inspection systems. The installed security alarms are intended to prevent weapons being brought onto aircraft; yet they are often set to such high sensitivity that they alarm many times a day for minor items, such as keys, belt buckles, loose change, mobile phones, and tacks in shoes.
Here, the null hypothesis is that the item is not a weapon, while the alternative hypothesis is that the item is a weapon.
A type I error (false positive): «The true fact is that the item is not a weapon but the system still alarms».
Type II error (false negative) «The true fact is that the item is a weapon but the system keeps silent at this time».
The ratio of false positives (identifying an innocent traveler as a terrorist) to true positives (detecting a would-be terrorist) is, therefore, very high; and because almost every alarm is a false positive, the positive predictive value of these screening tests is very low.
The relative cost of false results determines the likelihood that test creators allow these events to occur. As the cost of a false negative in this scenario is extremely high (not detecting a bomb being brought onto a plane could result in hundreds of deaths) whilst the cost of a false positive is relatively low (a reasonably simple further inspection) the most appropriate test is one with a low statistical specificity but high statistical sensitivity (one that allows a high rate of false positives in return for minimal false negatives).
Computers[edit]
The notions of false positives and false negatives have a wide currency in the realm of computers and computer applications, including computer security, spam filtering, Malware, Optical character recognition and many others.
For example, in the case of spam filtering the hypothesis here is that the message is a spam.
Thus, null hypothesis: «The message is not a spam».
Type I error (false positive): «Spam filtering or spam blocking techniques wrongly classify a legitimate email message as spam and, as a result, interferes with its delivery».
While most anti-spam tactics can block or filter a high percentage of unwanted emails, doing so without creating significant false-positive results is a much more demanding task.
Type II error (false negative): «Spam email is not detected as spam, but is classified as non-spam». A low number of false negatives is an indicator of the efficiency of spam filtering.
See also[edit]
- Binary classification
- Detection theory
- Egon Pearson
- Ethics in mathematics
- False positive paradox
- False discovery rate
- Family-wise error rate
- Information retrieval performance measures
- Neyman–Pearson lemma
- Null hypothesis
- Probability of a hypothesis for Bayesian inference
- Precision and recall
- Prosecutor’s fallacy
- Prozone phenomenon
- Receiver operating characteristic
- Sensitivity and specificity
- Statisticians’ and engineers’ cross-reference of statistical terms
- Testing hypotheses suggested by the data
- Type III error
References[edit]
- ^ «Type I Error and Type II Error». explorable.com. Retrieved 14 December 2019.
- ^ Chow, Y. W.; Pietranico, R.; Mukerji, A. (27 October 1975). «Studies of oxygen binding energy to hemoglobin molecule». Biochemical and Biophysical Research Communications. 66 (4): 1424–1431. doi:10.1016/0006-291x(75)90518-5. ISSN 0006-291X. PMID 6.
- ^ A modern introduction to probability and statistics : understanding why and how. Dekking, Michel, 1946-. London: Springer. 2005. ISBN 978-1-85233-896-1. OCLC 262680588.
{{cite book}}
: CS1 maint: others (link) - ^ A modern introduction to probability and statistics : understanding why and how. Dekking, Michel, 1946-. London: Springer. 2005. ISBN 978-1-85233-896-1. OCLC 262680588.
{{cite book}}
: CS1 maint: others (link) - ^ Sheskin, David (2004). Handbook of Parametric and Nonparametric Statistical Procedures. CRC Press. p. 54. ISBN 1584884401.
- ^ Smith, R. J.; Bryant, R. G. (27 October 1975). «Metal substitutions incarbonic anhydrase: a halide ion probe study». Biochemical and Biophysical Research Communications. 66 (4): 1281–1286. doi:10.1016/0006-291x(75)90498-2. ISSN 0006-291X. PMC 9650581. PMID 3.
- ^ Lindenmayer, David. (2005). Practical conservation biology. Burgman, Mark A. Collingwood, Vic.: CSIRO Pub. ISBN 0-643-09310-9. OCLC 65216357.
- ^ Chow, Y. W.; Pietranico, R.; Mukerji, A. (27 October 1975). «Studies of oxygen binding energy to hemoglobin molecule». Biochemical and Biophysical Research Communications. 66 (4): 1424–1431. doi:10.1016/0006-291x(75)90518-5. ISSN 0006-291X. PMID 6.
- ^ Smith, R. J.; Bryant, R. G. (27 October 1975). «Metal substitutions incarbonic anhydrase: a halide ion probe study». Biochemical and Biophysical Research Communications. 66 (4): 1281–1286. doi:10.1016/0006-291x(75)90498-2. ISSN 0006-291X. PMC 9650581. PMID 3.
- ^ Smith, R. J.; Bryant, R. G. (27 October 1975). «Metal substitutions incarbonic anhydrase: a halide ion probe study». Biochemical and Biophysical Research Communications. 66 (4): 1281–1286. doi:10.1016/0006-291x(75)90498-2. ISSN 0006-291X. PMC 9650581. PMID 3.
- ^ Moroi, K.; Sato, T. (15 August 1975). «Comparison between procaine and isocarboxazid metabolism in vitro by a liver microsomal amidase-esterase». Biochemical Pharmacology. 24 (16): 1517–1521. doi:10.1016/0006-2952(75)90029-5. ISSN 1873-2968. PMID 8.
- ^ NEYMAN, J.; PEARSON, E. S. (1928). «On the Use and Interpretation of Certain Test Criteria for Purposes of Statistical Inference Part I». Biometrika. 20A (1–2): 175–240. doi:10.1093/biomet/20a.1-2.175. ISSN 0006-3444.
- ^ C.I.K.F. (July 1951). «Probability Theory for Statistical Methods. By F. N. David. [Pp. ix + 230. Cambridge University Press. 1949. Price 155.]». Journal of the Staple Inn Actuarial Society. 10 (3): 243–244. doi:10.1017/s0020269x00004564. ISSN 0020-269X.
- ^ Note that the subscript in the expression H0 is a zero (indicating null), and is not an «O» (indicating original).
- ^ Neyman, J.; Pearson, E. S. (30 October 1933). «The testing of statistical hypotheses in relation to probabilities a priori». Mathematical Proceedings of the Cambridge Philosophical Society. 29 (4): 492–510. Bibcode:1933PCPS…29..492N. doi:10.1017/s030500410001152x. ISSN 0305-0041. S2CID 119855116.
- ^ Fisher, R.A. (1966). The design of experiments. 8th edition. Hafner:Edinburgh.
Bibliography[edit]
- Betz, M.A. & Gabriel, K.R., «Type IV Errors and Analysis of Simple Effects», Journal of Educational Statistics, Vol.3, No.2, (Summer 1978), pp. 121–144.
- David, F.N., «A Power Function for Tests of Randomness in a Sequence of Alternatives», Biometrika, Vol.34, Nos.3/4, (December 1947), pp. 335–339.
- Fisher, R.A., The Design of Experiments, Oliver & Boyd (Edinburgh), 1935.
- Gambrill, W., «False Positives on Newborns’ Disease Tests Worry Parents», Health Day, (5 June 2006). [1] Archived 17 May 2018 at the Wayback Machine
- Kaiser, H.F., «Directional Statistical Decisions», Psychological Review, Vol.67, No.3, (May 1960), pp. 160–167.
- Kimball, A.W., «Errors of the Third Kind in Statistical Consulting», Journal of the American Statistical Association, Vol.52, No.278, (June 1957), pp. 133–142.
- Lubin, A., «The Interpretation of Significant Interaction», Educational and Psychological Measurement, Vol.21, No.4, (Winter 1961), pp. 807–817.
- Marascuilo, L.A. & Levin, J.R., «Appropriate Post Hoc Comparisons for Interaction and nested Hypotheses in Analysis of Variance Designs: The Elimination of Type-IV Errors», American Educational Research Journal, Vol.7., No.3, (May 1970), pp. 397–421.
- Mitroff, I.I. & Featheringham, T.R., «On Systemic Problem Solving and the Error of the Third Kind», Behavioral Science, Vol.19, No.6, (November 1974), pp. 383–393.
- Mosteller, F., «A k-Sample Slippage Test for an Extreme Population», The Annals of Mathematical Statistics, Vol.19, No.1, (March 1948), pp. 58–65.
- Moulton, R.T., «Network Security», Datamation, Vol.29, No.7, (July 1983), pp. 121–127.
- Raiffa, H., Decision Analysis: Introductory Lectures on Choices Under Uncertainty, Addison–Wesley, (Reading), 1968.
External links[edit]
- Bias and Confounding – presentation by Nigel Paneth, Graduate School of Public Health, University of Pittsburgh
A type I error is a kind of fault that occurs during the hypothesis testing process when a null hypothesis is rejected, even though it is accurate and should not be rejected.
In hypothesis testing, a null hypothesis is established before the onset of a test. In some cases, the null hypothesis assumes that there’s no cause and effect relationship between the item being tested and the stimuli being applied to the test subject to trigger an outcome to the test.
However, errors can occur whereby the null hypothesis has been rejected, meaning it’s determined there is a cause and effect relationship between the testing variables when, in reality, it’s a false positive. These false positives are called type I errors.
Key Takeaways
- A type I error occurs during hypothesis testing when a null hypothesis is rejected, even though it is accurate and should not be rejected.
- The null hypothesis assumes no cause and effect relationship between the tested item and the stimuli applied during the test.
- A type I error is a «false positive» leading to an incorrect rejection of the null hypothesis.
Understanding a Type I Error
Hypothesis testing is a process of testing a conjecture by using sample data. The test is designed to provide evidence that the conjecture or hypothesis is supported by the data being tested. A null hypothesis is the belief that there is no statistical significance or effect between the two data sets, variables, or populations being considered in the hypothesis. Typically, a researcher would try to disprove the null hypothesis.
For example, let’s say the null hypothesis states that an investment strategy doesn’t perform any better than a market index, such as the S&P 500. The researcher would take samples of data and test the historical performance of the investment strategy to determine if the strategy performed at a higher level than the S&P. If the test results showed that the strategy performed at a higher rate than the index, the null hypothesis would be rejected.
This condition is denoted as «n=0.» If—when the test is conducted—the result seems to indicate that the stimuli applied to the test subject caused a reaction, the null hypothesis stating that the stimuli do not affect the test subject would, in turn, need to be rejected.
Ideally, a null hypothesis should never be rejected if it’s found to be true, and it should always be rejected if it’s found to be false. However, there are situations when errors can occur.
False Positive Type I Error
Sometimes, rejecting the null hypothesis that there is no relationship between the test subject, the stimuli, and the outcome can be incorrect. If something other than the stimuli causes the outcome of the test, it can cause a «false positive» result where it appears the stimuli acted upon the subject, but the outcome was caused by chance. This «false positive,» leading to an incorrect rejection of the null hypothesis, is called a type I error. A type I error rejects an idea that should not have been rejected.
Examples of Type I Errors
For example, let’s look at the trial of an accused criminal. The null hypothesis is that the person is innocent, while the alternative is guilty. A type I error in this case would mean that the person is not found innocent and is sent to jail, despite actually being innocent.
In medical testing, a type I error would cause the appearance that a treatment for a disease has the effect of reducing the severity of the disease when, in fact, it does not. When a new medicine is being tested, the null hypothesis will be that the medicine does not affect the progression of the disease. Let’s say a lab is researching a new cancer drug. Their null hypothesis might be that the drug does not affect the growth rate of cancer cells.
After applying the drug to the cancer cells, the cancer cells stop growing. This would cause the researchers to reject their null hypothesis that the drug would have no effect. If the drug caused the growth stoppage, the conclusion to reject the null, in this case, would be correct. However, if something else during the test caused the growth stoppage instead of the administered drug, this would be an example of an incorrect rejection of the null hypothesis (i.e., a type I error).
Learn / Guides / CRO glossary
Back to guides
CRO glossary: type 1 error
What is a type 1 error?
Type 1 error is a term statisticians use to describe a false positive—a test result that incorrectly affirms a false statement about the nature of reality.
Best practices: marketers and product or website owners
In A/B testing, type 1 errors occur when experimenters falsely conclude that any variation of an A/B or multivariate test outperformed the other(s) due to something more than random chance. Type 1 errors can hurt conversions when companies make website changes based on incorrect information.
Type 1 errors vs. type 2 errors
While a type 1 error implies a false positive—that one version outperforms another—a type 2 error implies a false negative. In other words, a type 2 error falsely concludes that there is no statistically significant difference between conversion rates of different variations when there actually is a difference.
Here’s what that looks like:
What causes type 1 errors?
Type 1 errors can result from two sources: random chance and improper research techniques.
Random chance: no random sample, whether it’s a pre-election poll or an A/B test, can ever perfectly represent the population it intends to describe. Since researchers sample a small portion of the total population, it’s possible that the results don’t accurately predict or represent reality—that the conclusions are the product of random chance.
Statistical significance measures the odds that the results of an A/B test were produced by random chance. For example, let’s say you’ve run an A/B test that shows Version B outperforming Version A with a statistical significance of 95%. That means there’s a 5% chance these results were produced by random chance.You can raise your level of statistical significance by increasing the sample size, but this requires more traffic and therefore takes more time. In the end, you have to strike a balance between your desired level of accuracy and the resources you have available.
Improper research techniques: when running an A/B test, it’s important to gather enough data to reach your desired level of statistical significance. Sloppy researchers might start running a test and pull the plug when they feel there’s a ‘clear winner’—long before they’ve gathered enough data to reach their desired level of statistical significance. There’s really no excuse for a type 1 error like this.
Why are type 1 errors important?
Type 1 errors can have a huge impact on conversions. For example, if you A/B test two page versions and incorrectly conclude that version B is the winner, you could see a massive drop in conversions when you take that change live for all your visitors to see. As mentioned above, this could be the result of poor experimentation techniques, but it might also be the result of random chance. Type 1 errors can (and do) result from flawless experimentation.
When you make a change to a webpage based on A/B testing, it’s important to understand that you may be working with incorrect conclusions produced by type 1 errors.
Understanding type 1 errors allows you to:
-
Choose the level of risk you’re willing to accept (e.g., increase your sample size to achieve a higher level of statistical significance)
-
Do proper experimentation to reduce your risk of human-caused type 1 errors
-
Recognize when a type 1 error may have caused a drop in conversions so you can fix the problem
It’s impossible to achieve 100% statistical significance (and it’s usually impractical to aim for 99% statistical significance, since it requires a disproportionately large sample size compared to 95%-97% statistical significance). The goal of CRO isn’t to get it right every time—it’s to make the right choices most of the time. And when you understand type 1 errors, you increase your odds of getting it right.
How do you minimize type 1 errors?
The only way to minimize type 1 errors, assuming you’re A/B testing properly, is to raise your level of statistical significance. Of course, if you want a higher level of statistical significance, you’ll need a larger sample size.
It isn’t a challenge to study large sample sizes if you’ve got massive amounts of traffic, but if your website doesn’t generate that level of traffic, you’ll need to be more selective about what you decide to study—especially if you’re going for higher statistical significance.
Here’s how to narrow down the focus of your experiments.
6 ways to find the most important elements to test
In order to test what matters most, you need to determine what really matters to your target audience. Here are six ways to figure out what’s worth testing.
-
Read reviews and speak with your Customer Support department: figure out what people think of your brand and products. Talk to Sales, Customer Support, and Product Design to get a sense of what people really want from you and your products.
-
Figure out why visitors leave without buying: traditional analytics tools (e.g., Google Analytics) can show where people leave the site. Combining this data with Hotjar’s Conversion Funnels Tool will give you a strong sense of which pages are worth focusing on.
-
Discover the page elements that people engage: heatmaps show where the majority of users click, scroll, and hover their mouse pointers (or tap their fingers on mobile devices and tablets).
Heatmaps will help you find trends in how visitors interact with key pages on your website, which in turn will help you decide which elements to keep (since they work) and which ones are being ignored and need further examination. -
Gather feedback from customers: on-page surveys, polls, and feedback widgets give your customers a way to quickly send feedback about their experience your way. This will alert you to issues you never knew existed and will help you prioritize what needs fixing for the experience to improve.
-
Look at session recordings: see how individual (anonymized) users behave on your site. Notice where they struggle and how they go back and forth when they can’t find what they need. Pro tip: pay particular attention to what they do just before they leave your site.
-
Explore usability testing: can help you understand how people see and experience your website. Capture spoken feedback about issues they encounter, and discover what could improve their experience.
Pro tip: do you want to improve everyone’s experience? That may be tempting, but you’ll get a whole lot further by focusing on your ideal customers. To learn more about identifying your ideal customers, check out our blog post about creating simple user personas.
How many ways can you be wrong? If you think there is only one way to be wrong, you’re wrong. You can either be wrong about being right or wrong about being wrong. In hypothesis testing, when a statistician chooses between rejecting or not rejecting the null hypothesis, there is a possibility the statistician could have reached the wrong conclusion. When this happens, a Type I or a Type II error occurs. It is important to distinguish between the two in hypothesis testing, and the aim of statisticians is to minimise the probability of these errors.
Suppose there is a legal trial, it is commonplace to assume someone is innocent unless there is enough evidence to suggest that they are guilty. After the trial, the judge finds the defendant guilty but it turns out that the defendant was not guilty. This is an example of a Type I error.
Definition of a Type I Error
Suppose you have carried out a hypothesis test that leads to the rejection of the null hypothesis (H_0). If it turns out that in fact the null hypothesis is true then you have committed a Type I error. Now suppose you have carried out a hypothesis test and accepted the null hypothesis but in fact the (H_0) is false, then you have committed a Type II error. A good way to remember this is by the following table:
(H_0) true | (H_0) false | |
Reject (H_0) | Type I error | No error |
Do not reject (H_0) | No error | Type II error |
A Type I error is when you have rejected (H_0) when (H_0) is true.
However there is another way to think about Type I errors.
A Type I Error is a False Positive
Type I errors are also known as false positives. This is because rejecting (H_0) when (H_0) is true implies that the statistician has falsely concluded that there is statistical significance in the test when there was not. A real world example of a false positive is when a fire alarm goes off when there is no fire or when you have been falsely diagnosed with a disease or illness. As you can imagine, false positives can lead to significant misinformation especially in the case of medical research. For example, when testing for COVID-19, the chance of testing positive when you don’t have COVID-19 was estimated at being around (2.3%). These false positives can lead to overestimation of the impact of the virus leading to a waste of resources.
Knowing that Type I errors are false positives is a good way to remembering the difference between Type I errors and Type II errors, which are referred to as false negatives.
Type I Errors and Alpha
A Type I error occurs when the null hypothesis is rejected when it is in fact true. The probability of a Type I error is commonly denoted by (alpha) and this is known as the size of the test.
The size of a test, (alpha), is the probability of rejecting the null hypothesis, (H_0), when the (H_0) is true and this is equal to the probability of a Type I error.
The size of a test is the significance level of the test and this is chosen before the test is carried out. The Type 1 errors have a probability of (alpha) which correlates to the confidence level the statistician will set when performing the hypothesis test.
For example, if a statistician sets a confidence level of (99%) then there is a (1%) chance or a probability of (alpha=0.01) that you will get a Type 1 error. Other common choices for (alpha) are (0.05) and (0.1). Therefore, you can decrease the probability of a Type I error by decreasing the significance level of the test.
The Probability of a Type I Error
You can calculate the probability of a Type I error occurring by looking at the critical region or the significance level. The critical region of a test is determined such that it keeps the probability of a Type I error less than of equal to the significance level (alpha).
There is an important distinction between continuous and discrete random variables to be made when looking at the probability of a Type I occurring. When looking at discrete random variables, the probability of a Type I error is the actual significance level, whereas when the random variable in question is continuous, the probability of a Type I error is equal to the significance level of the test.
To find the probability of a Type 1 error:
[begin{align} mathbb{P}(text{Type I error})&=mathbb{P}(text{rejecting } H_0 text{ when }H_0 text{ is true}) \ &=mathbb{P}(text{being in the critical region}) end{align}]
For discrete random variables:
[mathbb{P}(text{Type I error})leq alpha.]
For continuous random variables:
[mathbb{P}(text{Type I error})= alpha.]
Discrete Examples of Type I Errors
So how do you find the probability of a Type I error if you have a discrete random variable?
The random variable (X) is binomially distributed. Suppose a sample of 10 is taken and a statistician wants to test the null hypothesis (H_0: ; p=0.45) against the alternative hypothesis (H_1:; pneq0.45).
a) Find the critical region for this test.
b) State the probability of a Type I error for this test.
Solution:
a) Since this is a two tailed test, at a (5%) significance level, the critical values, (c_1) and (c_2) are such that
[begin{align} mathbb{P}(Xleq c_1) &leq0.025 \ text{ and } mathbb{P}(Xgeq c_2) &leq 0.025. end{align}]
(mathbb{P}(Xgeq c_2) = 1-mathbb{P}(Xleq c_2-1)leq0.025) or ( mathbb{P}(Xleq c_2-1) geq0.975)
Assume (H_0) is true. Then under the null-hypothesis (Xsim B(10,0.45)), from the statistical tables:
[ begin{align} &mathbb{P}(X leq 1)=0.0233<0.025 \ & mathbb{P}(X leq 2)=0.0996>0.025.end{align}]
Therefore the critical value is (c_1=1). For the second critical value,
[ begin{align} &mathbb{P}(X leq 7)=0.9726<0.975 \ & mathbb{P}(X leq 8)=0.996>0.975. end{align}]
Therefore (c_2-1=8) so the critical value is (c_2=9).
So the critical region for this test under a (5%) significance level is
[left{ Xleq 1right}cup left{ Xgeq 9right}.]
b) A Type I error occurs when you reject (H_0) but (H_0) is true, i.e. it is the probability you are in the critical region given that the null hypothesis is true.
Under the null hypothesis, (p=0.45), therefore,
[begin{align} mathbb{P}(text{Type I error})&=mathbb{P}(Xleq1 mid p=0.45)+mathbb{P}(Xgeq9 mid p=0.45) \ &=0.0233+1-0.996 \ &=0.0273. end{align}]
Let’s take a look at another example.
A coin is tossed until a tail is obtained.
a) Using a suitable distribution, find the critical region for a hypothesis test that tests whether the coin is biased towards heads at the (5%) significance level.
b) State the probability of a Type I error for this test.
Solution:
a) Let (X) be the number of coin tosses before a tail is obtained.
Then this can be answered using the geometric distribution as follows since the number of failures (heads) (k — 1) before the first success/tail with a probability of a tail given by (p).
Therefore, (Xsim rm{Geo}(p)) where (p) is the probability of a tail being obtained. Therefore the null and alternative hypothesis are
[ begin{align} &H_0: ; p=frac{1}{2} \ text{and } &H_1: ; p<frac{1}{2}. end{align}]
Here the alternative hypothesis is the one that you want to establish, i.e. that the coin is biased towards heads, and the null hypothesis is the negation of that, i.e. the coin is not biased.
Under the null hypothesis (Xsim rm{Geo} left(frac{1}{2}right)).
Since you are dealing with a one-tailed test at the (5%) significance level, you want to find the critical value (c) such that (mathbb{P}(Xgeq c) leq 0.05 ). This means you want
[ left(frac{1}{2}right)^{c-1} leq 0.05. ]
Therefore
[ (c-1)lnleft(frac{1}{2}right) leq ln(0.05), ]
which means (c >5.3219).
Therefore, the critical region for this test is (X geq 5.3219=6).
Here you have used the fact that, for a geometric distribution (Xsim rm{Geo}(p)),
[mathbb{P}(X geq x)=(1-p)^{x-1}.]
b) Since (X) is a discrete random variable, (mathbb{P}(text{Type I error})leq alpha), and the probability of a Type I error is the actual significance level. So
[begin{align} mathbb{P}(text{Type I error})&= mathbb{P}( text{rejecting } H_0 text{ when } H_0 text{ is true}) \ &=mathbb{P}(Xgeq 6 mid p=0.5) \ &= left(frac{1}{2}right)^{6-1} \ &=0.03125. end{align}]
Continuous Examples of a Type I Error
In the continuous case, when finding the probability of a Type I error, you will simply need to give the significance level of the test given in the question.
The random variable (X) is normally distributed such that (Xsim N(mu ,4)). Suppose a random sample of (16) observations is taken and (bar{X}) the test statistic. A statistician wants to test (H_0:mu=30) against (H_1:mu<30) using a (5%) significance level.
a) Find the critical region.
b) State the probability of a Type I error.
Solution:
a) Under the null hypothesis you have (bar{X}sim N(30,frac{4}{16})).
Define
[Z=frac{bar{X}-mu}{frac{mu}{sqrt{n}}}sim N(0,1).]
At the (5%) significance level for a one-sided test, from the statistical tables, the critical region for (Z) is (Z<-1.6449).
Therefore, you reject (H_0) if
[begin{align} frac{bar{X}-mu}{frac{mu}{sqrt{n}}}&=frac{bar{X}-30}{frac{2}{sqrt{16}}} \ &leq -1.6449.end{align}]
Therefore, with some rearranging, the critical region for (bar{X}) is given by (bar{X} leq 29.1776).
b) Since (X) is a continuous random variable, there is no difference between the target significance level and the actual significance level. Therefore, (mathbb{P}(text{Type I error})= alpha) i.e. the probability of a Type I error (alpha) is the same as the significance level of the test, so
[mathbb{P}(text{Type I error})=0.05.]
Relationship between Type I and Type II Errors
The relationship between the probabilities of Type I and Type II errors is important in hypothesis testing as statisticians want to minimise both. Yet to minimise the probability of one, you increase the probability of the other.
For example, if you reduce the probability of Type II error (the probability of not rejecting the null hypothesis when it is false) by decreasing the significance level of a test, doing this increases the probability of a Type I error. This trade-off phenomenon is often dealt with by prioritising the minimisation of the probability of Type I errors.
For more information on Type II errors check out our article on Type II Errors.
Type I Errors — Key takeaways
- A Type I error occurs when you have rejected (H_0) when (H_0) is true.
- Type I errors are also known as false positives.
- The size of a test, (alpha), is the probability of rejecting the null hypothesis, (H_0), when the (H_0) is true and this is equal to the probability of a Type I error.
- You can decrease the probability of a Type I error by decreasing the significance level of the test.
- There is a trade-off between Type I and Type II errors since You cannot decrease the probability of a Type I error without increasing the probability of a Type II error, and vice versa.