Docsity

Hypothesis Testing in Statistics - Prof. Saeed Maghsoodloo, Study notes of Probability and Statistics

Toggle sidebar
bg1
Reference: Chapter 8 of J. L. Devore’s 7
th
Edition Maghsoodloo
TESTING A STATISTICAL HYPOTHESIS
A statistical hypothesis is an assumption about the frequency function(s) (i.e.,
PDF or pdf) of one or more random variables. Stated in simpler terms, a statistical
hypothesis is an assumption about the parameter(s) of one or more population(s)
such as µ
µµ
µ
,
σ
σσ
σ
2
, µ
µµ
µ
x
−
−−
− µ
µµ
µ
y
, p, p
1
−
−−
− p
2
and σ
σσ
σ
12
/σ
σσ
σ
22
, etc.
Examples.
(a)
H
0
: µ
µµ
µ = 100, H
1
: µ
µµ
µ ≠
≠≠
≠ 100;
(b)
H
0
: µ
µµ
µ = 5000 psi,
H
1
: µ
µµ
µ > 5000 psi;
(c)
H
0
:
σ
σσ
σ
2
= 0.05, H
1
:
σ
σσ
σ
2
< 0.05;
(d)
H
0
: µ
µµ
µ
x
−
−−
− µ
µµ
µ
y
= 0,
H
1
: µ
µµ
µ
x
−
−−
− µ
µµ
µ
y
≠
≠≠
≠ 0;
(e)
H
0
: σ
σσ
σ
x2
/ σ
σσ
σ
y2
= 1, H
1
: σ
σσ
σ
x2
/ σ
σσ
σ
y2
≠
≠≠
≠ 1;
(f)
H
0
: µ
µµ
µ = 55 dB, H
1
: µ
µµ
µ < 55.
In the above examples, H
0
is called the null hypothesis while H
1
is called the
alternative hypothesis (note that Devore uses the notation H
a
for the alternative
hypothesis but his notation is not as prevalent in Statistical Literature as is H
1
).
Further, the above examples indicate that, just like confidence intervals (CIs), there
are two types of hypotheses: two-sided and one-sided. The alternative H
1
(or H
a
)
always determines whether a hypothesis is one or 2-sided. If the statement under
H
1
involves ≠
≠≠
≠, then the hypothesis is 2-sided; otherwise, the statement under H
1
will
either include < for a left-tailed test, or will include > for a right-tailed test.
Therefore, Examples (a), (d) and (e) above constitute 2-sided hypotheses, while
Example (b) formulates a right-tailed test, and (c) and (f) are left-tailed tests. Finally,
bear in mind that the equality sign "=" generally will be used only in the statement
under H
0
(almost never under H
1
). In the remaining of this chapter, we will study
hypothesis testing about a single normal population parameter such as µ
µµ
µ, σ
σσ
σ
2
,
and p.
Hypothesis testing about parameters of two populations will be discussed in
Chapter 9 of Devore. Just like in the case of CIs (confidence intervals), the
sampling distribution
(SMD)
of the point estimator of the parameter under H
0
must
be used to conduct a parametric test of hypothesis. That is to say, the null
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Hypothesis Testing in Statistics - Prof. Saeed Maghsoodloo and more Study notes Probability and Statistics in PDF only on Docsity!

Reference: Chapter 8 of J. L. Devore’s 7th^ Edition Maghsoodloo

TESTING A STATISTICAL HYPOTHESIS

A statistical hypothesis is an assumption about the frequency function(s) (i.e., PDF or pdf) of one or more random variables. Stated in simpler terms, a statistical hypothesis is an assumption about the parameter(s) of one or more population(s)

such as μμμμ , σσσσ^2 , μμμμ x −−−− μμμμ y, p, p 1 −−−− p 2 and σσσσ 12 / σσσσ 22 , etc.

Examples. (a) H 0 : μμμμ = 100, H 1 : μμμμ ≠≠≠≠ 100; (b) H 0 : μμμμ = 5000 psi,

