Docsity

Hypothesis Testing for Example - Lecture Notes | STAT 3000, Study notes of Statistics

Toggle sidebar
bg1
179
One more example:
A random sample of 41 glass sheets is obtained and their thickness is measured. The
sample mean is
x
= 3.04 mm and the sample standard deviation is s = 0.124 mm.
Construct a 99% two-sided t-interval for the mean glass thickness. Do you think it is
plausible that the mean glass thickness is 2.90 mm?
How many additional glass sheets do you think should be sampled in order to construct a
99% two-sided t-confidence interval for the average sheet thickness with a length not
larger than L0 = 0.05 mm?
7.2 Hypothesis testing
7.2.0 Introduction
Confidence intervals give us information about accuracy of our estimate of a certain
parameter.
Hypothesis testing, another aspect of statistical inference, give us information about
plausibility or credibility of a specific statement or hypothesis.
Hypothesis à in statistics, a hypothesis means a certain theory, claim, assertion, or a
statement about a particular parameter in the population.
Hypothesis testing à a procedure (statistical test) that enables us to make inferences
about a population parameter by analyzing differences between the results we observe
(our sample statistic) and the results we expect to obtain if some underlying hypothesis is
actually true.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Hypothesis Testing for Example - Lecture Notes | STAT 3000 and more Study notes Statistics in PDF only on Docsity!

One more example:

A random sample of 41 glass sheets is obtained and their thickness is measured. The sample mean is x = 3.04 mm and the sample standard deviation is s = 0.124 mm. Construct a 99% two-sided t -interval for the mean glass thickness. Do you think it is plausible that the mean glass thickness is 2.90 mm?

How many additional glass sheets do you think should be sampled in order to construct a 99% two-sided t -confidence interval for the average sheet thickness with a length not larger than L 0 = 0.05 mm?

7.2 Hypothesis testing

7.2.0 Introduction

Confidence intervals give us information about accuracy of our estimate of a certain parameter.

Hypothesis testing, another aspect of statistical inference, give us information about plausibility or credibility of a specific statement or hypothesis.

Hypothesis ‡ in statistics, a hypothesis means a certain theory, claim, assertion, or a statement about a particular parameter in the population.

Hypothesis testing ‡ a procedure (statistical test) that enables us to make inferences about a population parameter by analyzing differences between the results we observe (our sample statistic) and the results we expect to obtain if some underlying hypothesis is actually true.

In other words, we conduct a statistical test to check whether our hypothesis is plausible or not. Based on the results of this test, we decide to accept or to reject the hypothesis.

Because in this Chapter we compare one sample mean with the "known" population mean, we talk about one-sample tests.

7.2.1 z -test

7.2.1.1 Two-sided z -test

SAT scores example:

In 1995, the mean SAT scores nationwide were 500 points, with a standard deviation of 100 points. Last year, the SAT-M test was given to a random sample of 500 high school students from California. They obtained the average score of 461 points.

Based on our sample (the data we observe) can we believe that the mean SAT score is really 500 points?

The first step in hypothesis testing is to state the hypotheses.

Hypothesis we want to test: μ = 500.

This hypothesis that the population parameter is equal to the claimed value is called null hypothesis ( H 0 ):

In our example: Η 0 : μ = 500. Generally: Η 0 : μ = μ 0 where μ 0 is some specific (fixed) value.

Note that, even though we actually work with a sample, the null hypothesis is written in terms of the population parameter. This is because we are interested in the entire population (of high school students taking SAT-M test).

If the null hypothesis is judged false (or implausible), something else must be plausible. Therefore, whenever we state a null hypothesis, we have to state an alternative hypothesis ( HA ), the one that must be plausible if the null hypothesis is found implausible.

In our example: ΗA : μ ≠ 500. Generally: ΗA : μ ≠ μ 0 where μ 0 is the same value as in H 0.

We test the null hypothesis that the mean SAT score is 500 points against the alternative hypothesis that the mean SAT score is not equal 500 points, i.e.,

But, if there are large discrepancies between the point estimate obtained from the data and the value stated in H 0 , i.e., if the (absolute) value of the calculated test statistic is large, this might indicate that H 0 is wrong.

Distribution of sample means from the distribution with μ = 500, obtained from many samples of size n = 500

Distribution of "standardized" sample means from the distribution with μ = 500, obtained from many samples of size n = 500

We have to determine how likely is the test statistic we obtained from the sample if the H 0 is really true, i.e., if the population mean is really 500.

The p-value is the probability of obtaining the test statistic equal to or more extreme than the result obtained from our sample, given that the null hypothesis H 0 is really plausible.

½ p -value

− z z

½ p -value

Obtaining p -value for a two-sided z -test:

