Lesson 87 – The One-Sample Hypothesis Test – Part II

On Mean

H_{0}: \mu = \mu_{0}

H_{A}: \mu > \mu_{0}

H_{A}: \mu < \mu_{0}

H_{A}: \mu \neq \mu_{0}

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 \bar{x} 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 \bar{x} , 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 (\bar{x} ) 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. E[\bar{x}]=\mu . Go down the memory lane and find why in Lesson 67.

The variance of the sample mean is V[\bar{x}]=\frac{\sigma^{2}}{n} . 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,

\bar{x} \sim N(\mu, \frac{\sigma^{2}}{n})

or,

\frac{\bar{x}-\mu}{\frac{\sigma}{\sqrt{n}}} \sim N(0,1)

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

When we substitute s for \sigma, we cannot just assume that \bar{x} will tend to a normal distribution.

W. S. Gosset (aka “Student”) taught us that \frac{\bar{x}-\mu}{\frac{s}{\sqrt{n}}} follows a T-distribution with (n-1) degrees of freedom. 

\frac{\bar{x}-\mu}{\frac{s}{\sqrt{n}}} \sim t_{df=n-1}

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,

H_{0}: \mu \ge 2 mg/L

H_{A}: \mu < 2 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 \mu \ge 2 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; \alpha =0.05 . 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 \alpha . 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 \alpha .

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

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

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

Since \frac{\bar{x}-\mu}{\frac{s}{\sqrt{n}}} \sim t_{df=n-1}, the null distribution is a T-distribution with (n-1) degrees of freedom.

The test statistics is then t_{0} = \frac{\bar{x}-\mu}{\frac{s}{\sqrt{n}}}, and Tom has to verify how likely it is to see a value as large as t_{0} 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 (t_{0}) is less than t_{critical} which is -1.83, he will reject the null hypothesis. 

This decision is equivalent to rejecting the null hypothesis if P(T \le t_{0}) (the p-value) is less than \alpha.

From his data, the sample mean (\bar{x}) is 2.06 and the sample standard deviation (s) is 0.46. 

t_{0} = \frac{\bar{x}-\mu}{\frac{s}{\sqrt{n}}}=\frac{2.06-2}{\frac{0.46}{\sqrt{10}}}=0.41.

t_{critical} can be read off from the standard T-Table, or P(T \le 0.41) can be computed from the distribution. 

At df = 9, and \alpha=5\%, t_{critical}=-1.83 and P(T \le 0.41)=0.66.

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

Since the test-statistics t_{0} is not in the rejection region, or since p-value > \alpha, Tom cannot reject the null hypothesis that \mu \ge 2 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 \mu = 2 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 \mu = 2 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 \alpha 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.

error

Enjoy this blog? Please spread the word :)