H 1 : μμμμ > 5000 psi; (c) H 0 : σσσσ^2 = 0.05, H 1 : σσσσ^2 < 0.05; (d) H 0 : μμμμ x −−−− μμμμ y = 0,

H 1 : μμμμ x −−−− μμμμ y ≠≠≠≠ 0; (e) H 0 : σσσσ x^2 / σσσσ y^2 = 1, H 1 : σσσσ x^2 / σσσσ y^2 ≠≠≠≠ 1; (f) H 0 : μμμμ = 55 dB, H 1 : μμμμ < 55.

In the above examples, H 0 is called the null hypothesis while H 1 is called the alternative hypothesis (note that Devore uses the notation Ha for the alternative hypothesis but his notation is not as prevalent in Statistical Literature as is H 1 ). Further, the above examples indicate that, just like confidence intervals (CIs), there are two types of hypotheses: two-sided and one-sided. The alternative H 1 (or Ha) always determines whether a hypothesis is one or 2-sided. If the statement under H 1 involves ≠≠≠≠ , then the hypothesis is 2-sided; otherwise, the statement under H 1 will either include < for a left-tailed test, or will include > for a right-tailed test. Therefore, Examples (a), (d) and (e) above constitute 2-sided hypotheses, while Example (b) formulates a right-tailed test, and (c) and (f) are left-tailed tests. Finally, bear in mind that the equality sign "=" generally will be used only in the statement under H 0 (almost never under H 1 ). In the remaining of this chapter, we will study

hypothesis testing about a single normal population parameter such as μμμμ , σσσσ^2 , and p.

Hypothesis testing about parameters of two populations will be discussed in Chapter 9 of Devore. Just like in the case of CIs (confidence intervals), the

sampling distribution (SMD) of the point estimator of the parameter under H 0 must

be used to conduct a parametric test of hypothesis. That is to say, the null

hypothesis H 0 : μμμμ = μμμμ 0 must be tested using the SMD of the point estimator x when

σσσσ^2 is known. The null hypothesis H 0 : σσσσ = σσσσ 0 must be tested using the SMD of (n

−−−− 1)S^2 / σσσσ^2 , which is χχ χχ (^) n^2 −− −− 1. The null hypothesis H 0 : μμμμ = μμμμ 0 , when σσσσ^2 is unknown, must

be tested using the SMD of ( x −−−− μμμμ ) n/Swhich is that of the Student’s t with νννν = n −−−−

1 degrees of freedom (df). The critical (or rejection) region of a null hypothesis is that part of range space of the test statistic that corresponds to the rejection of H 0. In testing a statistical hypothesis, any one of the following four circumstances may occur.

H 0 is true H 0 is false

Reject H 0

Event ≈≈≈≈ “ Type I Error, or False Positive” Occurrence Pr = αααα = LOS

True Positive (or Sensitivity) →→→→ Correct Decision Occurrence Pr = 1 −−−− ββββ Do not reject H 0 (or Accept H 0 )

True Negative (or Specificity of the test) →→→→ Correct Decision Occurrence Pr = 1 −−−− αααα

Event ≈≈≈≈ “ Type II Error, or False Negative” Occurrence Pr = ββββ

Note that once a decision about H 0 is made based on sample data, then the above 4 circumstances reduce to only two possibilities. For example, if a data set provides sufficient evidence to reject H 0 , then the experimenter has either committed a type I error or has made a correct decision [cells (1, 1) and (1, 2), respectively]. And vice a versa when sample data does not provide sufficient evidence to reject H 0. Further, the Pr of rejecting H 0 given that H 0 is false is called the power of the statistical test (or the sensitivity of the test), which, from cell (1, 2) of the above table, is clearly equal to 1 −−−− ββββ. Finally, the question arises as to when an experimenter should conduct a 2- sided test, and when a one-sided test is warranted? This author recommends a 2-

