<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.0 20120330//EN" "JATS-journalpublishing1.dtd">
<article article-type="research-article" dtd-version="1.0" xml:lang="en" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">BM</journal-id>
<journal-id journal-id-type="nlm-ta">Biochem Med (Zagreb)</journal-id>
<journal-title-group>
<journal-title>Biochemia Medica</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Biochem. Med. (Zagreb)</abbrev-journal-title>
</journal-title-group>
<issn pub-type="ppub">1330-0962</issn>
<issn pub-type="epub">1846-7482</issn>
<publisher><publisher-name>Croatian Society of Medical Biochemistry and Laboratory Medicine</publisher-name></publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">bm-34-3-030101</article-id>
<article-id pub-id-type="doi">10.11613/BM.2024.030101</article-id>
<article-categories><subj-group subj-group-type="heading"><subject>Lessons in biostatistics</subject></subj-group>
</article-categories>
<title-group>
<article-title>Introducing prediction intervals for sample means</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>Contini</surname><given-names>Molly E.</given-names></name></contrib><contrib contrib-type="author" corresp="yes"><name><surname>Spence</surname><given-names>Jeffrey R.</given-names></name><xref ref-type="corresp" rid="cor1">*</xref></contrib><contrib contrib-type="author"><name><surname>Stanley</surname><given-names>David J.</given-names></name></contrib>
<aff id="aff1"><institution content-type="dept">Department of Psychology</institution>, <institution>University of Guelph</institution>, <addr-line>Guelph</addr-line>, <country country="ca">Canada</country></aff>
</contrib-group>
<author-notes>
<corresp id="cor1"><label>*</label>Corresponding author: <email xlink:href="spencejr@uoguelph.ca">spencejr@uoguelph.ca</email></corresp>
<fn fn-type="con">
<p content-type="fn-title">Author contributions</p>
<p>D. Stanely: Conceptualization, Formal analysis, Funding Acquisition, Software, Visualisation, Writing - original draft, Writing - review and editing. J. Spence: Conceptualization, Formal analysis, Funding Acquisition, Visualisation, Writing - original draft, Writing - review and editing. M Contini: Conceptualization, Formal analysis, Visualisation, Writing - original draft, Writing - review and editing.</p>
</fn>
</author-notes>
<pub-date date-type="pub" publication-format="electronic"><day>05</day><month>08</month><year>2024</year></pub-date>
<pub-date date-type="pub" publication-format="print"><day>15</day><month>10</month><year>2024</year></pub-date>
<volume>34</volume>
<issue>3</issue>
<elocation-id>030101</elocation-id>
<history>
<date date-type="received"><day>22</day><month>02</month><year>2024</year></date><date date-type="accepted"><day>13</day><month>06</month><year>2024</year></date>
</history>
<permissions>
<copyright-statement>Croatian Society of Medical Biochemistry and Laboratory Medicine.</copyright-statement>
<copyright-year>2023</copyright-year>
<copyright-holder>Croatian Society of Medical Biochemistry</copyright-holder>
<license license-type="open-access"><license-p>This is an Open Access article distributed under the terms of the Creative Commons Attribution (<ext-link xlink:href="http://creativecommons.org/licenses/by/4.0/" ext-link-type="uri">http://creativecommons.org/licenses/by/4.0/</ext-link>) which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p></license>
</permissions>
<abstract abstract-type="teaser">
<title>Graphical abstract</title>
<p>
<inline-graphic xlink:href="bm-34-3-030101-g1.tif"/></p>
</abstract>
<abstract abstract-type="teaser">
<title>Highlights</title>
<p>&#x2022; Researchers and practitioners are typically familiar with descriptive statistics and statistical inference but may know little about prediction</p>
<p>&#x2022; We introduce prediction intervals using fundamental concepts that are learned in descriptive and inferential statistical training</p>
<p>&#x2022; Prediction intervals use a current sample statistic to provide a range (<italic>i.e.,</italic> probabilistic upper and lower bounds) for future sample statistics</p>
<p>&#x2022; In an applied example, we show how to calculate and interpret a prediction interval</p>
<p>&#x2022; We use Study 1 sample data to generate a range of values that is likely to contain, a yet to be conducted, Study 2 mean</p>
</abstract>
<abstract>
<p>Researchers and practitioners are typically familiar with descriptive statistics and statistical inference. However, outside of regression techniques, little attention may be given to questions around prediction. In the current paper, we introduce prediction intervals using fundamental concepts that are learned in descriptive and inferential statistical training (<italic>i.e.,</italic> sampling error, standard deviation). We walk through an example using simple hand calculations and reference a simple R package that can be used to calculate prediction intervals.</p>
</abstract>
<kwd-group kwd-group-type="author"><title>Keywords: </title><kwd>prediction intervals</kwd><kwd>biostatistics</kwd><kwd>education</kwd><kwd>research methodology</kwd></kwd-group>
</article-meta>
</front>
<body>
<sec sec-type="intro">
<title>Introduction and background</title>
<p>The prediction interval is a valuable but sometimes over-looked interval in statistical training (<xref ref-type="bibr" rid="r1"><italic>1</italic></xref>-<xref ref-type="bibr" rid="r4"><italic>4</italic></xref>). Many of the statistics familiar to researchers and practitioners are descriptive or inferential. Inferential statistics are primarily concerned with using sample data to estimate population attributes (<italic>i.e.,</italic> population parameters). In contrast, prediction intervals provide information about what result may be expected in a future sample (<xref ref-type="bibr" rid="r5"><italic>5</italic></xref>-<xref ref-type="bibr" rid="r7"><italic>7</italic></xref>). Prediction intervals use information from a past sample to estimate a range of values for a future sample statistic (<xref ref-type="bibr" rid="r8"><italic>8</italic></xref>, <xref ref-type="bibr" rid="r9"><italic>9</italic></xref>). In the current paper, we introduce readers to the logic underlying the calculation of prediction intervals. To ensure readers are able to easily follow the logic underlying these intervals we focus on the simplest case where we assume past and future samples are obtained from the same normally distributed population <italic>via</italic> simple random sampling.</p>
<p>A prediction interval for a sample mean is an interval that captures a future sample mean with a specified probability; 1-alpha (<xref ref-type="bibr" rid="r9"><italic>9</italic></xref>). Prediction intervals model uncertainty in future data that can be expected due to sampling error. Sampling error is the difference between a sample estimate and the population parameter and will always be present when the sample size is smaller than the population. Correspondingly, sampling error decreases as sample size increases. In the case of prediction intervals, there are two sources of sampling variability that must be considered: (a) sampling variability associated with the current sample mean, and (b) the sampling variability associated with the future sample mean. As a result, prediction intervals incorporate sampling error from two estimates into a single interval.</p>
<p>For those interested in a more &#x201C;mathematically precise definition of a prediction interval&#x201D; we encourage readers to consult Hahn and Nelson&#x2019;s more technical definitions of prediction intervals (<xref ref-type="bibr" rid="r10"><italic>10</italic></xref>). Although we introduce prediction intervals focusing on the most straightforward scenario (sample means and normally distributed populations) it is also possible to construct prediction intervals in more complex scenarios. For example, prediction intervals are available for future observations and statistics such as effect sizes as well as for non-normal populations such as for exponential, binomial, Poisson, lognormal, and gamma distributions (<xref ref-type="bibr" rid="r7"><italic>7</italic></xref>, <xref ref-type="bibr" rid="r9"><italic>9</italic></xref>-<xref ref-type="bibr" rid="r12"><italic>12</italic></xref>).</p>
<p>Because of their data-driven nature and future focus, prediction intervals are quite useful in a variety of research and applied contexts. Prediction intervals have been used in the context of multiple regression (<italic>e.g.,</italic> analyzing immunological responses to vaccinations); and have been recommended for use in meta-analyses examining treatment effectiveness (<xref ref-type="bibr" rid="r13"><italic>13</italic></xref>, <xref ref-type="bibr" rid="r14"><italic>14</italic></xref>). In laboratory medicine, prediction intervals have sometimes been used to establish reference ranges to interpret what test result may be considered normal or typical (<xref ref-type="bibr" rid="r15"><italic>15</italic></xref>, <xref ref-type="bibr" rid="r16"><italic>16</italic></xref>). Consequently, prediction intervals are an interesting statistic with both practical and research applications.</p>
<p>It is helpful to distinguish prediction intervals from confidence intervals because confidence intervals can sometimes incorrectly be interpreted as prediction intervals (<xref ref-type="bibr" rid="r17"><italic>17</italic></xref>). For confidence intervals, the 95% value refers to the percentage of confidence intervals that are expected to contain the population parameter with repeated random sampling (<xref ref-type="bibr" rid="r18"><italic>18</italic></xref>). In effect, a confidence interval is way of generating a plausible range of values for a population parameter. This interpretation differs sharply from that of a prediction interval which focuses on the generation of a plausible range of values for a future sample statistic. Consequently, confidence intervals do not perform well when used to capture future sample statistics. Simulation research has found that 95% confidence intervals capture future sample statistics at levels typically much lower than 95% and this reduced capture rate varies greatly across research scenarios (<xref ref-type="bibr" rid="r7"><italic>7</italic></xref>).</p>
<p>In the sections to follow, we show how to calculate prediction intervals using sample-level estimates of a population parameter to generate a range of values that is likely to contain a subsequent sample-level estimate. We present an approach to understanding prediction intervals with the aim of making prediction intervals understandable and accessible to those with a background in descriptive and inferential statistics.</p>
</sec>
<sec sec-type="other1">
<title>An example</title>
<p>We begin by considering a fictitious example of a laboratory that tests for Analyte X which is normally distributed in the population of interest. As members of the laboratory, we are beginning an initiative to routinely screen for Analyte X concentrations in blood samples of people who live in a medium sized urban municipality. To begin, the laboratory randomly samples 100 adults (<italic>i.e.</italic>, n<sub>1</sub> = 100) for inclusion in the first screening (<italic>i.e.,</italic> Study 1). Results of Study 1 reveal that the average concentration of Analyte X was 80 ppm (<italic><strike>x</strike><sub>people</sub><sub>1</sub></italic> = 80). This sample mean is an estimate of the population mean (<italic>i.e.,</italic> the mean Analyte X concentrations for the population, the population of the municipality). This sample data can be used to generate an estimate of the population variance for Analyte X concentrations. In this example the estimated population variance is 225 (<italic>i.e.,</italic> s<sup>2</sup><sub>people1</sub> = 225). That is, 225 is an estimate of the variance of Analyte X concentrations for all adults in the municipality.</p>
<p>The laboratory plans to conduct follow-up testing six months later, we will call this future study, Study 2. Because of sampling error, the results from a new sample are expected to be different from the first sample. However, what results may be expected if nothing has changed in the environment to increase or decrease Analyte X concentrations? To get an estimate of what results can be expected, the lab can calculate a prediction interval. A prediction interval will provide the lab with a probable range of results that can be expected in test results simply due to sampling error. In the next sections, we walk through the components that go into calculating a prediction interval using this example.</p>
</sec>
<sec sec-type="other2">
<title>Statistical analysis</title>
<p>A prediction interval for sample means can be calculated using the <italic>predictionInterval</italic> package for <italic>R</italic> (<xref ref-type="bibr" rid="r19"><italic>19</italic></xref>, <xref ref-type="bibr" rid="r20"><italic>20</italic></xref>). R is a general purpose free open-source statistical software used by a range of research disciplines. Prediction intervals for means can be calculated in two simple ways: (a) using the statistical software with the <italic>predictionInterval</italic> package or (b) <italic>via</italic> a website app. Below, we present the code needed to calculate a prediction interval for sample means using the <italic>predictionInterval</italic> package (which assumes a normally distributed population). In the code, &#x201C;M&#x201D; is the mean of the sample data, &#x201C;SD&#x201D; is the sample estimate of the population standard deviation (<italic>i.e.</italic>, using <italic>n</italic>-1 in the denominator), &#x201C;n&#x201D; is the number of people in the current sample, and &#x201C;rep.n&#x201D; is the sample size of the future yet to be conducted study. The output indicates 95% prediction interval that ranges from 76.35 to 83.65.</p>
<p>library(predictionInterval)</p>
<p>pi.m(M = 80,</p>
<p>SD = sqrt(225),</p>
<p>n = 100,</p>
<p>rep.n = 200)</p>
<p>#Predictioninterval:</p>
<p># 95% PI [76.35, 83.65].</p>
</sec>
<sec sec-type="other3">
<title>Prediction intervals and sampling distributions</title>
<p>A simple way to understand how prediction intervals work is to consider the laboratory&#x2019;s Study 1 from a sampling perspective. To start, we can imagine that adults in the municipality vary in the amount of Analyte X concentrations in their blood. We can think of the variability in Analyte X concentrations for each person as a distribution. The distribution of Analyte X concentrations for all people in the municipality can be thought of as a population. We represent the Analyte X concentrations of the people forming the population using the notation &#x03BC;<italic><sub>people</sub></italic> for the population mean and &#x03C3;<italic><sup>2</sup><sub>people</sub></italic> for the population variance (<italic>i.e.,</italic> the population parameters). The population-level variability in people&#x2019;s Analyte X concentrations is illustrated in <xref ref-type="fig" rid="f1">Figure 1A</xref> - which is depicted using people as icons as reminder individual Analyte X concentrations are represented in this figure. Notice that the population variance (&#x03C3;<italic><sup>2</sup><sub>people</sub></italic>) is unknown but estimated by <italic>s<sup>2</sup><sub>people</sub></italic> from Study 1.</p>
<fig id="f1" position="float" fig-type="figure"><label>Figure 1</label><caption><p>Population and sampling distribution of the mean.</p></caption><graphic xlink:href="bm-34-3-030101-f1"></graphic></fig>
<p>Recall, the laboratory wants to determine what mean concentration of Analyte X is reasonable to expect in Study 2 based on the concentrations from Study 1. Said another way, the laboratory is interested in modeling how much a Study 2 mean, <italic><strike>x</strike><sub>people</sub><sub>2</sub></italic>, is expected to differ from the Study 1 mean, <italic><strike>x</strike><sub>people</sub><sub>1</sub></italic> due to sampling error. This difference can be expressed using the letter <italic>D</italic> as illustrated below (Equation (Eq.) 1):</p>
<disp-formula id="e"><graphic xlink:href="bm-34-3-030101-e1.tif"></graphic></disp-formula>
<p>Mathematically modeling <italic>D</italic>, the difference between the Study 1 mean and the Study 2 mean, is a four-step process. First, we estimate the variance of the distribution for Study 1 means. Second, we estimate the variance of the distribution for the, yet to be conducted, Study 2 means. Third, we combine the information from Steps 1 and 2 to calculate the variance for the distribution of mean differences (<italic>i.e.</italic>, <italic>D</italic>). Finally, we calculate a prediction interval based on the standard deviation of the mean differences. These steps are outlined below.</p>
</sec>
<sec sec-type="other4">
<title>Step 1: Estimating sampling error in Study 1</title>
<p>We begin by creating a mathematical model for Study 1 results. That is, we imagine repeating Study 1 (using <italic>n<sub>1</sub> = 100</italic>) an infinite number of times and calculating a mean for each study, resulting in an infinite set of sample means. This infinitely large set of sample means is collectively referred to as the sampling distribution of the mean. Thus, a sampling distribution of the mean in this context is a distribution of means calculated from all possible random samples of <italic>n</italic> = 100 from the population. This type of sampling distribution is illustrated in <xref ref-type="fig" rid="f1">Figure 1B</xref> - the distribution is shaded with the sample mean symbol as a reminder it is a distribution that represents mean Analyte X concentrations not Analyte X concentrations for individuals.</p>
<p>In <xref ref-type="fig" rid="f1">Figure 1B</xref>, we use the symbol <italic>&#x03BC;<sub><strike>x</strike></sub></italic> to refer to the mean of a distribution of sample means and the symbol to refer to the variance of this distribution of sample means. Collectively, the sampling distribution of means, in <xref ref-type="fig" rid="f1">Figure 1B</xref>, represents all possible sample mean outcomes of Study 1, which use a sample size of 100. Even though the laboratory only collected one of these possible outcomes, the variance of this distribution is estimated from the sample data collected in Study 1. As depicted in <xref ref-type="fig" rid="f1">Figure 1</xref>, to calculate this value, we do not actually need the infinitely large distribution of sample means to calculate its variance. The variance of this distribution of sample means (i.e.,) is linked to the variance of the distribution of individuals in the population (&#x03C3;<italic><sup>2</sup><sub>people</sub></italic>) by the sample size (n). This relation is presented in Eq. 2 below.</p>
<disp-formula id="e___1"><graphic xlink:href="bm-34-3-030101-e2.tif"></graphic></disp-formula>
<p>Because &#x03C3;<italic><sup>2</sup><sub>people</sub></italic> is a population parameter and is not typically known, we will need to use an estimate (<italic>i.e.</italic>, <italic>s<sup>2</sup><sub>people</sub></italic>) of the population-level variance from Study 1. To obtain <italic>s<sup>2</sup><sub>people</sub></italic>, we would use the formula for estimating the population-level variance from sample data, illustrated below. In this example, 225 is an estimate, based on sample data, of the variance in the Analyte X concentrations for all adults in the municipality (<italic>i.e.,</italic> the population).</p>
<disp-formula id="e___2"><graphic xlink:href="bm-34-3-030101-e3.tif"></graphic></disp-formula>
<p>We can use an estimate of the population-level variance to obtain an estimate of the variance of the distribution of sample means, using Eq. 4 below</p>
<disp-formula id="e___3"><graphic xlink:href="bm-34-3-030101-e4.tif"></graphic></disp-formula>
<p>With this formula, we can estimate the variance of the distribution of sample means for Study 1 <italic>via</italic> the calculation below. Note, we now use the subscript 1 to identify that this is the estimate for Study 1,</p>
<disp-formula id="e___4"><graphic xlink:href="bm-34-3-030101-e5.tif"></graphic></disp-formula>
<p>A visual representation of this sampling distribution can be found in <xref ref-type="fig" rid="f2">Figure 2A</xref>. In continuing with the goal of forecasting probable differences between the average Analyte X concentrations that might be found between Study 1 and Study 2, the laboratory also needs a model of the yet to be conducted Study 2. To do so, we can use the same technique to estimate the variance of the sampling distribution for Study 1 for, the yet to be conducted, Study 2, by using the data from Study 1.</p>
<fig id="f2" position="float" fig-type="figure"><label>Figure 2</label><caption><p>Sampling distributions with two different sample sizes.</p></caption><graphic xlink:href="bm-34-3-030101-f2"></graphic></fig>
</sec>
<sec sec-type="other5">
<title>Step 2: Estimating sampling error in the future study (Study 2)</title>
<p>At first glance it may not appear possible to use the same technique from Study 1 for the yet to be conducted Study 2. This is because Study 2 is a hypothetical future study that has not been conducted. However, the calculation of a prediction interval does not require any data from Study 2 - we can use data from Study 1. Specifically, the formula for the variance of the sampling distribution of the mean for Study 2 requires an estimate of the population variance. Fortunately, we can use the estimate of the population variance from Study 1 for Study 2. Crucially, it is assumed that both samples used in Study 1 and Study 2 are from the same population, the municipality. Consequently, <italic>s<sup>2</sup><sub>people1</sub></italic> is an estimate of the population variance that is relevant to both Study 1 and Study 2 because both studies sample from the same population.</p>
<p>Consequently, the same rational that we used in Study 1 also applies to Study 2. The only thing that changes is the sample size estimate that the lab will use in Study 2. That is, we adapt Eq. 5, repeated below, by using the sample size of the second study, n<sub>2</sub> = 200, in combination with the population-variance estimate from the first study, <italic>s<sup>2</sup><sub>people1</sub></italic>,</p>
<disp-formula id="e___5"><graphic xlink:href="bm-34-3-030101-e6.tif"></graphic></disp-formula>
<p>This equation uses the subscript 2 for as a reminder that it is an estimate of the variance of the sample means in Study 2. The resulting value, 1.125, is an estimate of the variability of all possible mean Analyte X concentrations for random samples of 200 in Study 2 - assuming these samples are drawn from the same population as Study 1. This sampling distribution variance for Study 2 is estimated entirely from Study 1 data (Study 2 data has not been collected) and is illustrated in <xref ref-type="fig" rid="f2">Figure 2B</xref>.</p>
<p>Now the laboratory has estimates of the variance of the distribution of sample means for both Study 1 and, the yet to be conducted, Study 2. However, neither of the variance estimates are of direct interest. We merely use them as inputs in the calculation for the variance of the difference in sample means.</p>
</sec>
<sec sec-type="other6">
<title>Step 3: Estimating sampling error of the difference between means</title>
<p>In trying to set expectations for the second Analyte X sample mean, the laboratory is effectively interested in modeling how much the average Analyte X concentration from Study 2 is expected differ from the average Analyte X concentration from Study 1. Consequently, we need to model the mean difference between Study 1 and Study 2 results. This difference is expressed using the letter <italic>D</italic> see Eq. 7 below:</p>
<disp-formula id="e___6"><graphic xlink:href="bm-34-3-030101-e7.tif"></graphic></disp-formula>
<p>We need a model of how <italic>D</italic> will vary when both Study 1 and Study 2 are conducted a large number of times. In other words, we need to know how <italic>D</italic> is expected to vary across a large number of samples. To obtain the variance of the sampling distribution for <italic>D</italic>, we can use the variance sum law, see Eq. 8 below, which can be used to provide the variance for the difference (or sum) of independent variables:</p>
<disp-formula id="e___7"><graphic xlink:href="bm-34-3-030101-e8.tif"></graphic></disp-formula>
<p>With the variance sum law, the laboratory can calculate the variance of a column of difference <italic>(A - B)</italic> using only knowledge of the variance of A and the variance of B. We can see an illustration of this in <xref ref-type="table" rid="t1">Table 1</xref>.</p>
<table-wrap id="t1" position="float">
<label>Table 1</label><caption><title>Illustration of the variance sum law for two independent variables</title>
</caption>
<table frame="hsides" rules="groups">
<col width="32.78%"/>
<col width="32.77%"/>
<col width="34.45%"/>
<thead>
<tr>
<th valign="top" align="center" scope="col" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt"><bold>A</bold></th>
<th valign="top" align="center" scope="col" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt"><bold>B</bold></th>
<th valign="top" align="center" scope="col" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt"><bold>(A-B)</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt" scope="row">&#x03C3;<sup>2</sup><italic><sub>A</sub></italic> = 12.64</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">&#x03C3;<sup>2</sup><italic><sub>B</sub></italic> = 2.00</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">&#x03C3;<sup>2</sup><italic><sub>(A-B)</sub></italic> = 14.64</td>
</tr>
<tr>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt" scope="row">9</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">3</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">6</td>
</tr>
<tr>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt" scope="row">2</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">4</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">-2</td>
</tr>
<tr>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt" scope="row">6</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">5</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">1</td>
</tr>
<tr>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt" scope="row">12</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">6</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">6</td>
</tr>
<tr>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt" scope="row">4</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">7</td>
<td valign="top" align="center" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.50pt">-3</td>
</tr>
<tr>
<td colspan="3" valign="top" align="left" style="border-left: solid 0.75pt; border-top: solid 0.50pt; border-right: solid 0.75pt; border-bottom: solid 0.75pt" scope="col">Note: Variances were calculated using N in the denominator. Because A and B are independent COV(A,B) = 0.</td>
</tr>
</tbody></table></table-wrap>
<p>Using the variance sum law, we can determine the variance of the sampling distribution for <italic>D</italic> where <italic>D</italic> = <italic><strike>x</strike><sub>1</sub></italic> &#x2013; <italic><strike>x</strike><sub>2</sub></italic>. This formula is illustrated below using the population-level notion from the previous two sections. Note the population variance, &#x03C3;<italic><sup>2</sup><sub>people</sub></italic>, is the same for both sample sizes (<italic>i.e.,</italic> for Study 1 and Study 2). The sampling distribution for the difference between the Study 1 and Study 2 means is illustrated in <xref ref-type="fig" rid="f2">Figure 2C</xref> and Eq. 9</p>
<disp-formula id="e___8"><graphic xlink:href="bm-34-3-030101-e9.tif"></graphic></disp-formula>
<p>As before, because population values are unknown, we need to estimate the variance of the distribution of mean difference in sample means, see <xref ref-type="fig" rid="f2">Figure 2C</xref>, using Eq. 10. Again, because Study 1 and Study 2 are samples from the same population we can use <italic>s<sup>2</sup><sub>people1</sub></italic> as the estimate of the population variance for both studies,</p>
<disp-formula id="e___9"><graphic xlink:href="bm-34-3-030101-e10.tif"></graphic></disp-formula>
<p>Inserting the previously calculated values we obtain (Eq. 11):</p>
<disp-formula id="e___10"><graphic xlink:href="bm-34-3-030101-e11.tif"></graphic></disp-formula>
<p>The corresponding estimated standard deviation of the distribution of mean differences is presented in Eq. 12</p>
<disp-formula id="e___11"><graphic xlink:href="bm-34-3-030101-e12.tif"></graphic></disp-formula>
<p>Consequently, the standard deviation for the distribution of mean differences is 1.837117. The corresponding sampling distribution is illustrated in <xref ref-type="fig" rid="f2">Figure 2C</xref> (Eq. 13)</p>
<disp-formula id="e___12"><graphic xlink:href="bm-34-3-030101-e13.tif"></graphic></disp-formula>
</sec>
<sec sec-type="other7">
<title>Step 4: Calculating the prediction interval</title>
<p>We can now use the above values to calculate a prediction interval. A prediction interval is constructed much like a confidence interval - though interpreted quite differently. A confidence interval is based on the distribution of sample means (<italic>i.e.</italic>, <italic><strike>x</strike></italic>) whereas a prediction interval is based on the distribution of differences (<italic>i.e.</italic>, <italic>D</italic>) in sample means. Consequently, to construct a prediction interval, the laboratory will use the sampling distribution of the difference between means <italic>D</italic>, that we reviewed above.</p>
<p>To do so we use the following formula (Eq. 14):</p>
<disp-formula id="e___13"><graphic xlink:href="bm-34-3-030101-e14.tif"></graphic></disp-formula>
<p>In Eq. 14 s<italic><sub>D</sub></italic> is the standard deviation of the sampling distribution for the difference between means (referred to by some as the standard error for the distribution differences in sample means). Here, the degrees of freedom for the <italic>t</italic>-distribution is based on Study 1 alone: <italic>df</italic> = n<sub>1</sub> - 1 = 100 - 1 = 99.</p>
<p>Recall, in Study 1, <italic><strike>x</strike><sub>1</sub></italic> = 80, <italic>s<sup>2</sup><sub>people1</sub></italic> = 225<italic><sub>,</sub></italic> and n<sub>1</sub> = 100. Following from the sample size there are 99 degrees of freedom, <italic>df</italic> = 99. Using this information, we can calculate the prediction interval in the following way (Eq. 15):</p>
<disp-formula id="e___14"><graphic xlink:href="bm-34-3-030101-e15.tif"></graphic></disp-formula>
<p>Consequently, the prediction interval is 95% PI [76.35, 83.65]. This can be interpreted as there being a 95% chance that the mean for Study 2 will fall in this range; provided sampling error is the only reason for the difference between the two means. Thus, the 95% prediction interval may be used to estimate a plausible range of values for the Study 2 mean. Consequently, although finding a mean outside of this range in Study 2 can be expected due to sampling error because it is a 95% prediction interval, not a 100% prediction interval, a mean outside of this range is unlikely and could be indicative of something other than sampling error occurring to cause the difference.</p>
</sec>
<sec sec-type="conclusions">
<title>Conclusions</title>
<p>In the current paper, we describe the prediction interval, a useful but sometimes overlooked interval (<xref ref-type="bibr" rid="r1"><italic>1</italic></xref>-<xref ref-type="bibr" rid="r4"><italic>4</italic></xref>). We reviewed prediction intervals for sample means obtained from normally distributed populations focusing on the logic underlying these calculations. Our aim was to make the prediction interval intuitive and accessible across a range of knowledge levels. We also provided information about an R package, <italic>predictionInterval</italic> that can easily calculate prediction intervals without any manual calculations (<xref ref-type="bibr" rid="r19"><italic>19</italic></xref>).</p>
<p>There are a number of advantages to using prediction intervals. Prediction intervals are available for a variety of distributions and applications and they are relatively simple to calculate, even from small sample sizes. Moreover, a key assumption of prediction intervals is that the data have been collected <italic>via</italic> random sampling, thus if this assumption is violated, the intervals should be interpreted with caution. However, in the context of laboratory work where there is generally a high degree of control, the assumption of random sampling may be more readily satisfied compared to other contexts.</p>
<p>For additional practical examples on the use of prediction intervals interested readers may consult Coskun (<xref ref-type="bibr" rid="r21"><italic>21</italic></xref>). This paper demonstrates how prediction intervals can be used in range of practical scenarios (<italic>e.g.</italic>, patient monitoring, evaluating laboratory instruments). Here, Coskun outlines a novel application of prediction intervals to generate personalized reference intervals such that repeated testing for a specific individual can be used to generate individual prediction intervals based on within-person variability (<xref ref-type="bibr" rid="r21"><italic>21</italic></xref>). In earlier work, these intervals were referred to as personalized reference intervals (<xref ref-type="bibr" rid="r22"><italic>22</italic></xref>). This approach provides a novel way to use prediction intervals to establish reference intervals. Others have argued against using prediction intervals to establish reference intervals (<xref ref-type="bibr" rid="r23"><italic>23</italic></xref>).</p>
<p>Prediction intervals have some notable limitations. First, they assume the first sample and the second sample are obtained from the same population. Second, they assume random sampling was used to obtain the sample participants and only consider sampling error as a source of variability. For example, uncertainty due to measurement or lab errors is not taken into account when a prediction interval is calculated. The width of a prediction interval is determined entirely by random sampling error calculations.</p>
<p>Third, somewhat similar to significance testing and confidence intervals, the conclusions that can be drawn from prediction intervals may appear somewhat constrained and unsatisfactory. For example, even when there is a significant difference between two sample means you cannot be 100% certain there is a difference between the corresponding population means. Likewise, a 95% confidence interval may fail to capture a population mean; indeed, it will fail to do so 5% of time. Similarly, with prediction intervals, it is not possible to draw 100% definitive conclusions about results that fall either within or outside the interval. For example, a 95% prediction interval will fail to capture the next sample mean 5% of the time &#x2013; due to random sampling error alone. However, there are other reasons that a sample mean could fall outside of the prediction interval. For example, if a researcher obtained a second sample mean from a different population (violating a prediction interval assumption) then the second sample mean might fall outside the prediction interval because the population has changed.</p>
<p>Confidence intervals are used to generate a plausible range of values for unknown population parameters; in contrast, prediction intervals are used to generate a plausible range of values for a future sample statistic. Both intervals are based on random sampling error calculations. Patel notes the past and the future distinction in his definition of a prediction interval as, &#x201C;an interval which uses the results of a past sample to contain the results of a future sample from the same population with a specified probability&#x201D; (<xref ref-type="bibr" rid="r9"><italic>9</italic></xref>). Thus, a key difference between confidence intervals and prediction intervals is the fact that confidence intervals capture population parameters whereas prediction intervals capture a future sample statistic (<xref ref-type="bibr" rid="r7"><italic>7</italic></xref>). Because prediction intervals model sampling error in two sources, (a) the past data and (b) the future data, they tend to be wider than confidence intervals. Confidence intervals can also sometimes be incorrectly interpreted as prediction intervals.</p>
</sec>
</body>
<back>
<fn-group>
<fn fn-type="conflict">
<p content-type="fn-title">Potential conflict of interest</p>
<p>None declared.</p>
</fn>
</fn-group>
<sec sec-type="data-availability">
<title>Data availability statement</title>
<p>No data was generated during this study, so data sharing statement is not applicable to this article.</p>
</sec>
<ref-list>
<title>References</title>
<ref id="r1"><label>1</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hahn</surname><given-names>GJ</given-names></name></person-group>. <article-title>Factors for calculating two-sided prediction intervals for samples from a normal distribution.</article-title> <source>J Am Stat Assoc</source>. <year>1969</year>;<volume>64</volume>:<fpage>878</fpage>&#x2013;<lpage>88</lpage>. <pub-id pub-id-type="doi">10.1080/01621459.1969.10501020</pub-id></mixed-citation></ref>
<ref id="r2"><label>2</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Whitmore</surname><given-names>GA</given-names></name></person-group>. <article-title>Prediction limits for a univariate normal observation.</article-title> <source>Am Stat</source>. <year>1986</year>;<volume>40</volume>:<fpage>141</fpage>&#x2013;<lpage>3</lpage>. <pub-id pub-id-type="doi">10.1080/00031305.1986.10475378</pub-id></mixed-citation></ref>
<ref id="r3"><label>3</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Preston</surname><given-names>S</given-names></name></person-group>. <article-title>Teaching prediction intervals.</article-title> <source>J Stat Educ</source>. <year>2000</year>;<volume>8</volume>:<fpage>3</fpage>. <pub-id pub-id-type="doi">10.1080/10691898.2000.12131297</pub-id></mixed-citation></ref>
<ref id="r4"><label>4</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Vardeman</surname><given-names>SB</given-names></name></person-group>. <article-title>What about the other intervals?</article-title> <source>Am Stat</source>. <year>1992</year>;<volume>46</volume>:<fpage>193</fpage>&#x2013;<lpage>7</lpage>. <pub-id pub-id-type="doi">10.1080/00031305.1992.10475882</pub-id></mixed-citation></ref>
<ref id="r5"><label>5</label><mixed-citation publication-type="book">Hahn GJ, Meeker WQ, editors. Statistical intervals: a guide for practitioners. New York:John Wiley &amp; Sons Inc; 1991. <pub-id pub-id-type="doi">10.1002/9780470316771</pub-id><pub-id pub-id-type="doi">10.1002/9780470316771</pub-id></mixed-citation></ref>
<ref id="r6"><label>6</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Patil</surname><given-names>P</given-names></name><name><surname>Peng</surname><given-names>RD</given-names></name><name><surname>Leek</surname><given-names>JT</given-names></name></person-group>. <article-title>What should researchers expect when they replicate studies? A statistical view of replicability in psychological science.</article-title> <source>Perspect Psychol Sci</source>. <year>2016</year>;<volume>11</volume>:<fpage>539</fpage>&#x2013;<lpage>44</lpage>. <pub-id pub-id-type="doi">10.1177/1745691616646366</pub-id><pub-id pub-id-type="pmid">27474140</pub-id></mixed-citation></ref>
<ref id="r7"><label>7</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Spence</surname><given-names>JR</given-names></name><name><surname>Stanley</surname><given-names>DJ</given-names></name></person-group>. <article-title>Prediction interval: What to expect when you&#x2019;re expecting&#x2026; A replication.</article-title> <source>PLoS One</source>. <year>2016</year>;<volume>11</volume>:<elocation-id>e0162874</elocation-id>. <pub-id pub-id-type="doi">10.1371/journal.pone.0162874</pub-id><pub-id pub-id-type="pmid">27644090</pub-id></mixed-citation></ref>
<ref id="r8"><label>8</label><mixed-citation publication-type="book">Chatfield C. Prediction intervals for time-series forecasting. Principles of forecasting: A handbook for researchers and practitioners. New York:Springer;2001. p. 475-94. <pub-id pub-id-type="doi">10.1007/978-0-306-47630-3_21</pub-id><pub-id pub-id-type="doi">10.1007/978-0-306-47630-3_21</pub-id></mixed-citation></ref>
<ref id="r9"><label>9</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Patel</surname><given-names>JK</given-names></name></person-group>. <article-title>Prediction intervals - a review.</article-title> <source>Commun Stat Theory Methods</source>. <year>1989</year>;<volume>18</volume>:<fpage>2393</fpage>&#x2013;<lpage>465</lpage>. <pub-id pub-id-type="doi">10.1080/03610928908830043</pub-id></mixed-citation></ref>
<ref id="r10"><label>10</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hahn</surname><given-names>GJ</given-names></name><name><surname>Nelson</surname><given-names>W</given-names></name></person-group>. <article-title>A survey of prediction intervals and their applications.</article-title> <source>J Qual Technol</source>. <year>1973</year>;<volume>5</volume>:<fpage>178</fpage>&#x2013;<lpage>88</lpage>. <pub-id pub-id-type="doi">10.1080/00224065.1973.11980601</pub-id></mixed-citation></ref>
<ref id="r11"><label>11</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hahn</surname><given-names>GJ</given-names></name></person-group>. <article-title>Additional factors for calculating prediction intervals for samples from a normal distribution.</article-title> <source>J Am Stat Assoc</source>. <year>1970</year>;<volume>65</volume>:<fpage>1668</fpage>&#x2013;<lpage>76</lpage>. <pub-id pub-id-type="doi">10.1080/01621459.1970.10481196</pub-id></mixed-citation></ref>
<ref id="r12"><label>12</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Spence</surname><given-names>JR</given-names></name><name><surname>Stanley</surname><given-names>DJ</given-names></name></person-group>. <article-title>Tempered Expectations: A Tutorial for Calculating and Interpreting Prediction Intervals in the Context of Replications.</article-title> <source>Adv Methods Pract Psychol Sci</source>. <year>2024</year>;<volume>7</volume>:<fpage>1</fpage>. <pub-id pub-id-type="doi">10.1177/25152459231217932</pub-id></mixed-citation></ref>
<ref id="r13"><label>13</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gray</surname><given-names>KJ</given-names></name></person-group>. <article-title>Maternal COVID-19 vaccine antibody response and passage into cord blood.</article-title> <source>J Pediatr</source>. <year>2021</year>;<volume>236</volume>:<fpage>325</fpage>&#x2013;<lpage>8</lpage>. <pub-id pub-id-type="doi">10.1016/j.jpeds.2021.06.055</pub-id><pub-id pub-id-type="pmid">34446174</pub-id></mixed-citation></ref>
<ref id="r14"><label>14</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>IntHout</surname><given-names>J</given-names></name><name><surname>Ioannidis</surname><given-names>JP</given-names></name><name><surname>Rovers</surname><given-names>MM</given-names></name><name><surname>Goeman</surname><given-names>JJ</given-names></name></person-group>. <article-title>Plea for routinely presenting prediction intervals in meta-analysis.</article-title> <source>BMJ Open</source>. <year>2016</year>;<volume>6</volume>:<elocation-id>e010247</elocation-id>. <pub-id pub-id-type="doi">10.1136/bmjopen-2015-010247</pub-id><pub-id pub-id-type="pmid">27406637</pub-id></mixed-citation></ref>
<ref id="r15"><label>15</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Royston</surname><given-names>P</given-names></name><name><surname>Matthews</surname><given-names>JNS</given-names></name></person-group>. <article-title>Estimation of reference ranges from normal samples.</article-title> <source>Stat Med</source>. <year>1991</year>;<volume>10</volume>:<fpage>691</fpage>&#x2013;<lpage>5</lpage>. <pub-id pub-id-type="doi">10.1002/sim.4780100503</pub-id><pub-id pub-id-type="pmid">2068421</pub-id></mixed-citation></ref>
<ref id="r16"><label>16</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Trost</surname><given-names>DC</given-names></name></person-group>. <article-title>Multivariate probability-based detection of drug-induced hepatic signals.</article-title> <source>Toxicol Rev</source>. <year>2006</year>;<volume>25</volume>:<fpage>37</fpage>&#x2013;<lpage>54</lpage>. <pub-id pub-id-type="doi">10.2165/00139709-200625010-00003</pub-id><pub-id pub-id-type="pmid">16856768</pub-id></mixed-citation></ref>
<ref id="r17"><label>17</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Cumming</surname><given-names>G</given-names></name><name><surname>Maillardet</surname><given-names>R</given-names></name></person-group>. <article-title>Confidence intervals and replication: Where will the next mean fall?</article-title> <source>Psychol Methods</source>. <year>2006</year>;<volume>11</volume>:<fpage>217</fpage>. <pub-id pub-id-type="doi">10.1037/1082-989X.11.3.217</pub-id><pub-id pub-id-type="pmid">16953701</pub-id></mixed-citation></ref>
<ref id="r18"><label>18</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hoekstra</surname><given-names>R</given-names></name><name><surname>Morey</surname><given-names>RD</given-names></name><name><surname>Rouder</surname><given-names>JN</given-names></name><name><surname>Wagenmakers</surname><given-names>EJ</given-names></name></person-group>. <article-title>Robust misinterpretation of confidence intervals.</article-title> <source>Psychon Bull Rev</source>. <year>2014</year>;<volume>21</volume>:<fpage>1157</fpage>&#x2013;<lpage>64</lpage>. <pub-id pub-id-type="doi">10.3758/s13423-013-0572-3</pub-id><pub-id pub-id-type="pmid">24420726</pub-id></mixed-citation></ref>
<ref id="r19"><label>19</label><mixed-citation publication-type="web">Stanley D. predictionInterval: Prediction Interval Functions for Assessing Replication Study Results. 2016. R package version 1.0.0. Available from: <ext-link ext-link-type="uri" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://CRAN.Rproject.org/package=predictionInterval">https://CRAN.Rproject.org/package=predictionInterval</ext-link>. Accessed March 1st 2024.</mixed-citation></ref>
<ref id="r20"><label>20</label><mixed-citation publication-type="web">R Core Team. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing; 2023. Available from: <ext-link ext-link-type="uri" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.R-project.org/">https://www.R-project.org/</ext-link>. Accessed March 1st 2024.</mixed-citation></ref>
<ref id="r21"><label>21</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Coskun</surname><given-names>A</given-names></name></person-group>. <article-title>Prediction interval: A powerful statistical tool for monitoring patients and analytical systems.</article-title> <source>Biochem Med (Zagreb)</source>. <year>2024</year>;<volume>34</volume>:<elocation-id>020101</elocation-id>. <pub-id pub-id-type="doi">10.11613/BM.2024.020101</pub-id><pub-id pub-id-type="pmid">38665871</pub-id></mixed-citation></ref>
<ref id="r22"><label>22</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Coskun</surname><given-names>A</given-names></name><name><surname>Sandberg</surname><given-names>S</given-names></name><name><surname>Unsal</surname><given-names>I</given-names></name><name><surname>Serteser</surname><given-names>M</given-names></name><name><surname>Aarsand</surname><given-names>AK</given-names></name></person-group>. <article-title>Personalized reference intervals: from theory to practice.</article-title> <source>Crit Rev Clin Lab Sci</source>. <year>2022</year>;<volume>59</volume>:<fpage>501</fpage>&#x2013;<lpage>16</lpage>. <pub-id pub-id-type="doi">10.1080/10408363.2022.2070905</pub-id><pub-id pub-id-type="pmid">35579539</pub-id></mixed-citation></ref>
<ref id="r23"><label>23</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Liu</surname><given-names>W</given-names></name><name><surname>Bretz</surname><given-names>F</given-names></name><name><surname>Cortina-Borja</surname><given-names>M</given-names></name></person-group>. <article-title>Reference range: Which statistical intervals to use?</article-title> <source>Stat Methods Med Res</source>. <year>2021</year>;<volume>30</volume>:<fpage>523</fpage>&#x2013;<lpage>34</lpage>. <pub-id pub-id-type="doi">10.1177/0962280220961793</pub-id><pub-id pub-id-type="pmid">33054684</pub-id></mixed-citation></ref>
</ref-list>
</back>
</article>
