580 likes | 1.05k Views
Chapter 9. Test of Hypotheses for a Single Sample. 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
E N D
Chapter 9 Test of Hypotheses for a Single Sample
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 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 • 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 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 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 • 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 • 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 a power supply • Null hypothesis :H0: =50 v • Alt. hypothesis: H1: 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 H0 • 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.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 Fail to reject H0 =50 Volts Reject H0 50 Volts Reject H0 50 Volts 48.5 50 51.5
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 whether the final decision is correct or in error • 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 error is denoted • = P (type I error) =P (reject H0 when H0 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 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 • = P(type II error) = P(fail to reject H0 when H0 is false) • Have a specific alternative hypothesis • Alterative hypothesis: H1: =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.5x-bar 51.5 when H0 is false (because =52) • Using the z-values, the =0.2643 • Corresponds to testing H0: =50 against H1: 50 with n =10, when the true value of the mean=52
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 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 H0: =12 against H1<12, using a random sample of four specimens. • What is the type I error probability if the critical region is defined as sample mean <11.5 kg? • Find for the case where the true mean elongation is 11.25 kg.
Solution-Part 1 • = P(reject H0 when H0 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 H0 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 about the mean of a single, normal population where the variance of the population 2 is known • Random sample X1, X2, … , Xnhas been taken from the population • x is an unbiased point estimator of with variance 2/n • Test the hypotheses • H0: =0 • H1: 0 • Test procedure for H0:=0 uses the test statistic
Cont. • If is the significance level, the probability that the test statistic Z0 falls between -Z/2 and Z/2 will be 1- • Regions associated with -Z/2 and Z/2 • Reject H0 if the observed value of the test statistic z0 is either > Z/2or <-Z/2
Location of Critical Region for One-sided Tests The distribution of Z0 when H0: =0is true, for the one-sided alternative H1: >0 The distribution of Z0 when H0: =0is true, for the one-sided alternative H1: <0
General Procedure for Hypothesis Tests • Following steps will be used • From the problem, identify the parameter of interest • State the null hypothesis, H0 • Specify an appropriate alternative hypothesis, H1 • Choose a significance level • Determine an appropriate test statistic
General Procedure for Hypothesis Tests • State the rejection region for the statistic • Compute any necessary sample quantities, substitute these into the equation for the test statistic, and compute that value • Decide whether or not H0 should be rejected
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 H0: =3 versus H1: 3 using =0.05
Solution • Using the general procedure for hypothesis testing • The parameter of interest is the true mean crankshaft wear, • H0 : = 3 • H1 : 3 • = 0.05 • Test statistic is • Reject H0 if z0 < z/2 where z0.005 = 1.96 or z0 > z/2 where z0.005 = 1.96 • and = 0.9 • 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 lead to rejection of the null hypothesis H0 • Conveys much information about the weight of evidence against H0 • Adopted widely in practice • P-value is
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 depends on the choice of sample size • Considering a two-sided test, the probability of the type II error is the probability that Z0 falls between -Z/2 and Z/2 given that H1 is true • Expressed mathematically, this probability is
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 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 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 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.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 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 to Ch.8, where we constructed a C.I. • S2 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 H0: μ=μ0if t0> tα/2,n-1 or if t0<-tα/2,n-1
Location of the Critical Region • H1: μ > μ0 • H1: μ μ0 • H1: μ < μ0
Choice of Sample Size • Situation is analogous to the case, where variance was known • Use the sample variance s2 to estimate 2 • Charts VIe, VIf, VIg, and VIh plot β for the t-test against a parameter d for various sample sizes n
Hypothesis Tests on the Standard Deviation of a Normal Population • Wish to test the hypotheses on the population variance • Suppose • H0: 2=20 • H1: 2#20 • Use the test statistic • X2 follows the chi-square distribution with n-1 degrees of freedom • Reject H0: 2=20 if X20> X2α/2,n-1 or if X20 <X21-α/2,n-1
Location of the Critical Region • Reference distribution for the test of H0: 2=20 with critical region values • H1: 2 20 • H1: 2 <20 • H1: 2 >20
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 • H0: p=p0 • H1: p#p0 • Use • Reject H0: p=p0 if z0>zα/2 or z0<-zα/2
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 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 • True proportion of engineers, p • H0 : p = 0.50 • H1 : p 0.50 • = 0.05 • Test statistic • Reject H0 if z0 < z/2 where z/2 = z0.025 = 1.96 or z0 > z/2 where z/2 = z0.025 = 1.96 • x = 117 n = 484 • Since 11.352 < 1.96, reject the null hypothesis • Part 2 • P-value = 2(1 (11.352)) = 2(1 1) = 0
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 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, X2 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 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 • Based on these 100 observations, is a Poisson distribution with a mean of 1.2 an appropriate model? Perform a goodness-of-fit procedure with α=0.05
Solution • Mean=1.2 • Degrees of freedom=k-p-1=4-0-1=3 • Compute pi • P1=P(X=0)=[e-01.2 (0.75)0]/0! =0.3012 • Similarly, p2, p3, p4, and p5 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 E2,E3, E4, and E5 are 36.14, 21.69, 8.67, and 2.60, respectively