(or critical) region consists of the interval AI = [1258.2250, ∞∞∞∞ ) = 1258.2250 ≤≤≤≤ x < ∞∞∞∞.

Since x = 1260 falls inside the rejection region AI = 1258.2250 ≤≤≤≤ x < ∞∞∞∞ , the sample

provides sufficient evidence, at the 5% level, to conclude that μμμμ > 1250 psi. The Pr of committing a type I error, αααα , is also called the level of significance (LOS) of the test, or the size of the critical (or rejection) region.

x  H 0

Figure 13. The Sampling Distribution of x assuming that H 0 is true

Exercise 64. For the above example, determine if the sample mean x = 1260 provides sufficient evidence to reject H 0 at the 1% level of significance. ANS: No.

The obvious question is: "Given the result of a sample, what is the smallest LOS at which H 0 can be barely rejected"? For the Example 38, we could reject H 0 at αααα = 0.05 but could not reject H 0 at αααα = 0.01 (from Exercise 64). Further, we can barely reject H 0 at the 2.5% level but not at the 2% LOS. After the test statistic is computed, the smallest LOS at which H 0 can be rejected, denoted by ααααˆ , is also referred to as the probability level (or the P - value ) of the test. That is, the P - value of a statistical test is the smallest LOS at which H 0 can be barely rejected after a random sample has been drawn and the corresponding sample statistic computed.

Therefore, ααααˆ = P( x > 1260) = P(Z > 2) = 0.02275. Note that if H 0 is rejected, then αα ααˆ

25 / n ==== SE(x)

αααα = 0. 1250 Au=1258.

μμ μμ 0 ≡ 1250 psi

is always less than the corresponding pre-assigned value of αααα ; further, the smaller

P-value = ααααˆ is, the stronger the evidence is against the validity of H 0. Before leaving this section, we must state the fact that all CIs are tests of hypotheses in disguise for all possible values of the parameter under H 0. To illustrate this fact, recall the results of Example 36 (pp. 96 – 98 of STAT 3600) where we obtained the 95% lower one-sided CI for the mean breaking strength to be 1251.7750 < μμμμ < ∞∞∞∞. The rejection of our null hypothesis H 0 : μμμμ = 1250 vs H 1 : μμμμ > 1250 at αααα = 0.05 is consistent with the 95% CI 1251.7750 < μμμμ < ∞∞∞∞ because the hypothesized mean value μμμμ 0 ≡≡≡≡ 1250 is outside the 95% CI [1251.7750, ∞∞∞∞ ). Then,

it must be clear by now that the sample mean x = 1260 does not provide sufficient

evidence at (^) αααα = 0.05 to reject H 0 : μμμμ = 1252 vs H 1 : (^) μμμμ > 1252 because μμμμ 0 ≡≡≡≡ 1252 is inside the 95% CI 1251.7750 < (^) μμμμ < ∞∞∞∞.

Note that the upper one-sided 95% CI for μ is given by [ −−−−∞ , x +Z0.05×SE( x )] =

( −−−−∞ , 1268.225), which includes the hypothesized value of 1250 and hence in contradiction to the decision of rejecting H 0 : μμμμ =1250 at the 5% level.

Exercise 65. Determine if the 99% CI of Exercise 55(a) on page 97 of my

STAT3600 notes is consistent with the test result of Exercise 64.

COMPUTING A TYPE II ERROR PROBABILITY ββββ

Since ββββ is the Pr of accepting H 0 if H 0 is false, then when testing H 0 : μμμμ = μμμμ 0 , the Pr statement for ββββ of the Example 38 is given by

ββ ββ = Pr( x falls within the acceptance interval  H 0 is false, i.e., μμμμ > 1250).

