Chapter 9 Test of Hypotheses for a Single

  • Slides: 55
Download presentation
Chapter 9 Test of Hypotheses for a Single Sample

Chapter 9 Test of Hypotheses for a Single Sample

Learning Objectives • Structure hypothesis tests • Test hypotheses on the mean of a

Learning Objectives • Structure hypothesis tests • Test hypotheses on the mean of a normal distribution using either a Z-test or a t-test procedure • Test hypotheses on the variance or standard deviation of a normal distribution • Test hypotheses on a population proportion • Use the P-value approach for making decisions in hypotheses tests

Learning Objectives • Compute power, type II error probability, and make sample size selection

Learning Objectives • Compute power, type II error probability, and make sample size selection decisions for tests on means, variances, and proportions • Explain and use the relationship between confidence intervals and hypothesis tests • Use the chi-square goodness of fit test to check distributional assumptions • Use contingency table tests

Statistical Hypotheses • Construct a confidence interval estimate of a parameter from sample data

Statistical Hypotheses • Construct a confidence interval estimate of a parameter from sample data • Many problems require that we decide whether to accept or reject a statement about some parameter – Called a hypothesis • Decision-making procedure about the hypothesis is called hypothesis testing

Statistical Hypotheses • Useful aspects of statistical inference • Relationship between hypothesis testing and

Statistical Hypotheses • Useful aspects of statistical inference • Relationship between hypothesis testing and confidence intervals • Focus is on testing hypotheses concerning the parameters of one or more populations

Sources of Null Hypothesis • Three ways to specify the null hypothesis – May

Sources of Null Hypothesis • Three ways to specify the null hypothesis – May result from past experience or knowledge – May be determined from some theory or model regarding the process under study – May be determined from external considerations

Sample, Population and Statistical Inference • Statements about the population, not statements about the

Sample, Population and Statistical Inference • Statements about the population, not statements about the sample • If this information is consistent with the hypothesis – Conclude that the hypothesis is true • If this information is inconsistent with the hypothesis – Conclude that the hypothesis is false • Truth or falsity of a particular hypothesis can never be known with certainty • Unless we can examine the entire population

Structure of Hypothesis-testing • Identical in all the applications • The null hypothesis –

Structure of Hypothesis-testing • Identical in all the applications • The null hypothesis – Hypothesis we wish to test – Rejection of the null hypothesis always leads to accepting the alternative hypothesis • The alternate hypothesis – – Takes on several values Involves taking a random sample Computing a test statistic from the sample data Make a decision about the null hypothesis

Structure of Hypothesis-testing • Suppose a manufacturer is interested in the output voltage of

Structure of Hypothesis-testing • Suppose a manufacturer is interested in the output voltage of a power supply – Null hypothesis : H 0: =50 v – Alt. hypothesis: H 1: 50 v – A sample of n=10 specimens is tested • If the sample mean is close to 50 v – Such evidence supports the null hypothesis H 0 • If the sample mean is different from 50 v – Such evidence is in support of the alternative hypothesis

Critical Regions • The sample mean can take on many different values Suppose 48.

Critical Regions • The sample mean can take on many different values Suppose 48. 5 x 51. 5 Constitutes the critical region for the test Acceptance region The boundaries between the critical regions and the acceptance region are called the critical values – Critical values are 48. 5 and 51. 5 – – Reject H 0 50 Volts 48. 5 Fail to reject H 0 =50 Volts 50 Reject H 0 50 Volts 51. 5

Two Types of Error • Type I Error – Occurs when a true null

Two Types of Error • Type I Error – Occurs when a true null hypothesis is rejected – Value of represents the probability of committing this type of error • = P (Ho is rejected / Ho is true) • is called the significance level of the test • Type II Error – Occurs when a false null hypothesis is not rejected – Value of represents the probability of committing a type II error – = P(fail to reject Ho / Ho is false)

Two Types of Error • In testing any statistical hypothesis, four different situations determine

Two Types of Error • In testing any statistical hypothesis, four different situations determine whether the final decision is correct or in error Do not reject H 0 is True Correct Decision H 0 is False Type II or error Reject H 0 Type or error Correct Decision • Probabilities can be associated with the type I and type II errors

