Our 2 tests on this page are basically methods that we can use to determine if a value within our given dataset should be ignored or not. Now we're going to look at the first Grubbs' test. Grubbs' test is used to detect a single outlier in a single-variable dataset that follows some type of normal distribution. Here in Grubbs' test, we first have to calculate our g calculated. Here, we have our questionable value, so our potential outlier minus your mean or average in absolute brackets divided by your standard deviation.
Now, we're going to compare our g calculated to our g table. Here we have our number of observations and then we have our g table or sometimes called our g critical based on a particular confidence interval. We have 90%, 95%, and 99% confidence. Now if our g table value happens to be less than our g calculated, that means that outlier needs to be discarded, and we need to recalculate the standard deviation and the mean within the remaining datasets. Next, if your g table is greater than your g calculated, that means that outlier is fine and it's within the normal level of confidence.
So, we can retain it, hold on to our mean and our standard deviation. Our q test, is another method that's usually not talked about. But here, this is just another method in finding outliers in very small, normally distributed datasets. Here, the number of measurements is normally between 3 to 7 values. Now, it can exceed that but the q test is usually reserved for very few data measurements.
Now here, we're going to say q calculated equals gaprange. What does that mean? Well, your gap is in absolute brackets x1−xn+1. x1 is just the suspected outlier that we're looking for. We're trying to determine if this is the number we need to ignore.
Then here, this is the next closest data point. That's the next measurement that's closest to that outlier. Then range, your range is just your largest value minus your smallest value in your dataset. For the q test, what you need to do is you need to take all your measurements and you need to organize them from smallest to largest value. Then your range is just that largest value minus your smallest value.
We'll see how to utilize this later on as we do a question on the q test. Now just like the Grubbs' test, we compare our q calculated in this case to our q table. Again, we have a number of measurements which you can compare to different levels of confidence. Here, again, if your table value is lower than your calculated value, in this case q, we disregard that value. It is an outlier and it cannot be included with our data measurements.
If your q table or your q critical value happens to be greater than your q calculated, then we can hold on to that suspected outlier and say that it does belong with the other measurements. Again, Grubbs' test is the more commonly used test to find the outlier. Q test is normally not discussed as much and it's usually reserved for very small amounts of measurements. Just remember these 2 different types of tests that are great at finding an outlier within a given dataset.