To illustrate the computation of ββββ , again consider the Example 38, where H 0 : μμμμ = 1250 and H 1 : μμμμ > 1250 psi. Suppose the true mean value is μμμμ = 1255, i.e., H 0 is now false. Then, what is the Pr of accepting H 0 : μμμμ = 1250 with a random sample of size 25 before the sample is drawn given that the population mean μμμμ = 1255 ≠≠≠≠ μμμμ 0? The

SMD of x given that H 1 is true (or H 0 is false, i.e., μμμμ ≠≠≠≠ 1250) is depicted in Figure 14

tests, ββββ = 1 −−−− αααα at μμμμ = μμμμ 0 , but for right-tailed tests, ββββ > 1 −−−− αααα if μμμμ < μμμμ 0 , and for a left- tailed test ββββ > 1 −−−− αααα if μμμμ > μμμμ 0.

Exercise 66. (a) For the null hypothesis H 0 : μμμμ = 1250 of the above

Example 38, draw the OC curve by computing and tabulating the values of ββββ

at μμμμ = 1245, 1250, 1253, 1258.225, 1260, 1263, and 1265. (b) Repeat

part (a) using a LOS αααα = 0.01.

It must be clear by now that if H 0 is 2-sided, then the critical region of the test is divided equally at the left and right tails of the distribution of the test statistic, and

for a left-tailed test the entire value of αααα is placed on the distribution's left tail and

vice a versa for a right-tailed test. Further, always bear in mind that (^) ββββ gives the Pr

over the AI while αααα = Pr( AI ), and almost for all statistical tests 1 −−−− ββββ ≥≥≥≥ αααα. A test for

which 1 −−−− ββββ ≥≥≥≥ αααα is said to be unbiased, and a statistical test for which the value of 1 −−−− ββββ →→→→ 1 as n →→→→ (^) ∞∞∞∞ is said to be consistent

Exercise 67. (a) Work Exercises 8-10, 8-12 (pp. 293-4), 8-18, 8-19 , 8-20,

and 8-25 on pp. 304-5 of the 7th^ edition of Devore. (b) For the Exercise 8-10(d),

derive the minimum value of n if αααα = 0.05 and ββββ = 0.01 at μμμμ = 1350. Compute the critical levels, or P-values , of your tests in all cases.

TEST OF HYPOTHESIS ABOUT THE MEAN OF A NORMAL

UNIVERSE WITH UNKNOWN VARIANCE σσσσ^2

Since the population variance σσσσ^2 is unknown, then we may obtain a point

unbiased estimator of σσσσ^2 using the sample statistic S^2. Clearly, ( x −−−− μμμμ )/ σσσσ x=

(x − μ− μ− μ− μ ) n / σσσσ has a standardized normal distribution, but σσσσ is unknown and has to

be estimated by S. However, (x − μ− μ− μ− μ ) n /S is not normally distributed but its

sampling distribution follows that of the Student’s-t with (n −−−− 1) df. We illustrate the

procedure for testing H 0 : μμμμ = μμμμ 0 at a LOS αααα thru the following example.

Example 39. A manufacturer claims that the loudness of its compressors

is on the average less than 50 decibels. A random sample of n = 14 compressors has noise levels 53, 48, 49, 57, 45, 46, 54, 47, 49, 50, 48, 44, 46, 51 dB. Our objective is to test H 0 : μμμμ = 50, at αααα = 0.05, versus the alternative H 1 : μμμμ < 50 dB putting the burden of proof on the manufacturer. Note that a claim by a manufacturer should generally be placed under H 1. Since this is a left-tailed test, the rejection region of the test statistic

(x − μ) n /S is AI = ( −−−− ∞∞∞∞ , t0.95; 13) = ( −−−− ∞∞∞∞ , −−−− 1.771). This test is left-tailed because

smaller x values (relative to 50 dB), which in turn lead to smaller values of

(x − μ) n /S, will reject H 0 in favor of H 1 : μμμμ < 50. For our sample of 14 observations

we have x = 49.07143, Sx = 3.66825 and se ( x ) = Sx / 14 = 0.9804 so that the value