p -value = P (| Z | ≥ z ) ‡ area in tails

= P [( Z ≥ z ) or ( Z ≤ − z )]

= P ( Z ≤ − z ) + P ( Z ≥ z )

= 2 P ( Z ≤ − | z |)

= 2 Φ (− | z |)

For our SAT score problem, the p-value is:

p -value = 2 Φ (− | z |) = ………..

Interpretation of p -value:

A large p -value means that the observed data (i.e., the parameter estimate obtained from our sample) is quite plausible for the distribution of sample means when true μ = μ 0.

A small p -value means that the observed data (i.e., the parameter estimate obtained from our sample) is very unlikely when true μ = μ 0, which means that:

− Our sample comes from a different population; − Information about μ is not correct. − H 0 is wrong; HA is plausible.

Finally, the fourth step in hypothesis testing is making decision about H 0 : whether to accept or to reject H 0.

This decision is based on the obtained p -value.

"General classification" of p -values:

p -value ≥ 0.05  the difference between our sample's mean and the population mean μ 0 (stated in H 0 ) is just due to chance, i.e., it is just a result of sampling error; in fact, there is no difference  there is not enough evidence to reject H 0  H 0 is accepted

é Obtain p -value:

With an one-sided problem, the definition of the p -value is somewhat different: the p-value is the probability to obtain value of z of …….. or even smaller if the population mean is really 500.

p -value = P ( Z ≤ z ) = Φ ( z ) = ………..

è State conclusions (make decision about H 0 ):

p -value = …….

Decision:

7.2.1.3 Some comments on significance level

Significance level (denoted by αα ) is the probability (that we usually choose in advance) of wrongly rejecting H 0.

This is a probability of making a wrong decision - rejecting H 0 and saying it is wrong when, in fact, H 0 is plausible.

Being a probability of error, the significance level α is sometimes called Type I error.

The significance level is usually chosen in advance: it is usually 5% ( α = 0.05), 1% ( α = 0.01), and sometimes 0.1% ( α = 0.001).

The level of significance we choose indicates the risk of committing Type I error when making decisions about H 0.

α = 0.05  probability of error is 5%, which is relatively high, but we will choose this significance level only when being wrong will not have great consequences. Usually, if we reject H 0 at 5% significance level, but do not reject it at 1% significance level, we will, whenever possible, try to collect more data to get a clearer picture.

α = 0.01  probability of error is 1%, which indicates smaller risk of error, because making an error can cost you time and money.

α = 0.001  probability of error is 0.1% - the risk of being wrong is very small. We will choose this level of significance if making an error can be life threatening (medical research).

Based on our sample data, we obtain the p -value and compare it with the chosen α.

The p -value obtained from the data is referred to as the observed level of significance , which is the smallest level at which H 0 can be rejected for a given set of data.

The decision rules for rejecting H 0 are as follows:

− If the p -value is greater or equal to α , the null hypothesis is accepted (not rejected) at α significance level.

− If the p -value is smaller than α , the null hypothesis is rejected at α significance level..

Sometimes, however, we cannot obtain the exact p -value (no Table I and no software available).

In such situations, we can obtain an approximate p -value by comparing the calculated test statistic ( z -statistic) with the critical points of the standard normal distribution ( zα ) for chosen α.

In most situations we will compare the calculated z statistic with:

− z 0.025 and z 0.005 ‡ for a two-sided problem

− z 0.05 and z 0.01 ‡ for an one-sided problem

The decision rules for rejecting H 0 are then as follows:

7.2.1.4 Summary

Four-step recipe for hypothesis testing:

å State hypotheses

ç Calculate test statistic

é Obtain p -value

è State conclusions

If we can obtain the p -value exactly, we can proceed directly to step 4.

If we cannot obtain the p -value exactly and have to compare the calculated test statistic with critical points of the appropriate distribution instead, proceed as follows:

− Compare your calculated z with the critical point for α = 0.05, that is, z .05 (one-sided problem) or z .025 (two sided problem).

− If z ≤ z. 025 (two-sided) or z ≥ − z. 05 (one-sided lower bound) or z ≤ z. 05 (one- sided upper bound) then ⇒ accept H 0 ⇒ end of the problem! ⇒ there is not sufficient evidence to reject H 0. ⇒ end of the problem!

− If z > z. 025 (two-sided) or z < − z. 05 (one-sided lower bound) or z > z. 05 (one- sided upper bound) then ⇒ reject H 0 at 5% significance level ⇒ and continue as follows:

− Compare your calculated z with the critical point for α = 0.01, that is, z .01 (one-sided problem) or z .005 (two sided problem). − If z ≤ z. 005 (two-sided) or z ≥ − z. 01 (one-sided lower bound) or z ≤ z. 01 (one- sided upper bound) then ⇒ do not reject H 0 at 1% significance level ⇒ there is some evidence that H 0 is wrong, but the evidence is not very strong ⇒ end of the problem (in practice, try to collect more data if possible).

− If z > z. 005 (two-sided) or z < − z. 01 (one-sided lower bound) or z > z. 01 (one- sided upper bound) then ⇒ reject H 0 at 1% significance level; ⇒ there is strong evidence that H 0 is wrong; ⇒ end of the problem

When we accept H 0 , it means that H 0 is plausible.

When we reject H 0 , it means that H 0 is wrong.

We cannot prove that H 0 is true - because there are many plausible H 0's.

We can only prove that H 0 is wrong.

Hypothesis testing is similar to parentage testing:

‡ In parentage testing, we can only exclude a certain man as a father of the child, but we cannot prove that this man is really the father of the child.

‡ In hypothesis testing, we can exclude a certain H 0 and show that it is not plausible, but we cannot prove that this H 0 is really true.

7.2.2. t -test

In many situations we do not know the population standard deviation σ , and have to work with the sample standard deviation s that we obtain from our sample data.

When we calculate test statistic (which is, in fact, a standardized sample mean), we have to use s instead of σ.

Thus, the calculated test statistic is not a z statistic any longer, it is a t -statistic:

s

n x t

( − μ 0 )

The t -statistic follows a "sloppier" t -distribution with n − 1 degrees of freedom (n = sample size).

Because we calculate a t -statistic and use a t -distribution, we talk about t -test.

w Obtain p -value:

In this case, we have to obtain p -value based on a t -distribution with n -1 degrees of freedom.

p -value = P (| T | ≥ t ) ‡ where T has a t -distribution with n - 1 = 20−1 = 19 df.

= P [( T ≥ t ) or ( T ≤ − t )]

= 2 P ( T ≥ | t |) ‡ two-tailed probability

We can obtain this p -value using Microsoft Excel:

p -value = TDIST ( t , n −1, 2)

If we do not have software at hand, we have to work with Table III that contains critical points of the t-distribution.

Then, we have to obtain an approximate p -value by comparing the calculated t -statistic with the critical points of the t -distribution with n −1 df for α = 0.05 and α = 0.01:

For α = 0.05: t (^) 0.025, 19 =

For α = 0.01: t (^) 0.005, 19 =

x State conclusions:

b) Construct a 99% two-sided confidence interval for the mean weight of 'Almond Joy' candy bars.

c) How does the confidence interval construct in part b) provide the answer to part a)?

7.2.2.2 One-sided t -test

Example 2:

2. Water hardness (adapted from the Final Exam - Spring 2000):

For their out-of-class STAT project, Nicole, Troy, and Terry from STAT 3000 - Section 002 decided to analyze hardness of water in the Widstoe Chemistry Building at the USU. They analyzed nine (9) 50ml samples of tap water and obtained the average hardness of 205.22 ppm CaCO 3 and the standard deviation of 2.17 ppm CaCO 3.

a) Construct a two-sided 95% confidence interval for the mean hardness of water in the Widstoe Chemistry Building.

b) Would a 99% two-sided confidence interval for mean water hardness be shorter or longer that the 95% confidence interval found in a)? You do not have to construct this interval - just answer the question.

c) Reported water hardness in Logan and surrounding is 190 ppm CaCO 3. Based on the results of our students' experiment, is there any evidence that hardness of water in the Widstoe Chemistry Building is greater than that reported for Logan and surrounding?

7.3 Statistical software useful for confidence intervals and hypothesis testing

  1. Rice Virtual Lab in Statistics (RVLS)

http://www.ruf.rice.edu/~lane/rvls.html  Analysis Lab (http://www.ruf.rice.edu/~lane/stat_analysis ) − 90%, 95%, and 99% two-sided t -intervals, one-sample two-sided t -test for mean

  1. Statlets

http://www.statlets.com/free1_1/WebStat.html  Analyze  One sample  One variable analysis  t-test − arbitrary one- and two-sided t -intervals, one-sample one- and two-sided t -test  Analyze  One sample  Hypothesis test - Mean and Sigma  t-test − arbitrary one- and two-sided t -intervals, one-sample one- and two-sided t -test when only sample statistics (no data) are available.

  1. Webstat

http://www.stat.sc.edu/webstat/  Analyze  One sample  One variable analysis  t-test − arbitrary one- and two-sided t - and z -intervals, one-sample one- and two-sided t - and z -test.

  1. Microsoft Excel

 Tools  Data analysis  Descriptive statistics  Confidence level for mean − margin error for mean.