Probability of Making a Type I Error • Probability of making a type I

Probability of Making a Type I Error • Probability of making a type I error is denoted – = P (type I error) =P (reject H 0 when H 0 is true) • Sometimes the type I error probability is called the significance level or the -error • Previous example, a type I error will occur when either sample mean > 51. 5 or <48. 5 or when the true voltage is =50 v

Probability of Type I Error • Probability of type I error can be shown

Probability of Type I Error • Probability of type I error can be shown by the tails of normal distribution • = P(X<48. 5 when =50) +P(X>51. 5 when =50) • Using the corresponding z-values, =0. 0574 • 5. 74% of all random samples would lead to rejection of the hypothesis when the true mean is really 50 v

Probability of Type II Error • Examine the probability of a Type II error

Probability of Type II Error • Examine the probability of a Type II error • = P(type II error) = P(fail to reject H 0 when H 0 is false) • Have a specific alternative hypothesis • Alterative hypothesis: H 1: =52 v • A type II error will be committed if the sample mean falls between 48. 5 and 51. 5 when =52 v • Probability that 48. 5 x-bar 51. 5 when H 0 is false (because =52) • Using the z-values, the =0. 2643 • Corresponds to testing H 0: =50 against H 1: 50 with n =10, when the true value of the mean=52

Power of a Statistical Test • Power = 1 - • Power=1 -0. 2643=0.

Power of a Statistical Test • Power = 1 - • Power=1 -0. 2643=0. 7357 • Power can be interpreted as the probability of correctly rejecting a false null hypothesis • If it is too low, the analyst can increase either or the sample size n

Example-1 • • A textile fiber manufacturer is investigating a new drapery yarn, which

Example-1 • • A textile fiber manufacturer is investigating a new drapery yarn, which the company claims has a mean thread elongation of 12 kg with a standard deviation of 0. 5 kg. The company wishes to test the hypothesis H 0: =12 against H 1<12, using a random sample of four specimens. 1. What is the type I error probability if the critical region is defined as sample mean <11. 5 kg? 2. Find for the case where the true mean elongation is 11. 25 kg.