of our test statistic t 0 = ( x −−−− 50)/ se ( x ) = (49.07143 −−−− 50)/0.9804 = −−−− 0.9472. Since

t0.95(13) = −−−− 1.771 < t 0 , we do not quite have sufficient evidence to reject H 0 at the 5%

LOS. AS expected, the critical level αα αα ˆ = Pr(T 13 < −−−− 0.9472) = 0.1804 far exceeds the

pre-assigned LOS αααα = 0.05 because the sample did not provide sufficient evidence to reject H 0. Now suppose the true mean noise level of the manufacturer's compressors is

μμμμ = 48.5 dB. What is the Pr of rejecting H 0 : μμμμ = 50 before the random sample of size

n = 14 is drawn, assuming that the true mean μμμμ = 48.5 dB. The OC curves in Table

A.17, page 690, graph the values of ββββ vs the abscissa d = ( μ − μμ − μμ − μμ − μ 0 ) / σσσσ ≅≅≅≅ ( μ − μμ − μμ − μμ − μ 0 ) / S.

Since d = 48.5 −−−− 50 /3.66825 ≅≅≅≅ 0.41, then ββββ ≅≅≅≅ 0.57 so that the Pr of rejecting H 0 : μμμμ = 50

is approximately 1 −−−− ββββ = 0.43, i.e., the power of the test at μμμμ = 48.5 is roughly 43%. The exact value of 1 −−−− ββββ from Minitab is 0.4228 (Open Minitab →→→→ STAT →→→→ Power and Sample Size →→→→ 1-sample t, in the Dialogue Box insert 14 for sample sizes,

71.42) as depicted in Figure 15 below. The value of our test statistic is χχχχ^20 =

50(0.31)^2 / 0.25^2 = 76.88, which is outside the AI = (32.36, 71.42) and hence we have

sufficient evidence to reject H 0 in favor of H 1 : σσσσ ≠≠≠≠ 0.25. Since the test is 2-tailed, the

critical level of the test is αααα ˆ = P - value = 2 ×××× Pr( χχ χχ^250 > 76.88) = 2(0.0086273) =

(n −−−− 1)S^2 / σσσσ 02

Figure 15. The Sampling Distribution of (n −−−− 1)S^2 / σσσσ^20 under H 0

0.017255, which as expected, is less than the prescribed LOS (^) αααα = 0.05. Although, S is not a linear sum of independent rvs, yet its SMD very slowly

approaches the N( σσσσ , σσσσ^2 /2n) pdf as n →→→→ ∞∞∞∞ as depicted in Figure 16. For practical

applications the normal approximation is fairly accurate for n > 60. From Figure 16,

αα αα^ ˆ ≅≅≅≅ 2 ×××× Pr(S > 0.31) = 2Pr(Z > 2.424) = 2 ×××× Φ ( −−−− 2.424) = 0.01536 as compared to the

exact value 0.017255. Observe that even a sample of size n = 51 is not sufficiently large for an adequate normal approximation.

We now use the above example to illustrate the computation of ββββ when H 0 is

false. To this end, assume that the true value of σσσσ = 0.30. Then

0.

0.

32.36 71.

50 f( χχχχ 2 )

AI = (32.36, 71.42)

ββββ (at σσσσ = 0.30) = Pr( χχχχ^20 is inside the AI  H 0 is false)

= Pr(32.36 ≤≤≤≤ (n −−−− 1)S^2 / σσσσ^20 ≤≤≤≤ 71.42 σσσσ = 0.30)

= Pr(32.36 (^2) 02

σσσσ ≤≤≤≤ (n −−−− 1)S 2 / σσσσ 2 ≤≤≤≤ 71.42^20

σσ^ σσ^

σσσσ = 0.30)

ββββ (at σσσσ = 0.30) = Pr(32.36 ×××× 0. 69444 ≤≤≤≤ χχχχ^250 ≤≤≤≤ 49.59722)

S  H 0

