On Mean

Tom grew up in the City of Ruritania. He went to high school there, met his wife there, and has a happy home. Ruritania, the land of natural springs, is known for its pristine water. Tom’s house is alongside the west branch of Mohawk, one such pristine river. Every once in a while, Tom and his family go to the nature park on the banks of Mohawk. It is customary for Tom and his little one to take a swim.

Lately, he has been sensing a decline in the quality of the water. It is a scary feeling as the consequences are slow. Tom starts associating the cause of the poor water quality to this new factory in his neighborhood constructed just upstream of Mohawk.

Whether or not the addition of this new factory in Tom’s neighborhood reduced the quality of water compared to EPA standards is to be seen.

He immediately checked the EPA specifications for dissolved oxygen concentration in the river, and it is required by the EPA to have a minimum average concentration of 2 mg/L. Over the next ten days, Tom collected ten water samples from the west branch and got his friend Ron to measure the dissolved oxygen in his lab. In mg/L, the data reads like this.

1.8, 2, 2.1, 1.7, 1.2, 2.3, 2.5, 2.9, 1.9, 2.2

Tom wants to test if the average dissolved oxygen he sees from the samples significantly deviates from the one specified by EPA.

Does deviate from 2 mg/L? Is that deviation large enough to prompt caution?

He does this investigation using the hypothesis testing framework.

Since the investigation is regarding , the sample mean, and whether it is different from a selected value, it is reasonable to say that Tom is conducting a one-sample hypothesis test.

Tom knows this, and so do you and me — the sample mean ( ) is a random variable, and it can be described using a probability distribution. If Tom gets more data samples, he will get a slightly different sample mean. The value of the estimate changes with the change of sample and this uncertainty can be represented using a normal distribution by the Central Limit Theorem.

The sample mean is an unbiased estimate of the true mean, so the expected value of the sample mean is equal to the truth. . Go down the memory lane and find why in Lesson 67.

The variance of the sample mean is . Variance tells us how widely the estimate is distributed around the center of the distribution. We know this from Lesson 68.

When we put these two together,

or,

Now, if the sample size (n) is large enough, it would be reasonable to substitute sample standard deviation (s) in place of .

When we substitute s for , we cannot just assume that will tend to a normal distribution.

W. S. Gosset (aka “Student”) taught us that follows a T-distribution with (n-1) degrees of freedom.

Anyhow, all this is to confirm that Tom is conducting a parametric hypothesis test.

CHOOSE THE APPROPRIATE TEST; ONE-SAMPLE OR TWO-SAMPLE AND PARAMETRIC OR NONPARAMETRIC — check.

Tom establishes the null and alternate hypotheses. He assumes that the inception of the factory does not affect the water quality downstream of the Mohawk River. Hence,

mg/L

mg/L

The alternate hypothesis is one-sided. A significant deviation in one direction (less than) needs to be seen to reject the null hypothesis.

Notice that his null hypothesis is mg/L since it is required by the EPA to have a minimum average concentration of 2 mg/L.

ESTABLISH THE NULL AND ALTERNATE HYPOTHESIS — check.

Tom is taking a 5% risk of rejecting the null hypothesis; . His Type I error is 5%.

Suppose the factory does not affect the water quality, but, the ten samples he collected showed a sample mean much smaller than the EPA prescription of 2 mg/L, he should reject the null hypothesis — so he is committing an error (Type I error) in his decision making.

There is a certain level of subjectivity in the choice of . If Tom wants to see that the water quality is lower than 2 mg/L, he would perhaps choose to commit a greater error, i.e., select a larger value for .

If he wants to see that the water quality has not deteriorated, he will choose a smaller value for .

So, the decision to reject or not to reject the null hypothesis is based on .

DECIDE ON AN ACCEPTABLE RATE OF ERROR OR REJECTION RATE — check.

Since , the null distribution is a T-distribution with (n-1) degrees of freedom.

The test statistics is then , and Tom has to verify how likely it is to see a value as large as in the null distribution.

Look at his visual.

The distribution is a T-distribution with 9 degrees of freedom. Tom had collected ten samples for this test.

Since he opted for a rejection level of 5%, there is a cutoff on the distribution at -1.83.

-1.83 is the quantile corresponding to a 5% probability (rate of rejection) for a T-distribution with nine degrees of freedom.

If the test statistic ( ) is less than which is -1.83, he will reject the null hypothesis.

This decision is equivalent to rejecting the null hypothesis if (the p-value) is less than .

From his data, the sample mean ( ) is 2.06 and the sample standard deviation (s) is 0.46.

.

can be read off from the standard T-Table, or can be computed from the distribution.

At df = 9, and , and .

COMPUTE THE TEST STATISTIC AND ITS CORRESPONDING P-VALUE FROM THE OBSERVED DATA — check.

Since the test-statistics is not in the rejection region, or since , Tom cannot reject the null hypothesis that mg/L.

MAKE THE DECISION; REJECT THE NULL HYPOTHESIS IF THE P-VALUE IS LESS THAN THE ACCEPTABLE RATE OF ERROR — check.

Tom could easily have checked the confidence interval of the true mean to make this decision. Recall that the confidence interval is the range or an interval where the true value will be. So, based on the T-distribution with df = 9, Tom could develop the 90% confidence interval (why 90%?) and check if mg/L is within that confidence interval.

Look at this visual. Tom just did that.

The confidence interval is from 1.8 mg/L to 2.32 mg/L and the null hypothesis that mg/L is within the interval.

Hence, he cannot reject the null hypothesis.

While looking at the confidence interval gives us a visual intuition on what decision to make, it is always better to compute the p-value and compare it to the rejection rate.

Together, the p-value and provide the risk levels associated with decisions.

In this journey through the hypothesis framework, the next time we meet, we will unfold the knots of the test on the variance. Till then, meditate on this.

For a hypothesis test, just reporting the p-value in itself is more informative. Once the p-value is known, any person who understands the context of the problem can decide for themselves whether or not to reject the null hypothesis. In other words, they can set their level of rejection and compare the p-value to it.

If you find this useful, please like, share and subscribe.

You can also follow me on Twitter @realDevineni for updates on new lessons.