Solution-Part 1 • = P(reject H 0 when H 0 is true) = P(

Solution-Part 1 • = P(reject H 0 when H 0 is true) = P( 11. 5 when = 12) = P(Z 2)= 1 P(Z 2) = 1 0. 97725 = 0. 02275 • The probability of rejecting the null hypothesis when it is true is 0. 02275

Solution-Part 2 • • = P(accept H 0 when = 11. 25) = =P(Z

Solution-Part 2 • • = P(accept H 0 when = 11. 25) = =P(Z > 1. 0) = 1 P(Z 1. 0) =1 0. 84134 = 0. 15866 The probability of accepting the null hypothesis when it is false is 0. 15866.

Tests on The Mean of a Normal Distribution, Variance Known • Consider hypothesis testing

Tests on The Mean of a Normal Distribution, Variance Known • Consider hypothesis testing about the mean of a single, normal population where the variance of the population 2 is known • Random sample X 1, X 2, … , Xn has been taken from the population • x is an unbiased point estimator of with variance 2/n • Test the hypotheses • H 0: = 0 • H 1: 0 • Test procedure for H 0: = 0 uses the test statistic

Cont. • If is the significance level, the probability that the test statistic Z

Cont. • If is the significance level, the probability that the test statistic Z 0 falls between -Z /2 and Z /2 will be 1 - • Regions associated with -Z /2 and Z /2 • Reject H 0 if the observed value of the test statistic z 0 is either > Z /2 or <-Z /2

Location of Critical Region for One-sided Tests The distribution of Z 0 when H

Location of Critical Region for One-sided Tests The distribution of Z 0 when H 0: = 0 is true, for the one-sided alternative H 1: > 0 The distribution of Z 0 when H 0: = 0 is true, for the one-sided alternative H 1: < 0

Relationship between the Signs in Ho And H 1 Two-sided Test Left-sided Test Right-sided

Relationship between the Signs in Ho And H 1 Two-sided Test Left-sided Test Right-sided Test Sign in the H 0 = = or Sign in the H 1 < > Rejection Region On both sides On the left side On the right side

General Procedure for Hypothesis Tests • Following steps will be used 1. From the

General Procedure for Hypothesis Tests • Following steps will be used 1. From the problem, identify the parameter of interest 2. State the null hypothesis, H 0 3. Specify an appropriate alternative hypothesis, H 1 4. Choose a significance level 5. Determine an appropriate test statistic

General Procedure for Hypothesis Tests 6. State the rejection region for the statistic 7.

General Procedure for Hypothesis Tests 6. State the rejection region for the statistic 7. Compute any necessary sample quantities, substitute these into the equation for the test statistic, and compute that value 8. Decide whether or not H 0 should be rejected

Example-2 • A manufacturer produces crankshafts for an automobile engine • The wear of

Example-2 • A manufacturer produces crankshafts for an automobile engine • The wear of the crankshaft after 100, 000 miles (0. 0001 inch) is of interest because it is likely to have an impact on warranty claims • A random sample of n=15 shafts is tested and sample mean is 2. 78 • It is known that =0. 9 and that wear is normally distributed – Test H 0: =3 versus H 1: 3 using =0. 05

Solution • Using the general procedure for hypothesis testing 1. 2. 3. 4. 5.

Solution • Using the general procedure for hypothesis testing 1. 2. 3. 4. 5. The parameter of interest is the true mean crankshaft wear, H 0 : = 3 H 1 : 3 = 0. 05 Test statistic is 6. Reject H 0 if z 0 < z /2 where z 0. 005 = 1. 96 or z 0 > z /2 where z 0. 005 = 1. 96 7. and = 0. 9 8. Since – 0. 95 > -1. 96, do not reject the null hypothesis and conclude there is not sufficient evidence to support the claim the mean crankshaft wear is not equal to 3 at = 0. 05

P-Values in Hypothesis Tests • P-value is the smallest level of significance that would

P-Values in Hypothesis Tests • P-value is the smallest level of significance that would lead to rejection of the null hypothesis H 0 • Conveys much information about the weight of evidence against H 0 • Adopted widely in practice • P-value is

Example-3 • What is the P-value in Example-2? • Solution P-value = 2[1 (|-0.

Example-3 • What is the P-value in Example-2? • Solution P-value = 2[1 (|-0. 95|)] =2[1 -0. 8289] =0. 34

Probability of Type II Error • Analyst directly selects the type I error probability

Probability of Type II Error • Analyst directly selects the type I error probability • Probability of type II error depends on the choice of sample size • Considering a two-sided test, the probability of the type II error is the probability that Z 0 falls between Z /2 and Z /2 given that H 1 is true • Expressed mathematically, this probability is

Example-4 • What is the power of the test in Example-2 if =3. 25?

Example-4 • What is the power of the test in Example-2 if =3. 25? • Solution = (1. 96 + 1. 075) ( 1. 96 + 1. 075) = (0. 884) ( 3. 035) = 0. 81057— 0. 001223 =0. 8098 • Power=1 -0. 8098 =0. 1902

Choice of Sample Size • Suppose that the null hypothesis is false and that

Choice of Sample Size • Suppose that the null hypothesis is false and that the true value of the mean is = + 0, where >0 • Formulas that determine the appropriate sample size to obtain a particular value of for a given and are • Two sided-test alternative hypotheses • For either of the one-sided alternative hypotheses • Where = - 0

Example-5 • Considering the problem in Example-2, what sample size would be required to

Example-5 • Considering the problem in Example-2, what sample size would be required to detect a true mean of 3. 75 if we wanted the power to be at least 0. 9? • Solution

Using Operating Characteristic Curves • Convenient to use the operating characteristic curves in Appendix

Using Operating Characteristic Curves • Convenient to use the operating characteristic curves in Appendix Charts VIa and VIb to find • Curves plot against a parameter d for various sample sizes n • d is defined as

Using Operating Characteristic Curves • Curves are provided for both =0. 05 and =0.

Using Operating Characteristic Curves • Curves are provided for both =0. 05 and =0. 01 • When d=0. 5, n =25, and =0. 05, Then =0. 3 • 30% chance that the true will not be detected by the test with n =25

Large-Sample Test • In most practical situations 2 will be unknown • May not

Large-Sample Test • In most practical situations 2 will be unknown • May not be certain that the population is well modeled by a normal distribution • If n is large (say n>40) • Sample standard deviation s can be substituted for • Valid regardless of the form of the distribution of the population • Relies on the central limit theorem just as we did for the large sample confidence interval

Tests On The Mean Of A Normal Distribution, Variance Unknown • Situation is analogous

Tests On The Mean Of A Normal Distribution, Variance Unknown • Situation is analogous to Ch. 8, where we constructed a C. I. • S 2 replaces 2 • Use the test statistic • Use the critical values -tα/2, n-1 and tα/2, n-1 as the boundaries of the critical region • Reject H 0: μ=μ 0 if t 0> tα/2, n-1 or if t 0<-tα/2, n-1

Location of the Critical Region • H 1: μ > μ 0 • H

Location of the Critical Region • H 1: μ > μ 0 • H 1: μ < μ 0

Choice of Sample Size • Situation is analogous to the case, where variance was

Choice of Sample Size • Situation is analogous to the case, where variance was known • Use the sample variance s 2 to estimate 2 • Charts VIe, VIf, VIg, and VIh plot β for the ttest against a parameter d for various sample sizes n

Hypothesis Tests on the Standard Deviation of a Normal Population • Wish to test

Hypothesis Tests on the Standard Deviation of a Normal Population • Wish to test the hypotheses on the population variance • Suppose – H 0: 2= 20 – H 1: 2# 20 • Use the test statistic • X 2 follows the chi-square distribution with n-1 degrees of freedom • Reject H 0: 2= 20 if X 20> X 2α/2, n-1 or if X 20 <X 21 -α/2, n-1

Location of the Critical Region • Reference distribution for the test of H 0:

Location of the Critical Region • Reference distribution for the test of H 0: 2= 20 with critical region values • H 1 : 2 2 0 • H 1: 2 < 20 • H 1: 2 > 20

Tests on a Population Proportion • Test hypotheses on a population proportion • Recall

Tests on a Population Proportion • Test hypotheses on a population proportion • Recall Pˆ =X/n is a point estimator of the proportion of the population p • Sampling distribution of Pˆ is approximately normal with mean p and variance p(1 -p)/n • Now consider testing the hypotheses – H 0: p=p 0 – H 1: p#p 0 • Use • Reject H 0: p=p 0 if z 0>zα/2 or z 0<-zα/2

Type II Error and Choice of Sample Size • Obtain closed-form equations for the

Type II Error and Choice of Sample Size • Obtain closed-form equations for the approximate β-error for the tests • For the two-sided alternative, sample size equation • For the one-sided alternative, sample size equation

Example-6 • An article in Fortune (September 21, 1992) claimed that nearly one-half of

Example-6 • An article in Fortune (September 21, 1992) claimed that nearly one-half of all engineers continue academic studies beyond the B. S. degree, ultimately receiving either an M. S. or a Ph. D. degree • Data from an article in Engineering Horizons (Spring 1990) indicated that 117 of 484 new engineering graduates were planning graduate study – Are the data from Engineering Horizons consistent with the claim reported by Fortune? Use =0. 05 in reaching your conclusions – Find the P-value for this test

Solution • • Part 1 1. 2. 3. 4. 5. True proportion of engineers,

Solution • • Part 1 1. 2. 3. 4. 5. True proportion of engineers, p H 0 : p = 0. 50 H 1 : p 0. 50 = 0. 05 Test statistic 6. Reject H 0 if z 0 < z /2 where z /2 = z 0. 025 = 1. 96 or z 0 > z /2 where z /2 = z 0. 025 = 1. 96 7. x = 117 n = 484 8. Since 11. 352 < 1. 96, reject the null hypothesis Part 2 1. P-value = 2(1 (11. 352)) = 2(1 1) = 0

Testing for Goodness of Fit • Not know the underlying distribution of the population

Testing for Goodness of Fit • Not know the underlying distribution of the population • Wish to test the hypothesis that a particular distribution will be satisfactory as a population model – For example, test the hypothesis that the population is normal • Used a very useful graphical technique called probability plotting • A formal goodness-of-fit test procedure based on the chi-square distribution

Test Procedure • Requires a random sample of size n from the population whose

Test Procedure • Requires a random sample of size n from the population whose probability distribution is unknown • Arranged the n observations in a frequency histogram – k bins or class intervals • Let Oi be the observed frequency in the ith class interval • Compute the expected frequency, Ei, in the ith class interval • Test statistic • If the population follows the hypothesized distribution, X 2 has a chi-square distribution with k-p-1 d. o. f. – p represents the number of parameters of the hypothesized distribution • Reject the hypothesis that the distribution if the calculated value of the test statistic

Magnitude of Expected Frequencies • Application of this test procedure concerns the magnitude of

Magnitude of Expected Frequencies • Application of this test procedure concerns the magnitude of the expected frequencies • There is no general agreement regarding the minimum value of expected frequencies • But values of 3, 4, and 5 are widely used as minimal • Use 3 as minimal

Example-7 • Consider the following frequency table of observations on the random variable X

Example-7 • Consider the following frequency table of observations on the random variable X Values 0 1 2 3 4 Observed Frequencies 24 30 31 11 4 • Based on these 100 observations, is a Poisson distribution with a mean of 1. 2 an appropriate model? Perform a goodness-offit procedure with α=0. 05

Solution • • • Mean=1. 2 Degrees of freedom=k-p-1=4 -0 -1=3 Compute pi P

Solution • • • Mean=1. 2 Degrees of freedom=k-p-1=4 -0 -1=3 Compute pi P 1=P(X=0)=[e-01. 2 (0. 75)0]/0! =0. 3012 Similarly, p 2, p 3, p 4, and p 5 are 0. 3614, 0. 2169, 0. 0867, 0. 0260, respectively • Expected frequency Ei=npi • Expected frequency for class 1 =0. 3012*100=30. 12 • Similarly, the E 2, E 3, E 4, and E 5 are 36. 14, 21. 69, 8. 67, and 2. 60, respectively

Solution-Cont. • Summarize the expected and observed frequencies are Value 0 1 2 3

Solution-Cont. • Summarize the expected and observed frequencies are Value 0 1 2 3 4 Observed frequency 24 30 31 11 4 Expected frequency 30. 12 36. 14 21. 69 8. 67 2. 69 • Expected frequency in the last interval is < 3, we combine the last two rows Value 0 1 2 3 -4 Observed frequency 24 30 31 15 Expected frequency 30. 12 36. 14 21. 69 11. 67

Solution-Cont. 1. 2. 3. 4. 5. 6. 7. Variable of interest H 0: Form

Solution-Cont. 1. 2. 3. 4. 5. 6. 7. Variable of interest H 0: Form of the distribution is Poisson H 1: Form of the distribution is not Poisson = 0. 05 Test statistic is Reject H 0 if Computations 8. Since 7. 23 < 7. 81 do not reject H 0

Contingency Table Tests • Classify n elements of a sample to two different criteria

Contingency Table Tests • Classify n elements of a sample to two different criteria • Know whether the two methods of classification are statistically independent • Example – Consider the population of graduating engineers – May wish to determine whether starting salary is independent of academic disciplines • First method of classification has r levels • Second method has c levels • Let Oij be the observed frequency for level i of the first classification and level j on the second classification • Construct an r x c table • Called an r x c contingency table

Testing the Hypothesis • Interested in testing the hypothesis that the methods of classification

Testing the Hypothesis • Interested in testing the hypothesis that the methods of classification are independent • By rejecting the hypothesis – There is some interaction between the two criteria of classification • The statistic • Has an chi-square distribution with (r-1)(c-1) d. o. f. • Reject the hypothesis of independence if

Example • • Patients in a hospital are classified as surgical or medical A

Example • • Patients in a hospital are classified as surgical or medical A record is kept of the number of times patients require nursing service during the night and whether or not these patients are on Medicare. The data are presented here: • Test the hypothesis (using =0. 01) that calls by surgical medical patients are independent of whether the patients are receiving Medicare. Find the P-value for this test • Solution