= Pr( 22.47222 ≤≤≤≤ χχχχ^250 ≤≤≤≤ 49.59722)

= The cdf of χχχχ^250 at 49.59722 −−−− the cdf of χχ χχ^250 at 22.

The above exact Pr of type II error could also be approximated from the OC curves if Devore had provided them. The abscissa of such OC curves would be

λλλλ = σσσσ / σσσσ 0 = 0.30 / 0.25 = 1.20. I used chart (i) on page A-16 of Montgomery and

Runger (1994, Applied Statistics and Probability For Engineers ) to obtain the approximate ordinate value of ββββ ≅≅≅≅ 0.50. As far as I have been able to ascertain, Minitab does not provide power values for a χχχχ^2 test either. Therefore, Excel has to

αααα^ ˆ^ / 2

Figure 16. The Approximate SMD of S

which as expected, far exceeds the pre-assigned LOS of 5%. The 95% CI for p is given by 0 ≤≤≤≤ p ≤≤≤≤ 0.5420, which clearly agrees with the above test result because the hypothesized value of p, p 0 ≡≡≡≡ 0.50, is well inside this CI = 0 ≤≤≤≤ p ≤≤≤≤ 0.5420.

pˆ

If the normal approximation to the binomial is not adequate, then the binomial test on a population proportion must be conducted using the Bin(n, p) distribution directly. To illustrate, I will compute the exact critical level of the test for the Example 8.11 of J. L. Devore’s 5th^ edition.

The procedure consists of using MS Excel to compute αααα ˆ^ from

αα αα^ ˆ = 102 x

47 x 0

102 C^ x(^0.^50 )x(^0.^50 ) −−−−

====

∑∑∑∑ = BINOMDIST(47, 102, 0.50, True)

= 0.24417232 = binocdf(47, 102, 0.50)

Note that the approximate value of αααα ˆ^ = P-value = 0.21412 from the normal

approximation is fairly inadequate because the correction for continuity of 1/(2n)

was not applied to obtain αααα ˆ = 0.21412. If we apply the correction for continuity in the

normal approximation to the binomial, we will obtain

αα^ αα^ ˆ^ ≅≅≅≅^ Pr(^ pˆ^ ≤≤≤≤^ 0.46078 + 1/204 ) = Pr(^ pˆ^ ≤≤≤≤^ 0.4657) = Pr(Z^ ≤≤≤≤^ −−−−^ 0.6931)

Figure 17. The Approximate SMD of pˆ

se ( pˆ^  p =0.5) = 0.

0. AL= 0.

= ΦΦΦΦ ( −−−− 0.6931) = 0.24412, which is almost identical to the exact value of 0.24417. Therefore, if n < 50, use the exact procedure for the binomial test of

proportion by computing the exact from MS Excel and compare αα αα ˆ against

αααα = 0.05. If αααα ˆ < 0.05, then reject H 0 : p = p 0 ; otherwise, the data does not cast

sufficient doubt about the validity of H 0.

Exercise 70. Work exercises 35, 36, 37 on p. 310 of the 7th^ edition of

Devore and exercises 71 & 79 on page 322-3 of Devore.

Computing Type II Error Pr when H 0 : p = p 0 is false

Suppose in the Example, where X represented the number of doctors who knew the generic name for Methdone, the true value of p were equal to 0.40. Then,

ββββ = Pr (0.4186 ≤≤≤≤ pˆ < 1 |||| p = 0.40) = Pr( 0.4186 0.0485^^ −−−−^ 0.40 ≤≤≤≤ Z ) = Pr(Z ≥≥≥≥ 0.3834 ) =

ΦΦΦΦ ( −−−− 0.3834) = 0.3507. Note that 0.0485 = 0.4(0.6) / 102 = se ( ˆp p = 0.40 ) and that the

power of the test at p = 0.40 is given by 1 −−−− ββββ = 0.6493.

Test 1

p^ ˆ

AL = 0.

ββββ