topic Re: Not a JMP question, but hoping someone can help - Estimating StdDev from Min, Max, Avg in Discussions
https://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214497#M42898
<P><LI-USER uid="15145"></LI-USER> ,</P>
<P> </P>
<P><LI-USER uid="2026"></LI-USER> 's response is a perfect answer <FONT color="#0000FF"><STRONG>if the underlying data is random with no strong systematic effects</STRONG></FONT>. The counter example below is extreme, but demonstrates how a systematic effect can result in a very stable mean, and hence, the std dev of the mean is an underestimate of the std error.</P>
<P> </P>
<P>Using Julian's table, create a column called Systematic with the formula:</P>
<PRE><CODE class=" language-jsl">If(
Row() == 1, Random Integer( 850, 1150 ),
Modulo( Row(), 100 ) == 1, Random Integer( 850, 1150 ),
Modulo( Row(), 100 ) == 51, Lag( :Systematic, 1 ) * -1,
Lag( :Systematic, 1 )
)</CODE></PRE>
<P>Below is a screen shot of of the individual one second data for a selected 15-Min Block</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17930iF88DA278AA36178B/image-size/large?v=1.0&px=999" title="image.png" alt="image.png" /></span></P>
<P>You can see there is variation in the raw data. However, the summarized 15-Min Block data, all the means are zero, because this example is purposely set up to be an extreme case. Even if the systematic effects were not this extreme, a strong systematic pattern can make the mean artificially stable. </P>
<P> </P>
<P>This counter example is not meant to undermine <LI-USER uid="2026"></LI-USER> 's solution, but meant to be a caution. If at all possible you should try to find a method to get to a couple random intervals of the raw data, to rule out strong systematic, cyclic events. </P>
<P> </P>Tue, 25 Jun 2019 09:21:32 GMTgzmorgan02019-06-25T09:21:32ZNot a JMP question, but hoping someone can help - Estimating StdDev from Min, Max, Avg
https://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214462#M42890
<P>Firstly, this is not a JMP question but a gereral statistics question, so I apologize if it's inappropriate to post it here. But I'm hoping someone in the JMP community can help with it.</P><P> </P><P>I have a series of data samples, where each sample has Min, Avg (Mean), and Max recorded. The data is <EM>sampled</EM> every second, but only <EM>recorded</EM> every 15 minutes. So each of my 15-minute data points has the Min of the 1-second samples, the Max of the 1-second samples, and the Average of the 1-second samples over the 15-minute interval.</P><P> </P><P>I have a number of therse 15-minute data points, say 24 hours worth (96 data points). I'd like to try to estimate the StdDev of the value across the 24-hour period, as if I actually had all the 1-second samples over the 24-hour period. I think if each of my 15-minute data points also had the StdDev of the 1-second samples this would be more straighforward, but I don't; just MIn, Max, and Avg. </P><P> </P><P>Any guidance would be appreciated.</P>Mon, 24 Jun 2019 23:55:20 GMThttps://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214462#M42890wsande2019-06-24T23:55:20ZRe: Not a JMP question, but hoping someone can help - Estimating StdDev from Min, Max, Avg
https://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214482#M42892
<P>Hi <LI-USER uid="15145"></LI-USER>,</P>
<P> </P>
<P>I think you're in luck. With the data you have, you have no problem estimating the standard deviation of the variable at the original 1 sec sampling. All you need is the standard deviation (or variance) of the means themselves (the min and max are not needed).</P>
<P> </P>
<P>Variances behave in predictable ways when operating on them. In this case, the operation between the original data, and the summarized data you have, is dividing by a constant (the number of observations, 900, the number of seconds in 15 min). The basis for the formula for the standard error is actually what we'll apply here. Recall that the standard deviation of the sampling distribution of the mean is Sigma / SqRoot(n), where sigma is the population standard deviation, and n is the sample size. In terms of variance, this is just variance/n -- pretty straightforward as far as formulas go!</P>
<P> </P>
<P>So how does this help? We know you have 900 observations that go into each mean in your data table (60 samples/min * 15 min per recording). In the table you do have, you have of 96 observations (means for each 15 min, 4 per hour x 24 hours = 96). For illustration right now, suppose we know that the standard deviation of the <STRONG>means you have</STRONG> is 4. What standard deviation in the original 1-sec resolution would result in that if we had applied the formula sigma / sqroot(n)? Let's flip it around.</P>
<P>standard deviation of means = sigma/sqroot(n)</P>
<P>4 = sigma/sqroot(900)</P>
<P>4*sqroot(900) = sigma</P>
<P>sigma = 120. </P>
<P><STRONG><EM>Violla! </EM></STRONG></P>
<P> </P>
<P>The distributional shape of the population doesn't matter. Variances work this way regardless of the underlying form. We don't have to trust the math, either. Let's do this up in JMP and see what happens. Here's a table of 86,400 observations, your 1sec resolution table:<span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="table original.png" style="width: 848px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17929i684F57D42C6A4FC2/image-size/large?v=1.0&px=999" title="table original.png" alt="table original.png" /></span></P>
<P>This is the distribution of the original variable, made with a Random Normal() function: Mean of 1000, Standard deviation of 120 (well about, this is a random function, so it's close). <span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="dist1.png" style="width: 941px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17923iE54D2B7E450DEDAB/image-size/large?v=1.0&px=999" title="dist1.png" alt="dist1.png" /></span></P>
<P>Let's summarize by 15-min block using Tables > Summary:<span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="summary.png" style="width: 823px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17920iAA7380741B356922/image-size/large?v=1.0&px=999" title="summary.png" alt="summary.png" /></span></P>
<P>This gives the summarized table below, with the mean for each block.<span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="summary.png" style="width: 802px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17924i8260753155394C1F/image-size/large?v=1.0&px=999" title="summary.png" alt="summary.png" /></span></P>
<P>Let's take a look at the distribution of the means (which is essentially what your final table is):<span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="distmean.png" style="width: 925px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17926iF1D4D6A1140C8A7B/image-size/large?v=1.0&px=999" title="distmean.png" alt="distmean.png" /></span></P>
<P>And there we go, the standard deviation of the sampling distribution of the mean (which is what we've built) is 4 -- sigma / sqroot(n) just as theory tells us. </P>
<P> </P>
<P>One caveat... this empirical sampling distribution is just 96 observations of the theoretically infinite sampling distribution, so every time you repeat this experiment you will get a slightly different estimate. If we were to build the original table to have millions and millions of 15-minute blocks and then sample thousands and thousands of means of those 15-minute blocks, we'd be pretty dead on. We could show this empirically, but we know it theoretically. And, the point really is that our best, unbiased estimate of the population sigma when we have the standard error (the standard deviation of the means), is to take that standard error and multiply it by sqroot(n). </P>
<P> </P>
<P><U>So, TLDR: take the standard deviation you have of the means, and multiple by sqroot (900). </U></P>
<P> </P>
<P>I hope this helps!</P>
<P><LI-USER uid="2026"></LI-USER> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>Tue, 25 Jun 2019 02:05:47 GMThttps://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214482#M42892julian2019-06-25T02:05:47ZRe: Not a JMP question, but hoping someone can help - Estimating StdDev from Min, Max, Avg
https://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214497#M42898
<P><LI-USER uid="15145"></LI-USER> ,</P>
<P> </P>
<P><LI-USER uid="2026"></LI-USER> 's response is a perfect answer <FONT color="#0000FF"><STRONG>if the underlying data is random with no strong systematic effects</STRONG></FONT>. The counter example below is extreme, but demonstrates how a systematic effect can result in a very stable mean, and hence, the std dev of the mean is an underestimate of the std error.</P>
<P> </P>
<P>Using Julian's table, create a column called Systematic with the formula:</P>
<PRE><CODE class=" language-jsl">If(
Row() == 1, Random Integer( 850, 1150 ),
Modulo( Row(), 100 ) == 1, Random Integer( 850, 1150 ),
Modulo( Row(), 100 ) == 51, Lag( :Systematic, 1 ) * -1,
Lag( :Systematic, 1 )
)</CODE></PRE>
<P>Below is a screen shot of of the individual one second data for a selected 15-Min Block</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17930iF88DA278AA36178B/image-size/large?v=1.0&px=999" title="image.png" alt="image.png" /></span></P>
<P>You can see there is variation in the raw data. However, the summarized 15-Min Block data, all the means are zero, because this example is purposely set up to be an extreme case. Even if the systematic effects were not this extreme, a strong systematic pattern can make the mean artificially stable. </P>
<P> </P>
<P>This counter example is not meant to undermine <LI-USER uid="2026"></LI-USER> 's solution, but meant to be a caution. If at all possible you should try to find a method to get to a couple random intervals of the raw data, to rule out strong systematic, cyclic events. </P>
<P> </P>Tue, 25 Jun 2019 09:21:32 GMThttps://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214497#M42898gzmorgan02019-06-25T09:21:32ZRe: Not a JMP question, but hoping someone can help - Estimating StdDev from Min, Max, Avg
https://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214499#M42899
That it such an important point I neglected to mention, <LI-USER uid="70" login="gzmorgan0"></LI-USER>! I was assuming independent and identically distributed observations, but that certainly might not be the case.Tue, 25 Jun 2019 10:09:00 GMThttps://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214499#M42899julian2019-06-25T10:09:00ZRe: Not a JMP question, but hoping someone can help - Estimating StdDev from Min, Max, Avg
https://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214576#M42921
<P>To add some perspective to both <LI-USER uid="2026"></LI-USER> and <LI-USER uid="70"></LI-USER> 's replies, when I was sitting for the culminating oral exam in my MS in applied math and statistics program at Rochester Institute of Technology with the department head Dr. John Hromi and Professor Mason Wescott, I was asked this question first:</P><P> </P><P>"Your boss hands you a pile of data that was collected over time and wants you to analyze it. What will you do next?" I think my reply went something like, "I'd create a histogram of the data and then, since the data is time series in nature either a run chart or control chart if I can create rational subgroups out of the data. Then I'd look for the middle, spread, anything unusual or supicious on the histogram and finally over on the run chart or control chart, stability in the mean and spread."</P><P> </P><P>Of course I was a pile of nerves going into the exam. Two A list industrical statisticians who have forgotten more about statistics than I'll ever know.</P><P> </P><P>Dr. Hromi smiled and said something like, "Good answer...let's proceed."</P>Tue, 25 Jun 2019 20:10:23 GMThttps://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214576#M42921P_Bartell2019-06-25T20:10:23ZRe: Not a JMP question, but hoping someone can help - Estimating StdDev from Min, Max, Avg
https://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214647#M42927
<P>Thanks so much for the detailed explanation. However, there is something going on with my data such that this is giving me results that don't quite make sense.</P><P> </P><P>I have a data set from >80 hours, not just 24 hours. So, > 300 samples. The StdDev of the 15mAvg values is 0.00513. With 900 1-second data ponts per 15-minute period, that would imply a population StdDev of 0.1538 (= 0.00513 * 30). However the total range of my data over the 80+ hours is only 0.05 Max(15mMax) - Min(15mMin). I would have expected the range to be several SD's not a fraction of an SD.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stdDev1.png" style="width: 627px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17987i4D7F0A975FCFEB45/image-size/large?v=1.0&px=999" title="stdDev1.png" alt="stdDev1.png" /></span></P><P> </P><P>I wonder if I'm running into a "quantization problem. The resolution of my samples is 0.01, which is 2x the SD that I measuring on the sample averages.</P><P> <span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stdDev2.png" style="width: 680px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17988iE560B5907861FCA6/image-size/large?v=1.0&px=999" title="stdDev2.png" alt="stdDev2.png" /></span></P><P> </P><P>I don't know if that's somehow skewing the results. </P><P>I actually have > 200 of these data sets, for different "channels", and typically the Range is 3x to 5x the StdDev of the sample means.</P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stdDev3.png" style="width: 835px;"><img src="https://kvoqx44227.i.lithium.com/t5/image/serverpage/image-id/17989i835442E819346EF4/image-size/large?v=1.0&px=999" title="stdDev3.png" alt="stdDev3.png" /></span></P><P> </P><P>One thing I'm wondering about... If instead of 1-second samples, the underlying population was 10-second samples, then there would only be 90 samples per 15-minute interval, and the calculation of the population SD would change by a factor of 3. ( SQRT(90) instead of SQRT(900) ). Yet the underlying continuous process would not have changed. I'm having a hard time wrapping my head around this...</P><P> </P><P> </P>Tue, 25 Jun 2019 22:57:02 GMThttps://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214647#M42927wsande2019-06-25T22:57:02ZRe: Not a JMP question, but hoping someone can help - Estimating StdDev from Min, Max, Avg
https://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214767#M42945
<P><LI-USER uid="15145"></LI-USER>,</P>
<P> </P>
<P>A few suggestions/comments:</P>
<OL>
<LI>From my experience with semiconductors, different channels can have different distributions, so just a caution with generalizing across multiple populations.</LI>
<LI>This suggestion aligns with <LI-USER uid="14122"></LI-USER>' s oral exam. I suggest for each channel you look at the distribution and a trend chart of the 15 min ranges (15 min max - 15 min min). Give the resolution of your data, I fear you might have many zeroes. Anyway long ago, when compute power and data storage were expensive, aggregated data was commonplace. A simple approach was to assume 95% of the sample's ranges would represent 4 std dev, that is, max = +2 std dev and min = -2 std dev, so range/4 was used as a std dev. This might provide some insight into your data.</LI>
<LI>If #2's analysis has many zero ranges, this might be the reason, raw data is not reported, and 15 min intervals with ranges > 0, suggest a shift/change in the value. If this is the scenario, then the number of shifts/transitions per time period might be a better metric than std dev for the stability of the channel (or time between transistion).</LI>
</OL>
<P>I am not sure of your goal, but follow Peter's oral exam advice and plot the means and the ranges by sequence and look at the distributions. Often summary statistics of time series data does not adequately describe the behavior of the unit being monitored.</P>
<P> </P>
<P>JMP makes this easy to do with a couple clicks. </P>
<P> </P>Wed, 26 Jun 2019 10:03:43 GMThttps://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214767#M42945gzmorgan02019-06-26T10:03:43ZRe: Not a JMP question, but hoping someone can help - Estimating StdDev from Min, Max, Avg
https://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214886#M42968
<P>Hi <LI-USER uid="15145"></LI-USER>,</P>
<P>I agree with <LI-USER uid="70"></LI-USER> and <LI-USER uid="14122"></LI-USER>'s suggestions, but let me tackle a few of your specific questions:</P>
<P> </P>
<P><EM>"The StdDev of the 15mAvg values is 0.00513... that would imply a population StdDev of 0.1538 (= 0.00513 * 30). However the total range of my data over the 80+ hours is only 0.05 Max(15mMax) - Min(15mMin). I would have expected the range to be several SD's not a fraction of an SD."</EM></P>
<P> </P>
<P>I can see how that might seem strange, but what you have is the range of the <STRONG>means of samples of size 900,</STRONG> not the range of the original data. if you look in my example before, the range of my means of size 900 was around 20. The range of the original data was over 1000. By collecting observations together and calculating a mean, the resulting numbers, each of them a mean of 900 observations, tend to be close to one another than the original data points are close to one another (and that's why we can state that the standard deviation of sample means will be smaller than the standard deviation of the original data by a factor of sqroot(n)). So, back to your case, the range of your <EM><STRONG>means</STRONG> </EM>is 0.05, which given samples of 900 we know is substantially smaller than the range of the original data. Thus, it shouldn't be surprising that the standard deviation we estimate for the original generating data is larger. </P>
<P> </P>
<P> </P>
<P><EM>"I wonder if I'm running into a "quantization problem. The resolution of my samples is 0.01, which is 2x the SD that I measuring on the sample averages"</EM></P>
<P><SPAN>Given what we know from the sample means here, we should expect that the range of the data in the original 1sec samples is larger, so hopefully, you're not in a situation where your measurement device isn't capable of accurately measuring the phenomenon of interest. I can't really speak to that, though.</SPAN></P>
<P> </P>
<P> </P>
<P><EM>"I don't know if that's somehow skewing the results. </EM><EM>I actually have > 200 of these data sets, for different "channels", and typically the Range is 3x to 5x the StdDev of the sample means."</EM></P>
<P> </P>
<P>I agree that we should expect that the range of the <EM><STRONG>sample means</STRONG></EM> is larger than the standard deviation of the <EM><STRONG>sample means.</STRONG></EM> But, that's even true in the first plot you showed, Range = 0.05, and StDev = 0.0051. However, with samples as large as 900, we shouldn't expect that the range of the <EM>sample means</EM> is larger than the standard deviation of the original variable from which the samples are drawn. </P>
<P> </P>
<P> </P>
<P><EM>"One thing I'm wondering about... If instead of 1-second samples, the underlying population was 10-second samples, then there would only be 90 samples per 15-minute interval, and the calculation of the population SD would change by a factor of 3. ( SQRT(90) instead of SQRT(900) ). Yet the underlying continuous process would not have changed. I'm having a hard time wrapping my head around this..."</EM></P>
<P> </P>
<P><SPAN>Fantastic question! It seems perplexing at first, but let me hopefully explain this another way. If in the original data you had data collected every 10 seconds, rather than every 1 second, the sample means in your final table would be built out of samples of size 90 not 900. The standard deviation of the original data<STRONG> would not change</STRONG>, but the standard deviation of your <STRONG>sample means</STRONG> would change. Let's use some real numbers to clarify this:</SPAN></P>
<P> </P>
<P><SPAN>Take my original example, a population with a standard deviation of 120. When we had samples of 900, we found that the standard deviation of the distribution of those sample means was 4. We did this empirically, but could also have just applied the formula sigma / root(n), 120/30 = 4. If we had only the means of samples of size 900, and found the standard deviation of those means, we could have worked backward, sigma*root(n), 4*30 = 120. </SPAN></P>
<P> </P>
<P><SPAN>What about the case with data collected every 10 seconds and then averaged? Well, as you said, you'd have 90 observations for each mean. This implies that the standard deviation of your samples of 90 observations would be 120 / sqroot(90) = 12.65. Notice this standard deviation is larger than when we had means of samples of size 900. With fewer observations in each mean, the standard deviation of the means is larger -- they vary more from sample to sample because there are fewer observations balancing things out (law of large numbers in action, aka the consistency of the estimator, it gets better with more data). So, let's work the other way. If that was the kind of data you had access to, means of samples of size 90 from observations taken every 10 seconds, the standard deviation you'd have to work with would be 12.65, and you'd take 12.65*sqroot(90) = 120. So, nothing about the population is changing... what's changed is the process through which you've measured nature and the consequence of that process on the variability of the observations you have access to. </SPAN></P>
<P> </P>
<P><SPAN>All said though, this is all assuming independent and identically distributed observations. If there are systematic effects/autocorrelation/etc as <LI-USER uid="70"></LI-USER> mentioned, these simple formulas no longer adequately describe what happens when we take those means. </SPAN></P>
<P> </P>
<P><SPAN>I hope this clarifies a few things!</SPAN></P>
<P><SPAN><LI-USER uid="2026"></LI-USER> </SPAN></P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>Wed, 26 Jun 2019 21:02:09 GMThttps://community.jmp.com/t5/Discussions/Not-a-JMP-question-but-hoping-someone-can-help-Estimating-StdDev/m-p/214886#M42968julian2019-06-26T21:02:09Z