Chapter 7
Hypothesis testing

7.1 Hypothesis testing: One population

A sizable volume of scientific efforts involve questions on a given population parameter. While we estimate/calculate an interval to contain an unknown population parameter with a probability of (1− α) 100% under the heading of Confidence interval estimation, here in Hypothesis testing, we question the viability of a given value as the value of our unknown population parameter.

So, what we do is to check for the validity of a claim about an unknown, in formal terms.

A statistical hypothesis is a statement about the numerical value of a parameter. The null hypothesis, denoted H0, represents the hypothesis that is assumed to be true unless the data provide convincing counter evidence. This usually represents the status quo or some claim about the parameter that the researcher states.

The alternative hypothesis, denoted H1, represents the hypothesis that will be maintained only if the data provide convincing evidence for its truth.

The test statistic is a sample statistic, computed from information provided in the sample, that the researcher uses to decide between the null and alternative hypotheses.

A Type I error occurs if the researcher rejects the null hypothesis in favor of the alternative hypothesis when, in fact, the null hypothesis is true. The probability of Type I error is denoted as α.

The rejection region of a statistical test is the set of possible values of the test statistic for which the researcher will reject the null hypothesis in favor of the alternative.

A Type II error occurs if the researcher fails to reject the null hypothesis when, in fact, the null hypothesis is false. The probability of Type II error is denoted as β.

0Checkpoint
No: 76

A step-by- step description of Hypothesis testing:

1. Establish H0 and H1

2. Determine test statistic (test score) and its statistical distribution
3I.n Sae ntu αtshell

4. Experiment/collect data and calculate test statistic

5. If the value of the test statistic falls in the rejection region conclude
   Reject H0, otherwise conclude Fail to reject H0

0Checkpoint
No: 77

Two  deadly sins of Hypothesis testing:

1. Never say Accept H 0 instead of Fail to reject H 0. When H1 is not
   supported enough by the data, say:

   ∙ Fail to reject H 0

   ∙ Insufficient evidence to reject H 0

2. Never include H 1 in your concluding statement. Don ’t try to be
   creative when writing/speaking technical statments as such. Keep
In yao nuurt asphpeeltlite for the interpretation and discussion of findings.

Some  perspective:
Note that confidence intervals are the back side of the coin for hy-
pothesis tests. In testing H 0 : μ = 2 versus H 1 : μ ⁄= 2, if μ = 2
lies in a 95%  con fidence interval, then we cannot reject Ho : μ = 2

at α =  0.05; otherwise we reject H 0. This highlights the fact that any
value of μ that lies in this 95% confidence interval (assuming it was
our null hypothesis) cannot be rejected at the 5% significance level by
this sample. This is why we do not say ’accept H0 ’, but we rather say
’do not reject H 0’.

0 Checkpoint
No: 78

7.1 EXERCISES ___________________________________________________________     

1. 

For each of the situations below write the null and alternative hypotheses, corresponding to the test, in plain English; then write the null and alternative hypotheses using only mathematical symbols; then state what the symbols you used above represents:

i. We would like to test if the income share held by the highest earning 20% is less than 46%.

ii. We would like to test if the average income of males is greater than the average income of females.

iii. It is claimed that, among the people who drinks at least 2 liters of water every day, the percentage of those with a kidney problem is less than 5%. We suspect the truth of this statement and would like to test it.

iv. We would like to test if a coin is fair.

v. We would like to test if a coin is not a fair coin.

Solution: This exercise is left as self-study.

7.1.1 Hypothesis testing
Mean of a normal population
Case: Known population variance

Consider:

H0 : μ μ0
H1 : μ > μ0

and {xi}i=1n, a random sample of n observations from a normal population N(μ,σ2) with known σ2.

At the statistical significance level α:

7.2 EXERCISES ___________________________________________________________     

1. 

A researcher wonders if the mean wage rate of workers in Ankara is greater than 6500. The population variance is known to be 1000000. The researcher measures the mean wage rate of a sample of 64 workers as 7000. Conduct and conclude the relevant hypothesis testate the significance level of 5%.

Solution:

H0 : μ 6500
H1 : μ > 6500

The relevant distribution is z.

Since:

7000-−-6500 = 4.00 > 1.65
    1√00604

we reject H0 at α = 0.05.

For:

H0 : μ μ0
H1 : μ < μ0

At the statistical significance level α:

7.3 EXERCISES ___________________________________________________________     

1. 

A researcher wonders if the mean wage rate of workers in Ankara is less than 7500. The population variance is known to be 1000000. The researcher measures the mean wage rate of a sample of 64 workers as 7000. Conduct and conclude the relevant hypothesis testate the significance level of 5%.

Solution:

H0 : μ 7500
H1 : μ < 7500

The relevant distribution is z.

Since:

7000−-7500 = −4.00 < − 1.65
   1√00604

we reject H0 at α = 0.05.

For:

H0 : μ = μ0
H1 : μ≠μ0

At the statistical significance level α:

7.4 EXERCISES ___________________________________________________________     

1. 

A researcher wonders if the mean wage rate of workers in Ankara is different than 7500. The population variance is known to be 1000000. The researcher measures the mean wage rate of a sample of 64 workers as 7000. Conduct and conclude the relevant hypothesis testate the significance level of 5%.

Solution:

H0 : μ = 7500
H1 : μ≠7500

The relevant distribution is z.

Since:

7000− 7500
---1√000--- = −4.00 is outside of [−1.96,1.96]
     64

we reject H0 at α = 0.05.

7.1.2 Hypothesis testing
Mean of a normal population
Case: Unknown population variance

Consider:

H0 : μ μ0
H1 : μ > μ0

and {xi}i=1n, a random sample of n observations from a normal population N(μ,σ2) where σ2 is unkown.

At the statistical significance level α:

7.5 EXERCISES ___________________________________________________________     

1. 

A researcher wonders if the mean wage rate of workers in Ankara is greater than 6500 , for which the population variance is unknown. The researcher measures the mean wage rate of a sample of 64 workers as 7000 and the ’sample variance’ as 640000. Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : μ 6500
H1 : μ > 6500

The relevant distribution is t and the degrees of freedom is 63.

Since:

7000−-6500
    8√00-    = 5.00 > 1.669
     64

we reject H0 at α = 0.05.

For:

H0 : μ μ0
H1 : μ < μ0

At the statistical significance level α:

7.6 EXERCISES ___________________________________________________________     

1. 

A researcher wonders if the mean wage rate of workers in Ankara is less than 7500 , for which the population variance is unknown. The researcher measures the mean wage rate of a sample of 64 workers as 7000 and the ’sample variance’ as 640000. Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : μ 7500
H1 : μ < 7500

The relevant distribution is t and the degrees of freedom is 63.

Since:

7000-−-7500
    8√00    = − 5.00 < −1.669
     64

we reject H0 at α = 0.05.

For:

H0 : μ = μ0
H1 : μ≠μ0

At the statistical significance level α:

7.7 EXERCISES ___________________________________________________________     

1. 

A researcher wonders if the mean wage rate of workers in Ankara is different than 7500 , for which the population variance is unknown. The researcher measures the mean wage rate of a sample of 64 workers as 7000 and the ’sample variance’ as 640000. Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : μ = 7500
H1 : μ≠7500

The relevant distribution is t and the degrees of freedom is 63.

Since:

7000−-7500 = −5.00 is outside of [−1.998,1.998]
   √80064-

we reject H0 at α = 0.05.

0Checkpoint
No: 79

7.1.3 Hypothesis testing
Population proportion

Consider:

H0 : P P0
H1 : P > P0

and {xi}i=1n, a random sample of n observations from a Bernoulli(P) population.

At the statistical significance level α:

7.8 EXERCISES ___________________________________________________________     

1. 

A political candidate wonders if her nationwide support rate exceeds 50%. Among a sample of 64 people, we know 35 support the political candidate. Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : P 0.50
H1 : P > 0.50

The relevant distribution is z.

Since:

∘0.547−-0.500--= 0.750 is not greater than 1.65
  0.500(1−0.500)
      64

we fail to reject H0 at α = 0.05.

For:

H0 : P P0
H1 : P < P0

At the statistical significance level α:

7.9 EXERCISES ___________________________________________________________     

1. 

A political candidate wonders if her nationwide support rate falls short of 50%. Among a sample of 64 people, we know 30 support the political candidate. Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : P 0.50
H1 : P < 0.50

The relevant distribution is z.

Since:

0∘.469−-0.500--= −0.500 is not less than− 1.65
  0.500(1−640.500)

we fail to reject H0 at α = 0.05.

For:

H0 : P = P0
H1 : P≠P0

At the statistical significance level α:

7.10 EXERCISES ___________________________________________________________     

1. 

A political candidate wonders if her nationwide support rate is different than 50%. Among a sample of 64 people, we know 35 support the political candidate. Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : P = 0.50
H1 : P≠0.50

The relevant distribution is z.

Since:

0∘.469−-0.500--= −0.500 is not outside [−1.96,1.96]
  0.500(1−-0.500)
      64

we fail to reject H0 at α = 0.05.

0Checkpoint
No: 80

7.1.4 Hypothesis testing
Variance of a normal population

Consider:

H0 : σ2 σ02
H1 : σ2 > σ02

and {xi}i=1n, a random sample of n observations from a normal population N(    )
 μ,σ2.

At the statistical significance level α:

7.11 EXERCISES ___________________________________________________________     

1. 

A process engineer is concerned with the variation of - temperature in an industrial furnace and wonders if it exceeds 1500. She collects a random sample of temperatures as:

   975  1075  1050   900
  1000   950  1025  1050
975∘C

Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : σ2 1500
H1 : σ2 > 1500

The relevant distribution is χ2 and the degrees of freedom is 8.
Since:

9 − 1 3125
(----)----= 16.667 > 15.507
   1500

we reject H0 at α = 0.05.

For:

H0 : σ2 σ02
H1 : σ2 < σ02

At the statistical significance level α:

7.12 EXERCISES ___________________________________________________________     

1. 

A process engineer is concerned with the variation of - temperature in an industrial furnace and wonders if it is less than 2500. She collects a random sample of temperatures as:

   975  1075  1050   900
  1000   950  1025  1050
975∘C

Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : σ2 2500
H1 : σ2 < 2500

The relevant distribution is χ2 and the degrees of freedom is 8.

Since:

(9 − 1)3125
----2500--- = 10.000 is not less than 2.733

we fail to reject H0 at α = 0.05.

For:

H0 : σ2 = σ02
H1 : σ2≠σ02

At the statistical significance level α:

7.13 EXERCISES ___________________________________________________________     

1. 

A process engineer is concerned with the variation of - temperature in an industrial furnace and wonders if it is different than 2000. She collects a random sample of temperatures as:

   975  1075  1050   900
  1000   950  1025  1050
975∘C

Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : σ2 = 2000
H1 : σ22000

The relevant distribution is χ2 and the degrees of freedom is 8.

Since:

(9-−-1)-3125
    2000    = 12.500 is not outside [2.180,17.535]

we fail to reject H0 at α = 0.05.

7.14 EXERCISES ___________________________________________________________     

1. 

A manufacturer of automobile batteries claim that at least 80% of the batteries that it produces will last 36 months. A consumers’ advocate group wants to evaluate this longevity claim and selects a random sample of 28 batteries to test. The following data indicate the length of time (in months) that each of these batteries lasted (i. e., performed properly before failure):

42.3, 39.6, 25.0, 56.2, 37.2, 47.4, 57.5, 39.3, 39.2, 47.0, 47.4, 39.7, 57.3, 51.8, 31.6, 45.1, 40.8, 42.4, 38.9, 42.9, 34.1, 49.0, 41.5, 60.1, 34.6, 50.4, 30.7, 44.1

Now, we would like to test, at a significance level of 0.05, if there is a significant evidence that less than 80% of the batteries will last at least 36 months? Conduct and conclude the test.

Solution: The critical element of solution is that what we are testing here is not the mean product life, rather it is the proportion of items that last at least 36 months. So, begin by counting the product lifetimes (among the given 28 measurements), calculate ̂p and proceed straightforwardly with the rest. 8402 This exercise is left as self-study.

2. 

Right after the poll stations are closed at 17:00, a political candidate receives the information that out of the 50 people interviewed her approval "count" is 24. As a statistics lover, she immediately tests the null hypothesis that her population approval rate is less than or equal 0.50 against its respective alternative, at the 5% level of statistical significance. What is the conclusion of this test? Suppose in every consecutive 15 minutes, number of people interviewed increases by 5 and approval count increases by 4. Find the earliest time, HH:MM, that she can declare her victory based on her tests of hypotheses. Note that a formal statistical/algebraic solution is expected with proper terminology and notation.

Solution: This exercise is left as self-study.

7.2 Hypothesis testing: Two populations

In this part, you are more than welcome to transfer your earlier, indeed recently acquired, knowledge to understand things better. Except for one case or two, the material remains fairly intact compared to the ones in confidence intervals for two populations.

0Checkpoint
No: 81

7.2.1 Hypothesis testing
Difference between two normal population means
Case: Dependent (matched) samples

Consider:

H0 : μx μy 0
H1 : μx μy > 0

Let {x}
  ii=1n and {y}
  ii=1n, be two matched samples.

At the statistical significance level α:

For:

H0 : μx μy 0
H1 : μx μy < 0

At the statistical significance level α:

For:

H0 : μx μy = 0
H1 : μx μy0

At the statistical significance level α:

7.15 EXERCISES ___________________________________________________________     

1. 

A company is about to release a new drug to assist weight loss, and we are in charge of assessing how effective the drug is. We pick a random sample of 8 people with the following pre-drug body weights:

90,95,105,95,110,85,100,90

After using the drug for the designated test duration, the post-drug body weights are measured as:

85,80,110,90,110,80,95,90

Conduct and conclude a hypothesis test at the significance level of 5% to assess if ’pre-drug minus post-drug difference of mean body weights is positive’.

Solution:

H0 : μx μy 0
H1 : μx μy > 0

The difference series (pre-drug minus post-drug) is:

+5,+ 15,− 5,+5,0,+5,+ 5,0

The relevant distribution is t and the degrees of freedom is 7.

Since:

 3.75
-5.√825-= 1.821 is not greater than > 1.895
  8

we fail to reject H0 at α = 0.05.

7.2.2 Hypothesis testing
Difference between two normal population means
Case: Independent samples & Known population variances

Consider:

H0 : μx μy 0
H1 : μx μy > 0

Let,

{xi}i=1nx {xi}i=1Nx N(    2)
 μx,σx {yi}i=1ny {yi}i=1Ny N(     )
 μy,σ2y

where σx2 and σy2 are known.

At the statistical significance level α:

For:

H0 : μx μy 0
H1 : μx μy < 0

At the statistical significance level α:

For:

H0 : μx μy = 0
H1 : μx μy0

At the statistical significance level α:

7.16 EXERCISES ___________________________________________________________     

1. 

A researcher wonders if the mean wage of workers in Ankara falls short of that in Istanbul. She has the following data and information: Mean wage rate of 49 workers from Ankara is 6000. Mean wage rate of 81 workers from Istanbul is 7000. Population variance of wages in Ankara and Istanbul are known to be 640000 and 810000, respectively. Conduct and conclude a hypothesis test at the significance level of 5% to assess if mean wage rate in Ankara is less than the mean wage rate in Istanbul.

Solution:

H0 : μx μy 0
H1 : μx μy < 0

The relevant distribution is z.

Since:

--6000-−-7000--
∘ -640000-  810000-= − 6.585 < −1.65
    49  +  81

we reject H0 at α = 0.05.

7.2.3 Hypothesis testing
Difference between two normal population means
Case: Independent samples & Unknown yet equal population variances

Consider:

H0 : μx μy 0
H1 : μx μy > 0

Let,

{xi}i=1nx {xi}i=1Nx N(    2)
 μx,σx {yi}i=1ny {yi}i=1Ny N(     )
 μy,σ2y

where σx2 and σy2 are unkown but assumed to be equal.

At the statistical significance level α:

In our formulation:

             2  (     ) 2
s2p = (nx-−-1)sx+-ny−-1-sy
          nx+ ny −2

and,

 2   ∑nix=1(xi−-¯x)2
sx =    nx− 1

      ny
 2   ∑i=1(yi−-¯y)2
sy =    ny− 1

For:

H0 : μx μy 0
H1 : μx μy < 0

At the statistical significance level α:

For:

H0 : μx μy = 0
H1 : μx μy0

At the statistical significance level α:

7.17 EXERCISES ___________________________________________________________     

1. 

A researcher wonders if the mean wage of workers in Ankara falls short of that in Istanbul. She has the following data and information: Mean wage rate of 49 workers from Ankara is 6000. Mean wage rate of 81 workers from Istanbul is 7000. Population variances of wages in Ankara and Istanbul are unknown but they are assumed to be equal. Sample variance of wages in Ankara and Istanbul are calculated as 490000 and 640000, respectively. Conduct and conclude a hypothesis test at the significance level of 5% to assess if mean wage rate in Ankara is less than the mean wage rate in Istanbul.

Solution:

H0 : μx μy 0
H1 : μx μy > 0

s2p = (49-−-1)490000+-(81−-1)640000-
              49+ 81− 2

The relevant distribution is t and the degrees of freedom is 128.

Since:

  6000− 7000
∘------------- = −7.232 < − 1.657
  58374950+ 58378150

we reject H0 at α = 0.05.

7.2.4 Hypothesis testing
Difference between two normal population means
Case: Independent samples & Unknown and unequal population variances

Consider:

H0 : μx μy 0
H1 : μx μy > 0

Let,

{xi}i=1nx {xi}i=1Nx N(    )
 μx,σx2 {yi}i=1ny {yi}i=1Ny N(     )
 μy,σ2y

where σx2 and σy2 are unkown and assumed not to be equal.

At the statistical significance level α:

In our formulation:

    (( s2)   ( s2) )2
      nxx  +  nyy
ν = -(--)2---(-2)2--
      ns2xx      snyy
     -nx−-1 + ny−1-

Notice that, if nx = ny = n

    (          )
    |      2   |
ν = (1 + s2--s2y) (n− 1)
         sx2y + s2x

For:

H0 : μx μy 0
H1 : μx μy < 0

At the statistical significance level α:

For:

H0 : μx μy = 0
H1 : μx μy0

At the statistical significance level α:

7.18 EXERCISES ___________________________________________________________     

1. 

A researcher wonders if the mean wage of workers in Ankara falls short of that in Istanbul. She has the following data and information: Mean wage rate of 49 workers from Ankara is 6000. Mean wage rate of 81 workers from Istanbul is 7000. Population variances of wages in Ankara and Istanbul are unknown and they are assumed to be unequal. Sample variance of wages in Ankara and Istanbul are calculated as 490000 and 640000, respectively. Conduct and conclude a hypothesis test at the significance level of 5% to assess if mean wage rate in Ankara is less than the mean wage rate in Istanbul.

Solution:

H0 : μx μy 0
H1 : μx μy > 0

The relevant distribution is t and the degrees of freedom is ν:

    ( (     )  (     ))2
       49040900 +  64080010
ν = ----4900002----6400002-- →  112
       (4499−)1-+  (8811−)1--

Since:

  6000− 7000
∘------------- = −7.474 < − 1.659
  49004900+ 64008100

we reject H0 at α = 0.05.

0Checkpoint
No: 82

7.2.5 Hypothesis testing
Difference between two population proportions

Consider:

H0 : Px Py 0
H1 : Px Py > 0

Let

{xi}i=1nx {xi}i=1nX Bernoulli(Px)
{y}
  ii=1ny {y}
  ii=1nY Bernoulli(P )
  y

At the statistical significance level α:

In our formulation:

     n ̂p + n ̂p
̂p0 = -x-x---y-y-
       nx+ ny

For:

H0 : Px Py 0
H1 : Px Py < 0

At the statistical significance level α:

For:

H0 : Px Py = 0
H1 : Px Py0

At the statistical significance level α:

7.19 EXERCISES ___________________________________________________________     

1. 

A political candidate wonders if her support rate in Ankara exceeds that in Istanbul. We know that among 64 people from Ankara 35 supports the candidate and among 81 people from Istanbul 45 supports the candidate. Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : Px Py < 0
H1 : Px Py 0

    64-⋅0.547+-81⋅0.556
̂p0 =      64+ 81      →  0.552

The relevant distribution is z.

Since:

       0.547 − 0.556
∘------------------------ is not greater than 1.65
  0.552(16−40.552) + 0.552(1−810.552)

we fail to reject H0 at α = 0.05.

0 Checkpoint
No: 83

7.2.6 Hypothesis testing
Equality of variances of two normal populations

Consider:

H0 : σx2 σy2
H1 : σx2 > σy2

Let

{xi}i=1nx {xi}i=1Nx N(    2)
 μx,σx {yi}i=1ny {yi}i=1Ny N(     )
 μy,σ2y

At the statistical significance level α:

Go over the description of F-distribution in Chapter 10.

In our formulation:

 2   ∑nix=1(xi−-¯x)2
sx =    nx− 1

      ny        2
s2=  ∑i=1(yi−-¯y)-
 y      ny− 1

For:

H0 : σx2 σy2
H1 : σx2 < σy2

At the statistical significance level α:

For:

H0 : σx2 = σy2
H1 : σx2≠σy2

At the statistical significance level α:

7.20 EXERCISES ___________________________________________________________     

1. 

A process engineer wonders if the temperature variation in Furnace X exceeds that in Furnace Y. Sample variance of temperatures in Furnace X is 1600 on the basis of 10 temperature readings and sample variance of temperatures in Furnace Y is 1100 on the basis of 8 temperature readings. Conduct and conclude the relevant hypothesis test at the significance level of 5%.

Solution:

H0 : σx2 < σy2
H1 : σx2 σy2

The relevant distribution is F with a numerator degrees of freedom of 9 and a denominator degrees of freedom of 7.

Since:

1600-= 1.455 is not greater than 3.677
1100

we fail to reject H0 at α = 0.05.

0Go to Teaching page & experiment with F(ν1,ν2) using the file named ‘Statistical distributions.xlsx’.

7.21 EXERCISES ___________________________________________________________     

1. 

Consider the hypotheses regarding two normal populations X and Y:

H0 : σx2 σy2 H1 : σx2 > σy2

Sample values for X and Y are given as follows:

X:2 8 5 4 3 7 96
Y: 262423252227

Conduct and conclude the test at α = 0.05. Clearly state the test statistic, the distribution of test statistic and critical value(s). Find the necessary critical values from the end of your textbook or from Internet sources.

Solution: This exercise is left as self-study.

2. 

Consider two populations X and Y for which a researcher has estimated the following confidence intervals given that x = 150 and ȳ = 250.

P (μx ∈ [100,∞ )) = 0.90

P (μ ∈ [−∞ ,400)) = 0.95
    y

In her research report, the researcher noted that she used an N(0,1) distribution in her calculations. Based on these, calculate a 90% confidence interval for μx μy

Solution: This exercise requires some little portion of creative thinking. As the researcher has wed the standard normal distribution in her calculations, this means σx2 and σy2 are both known (or given). As the given confidence intervals ’for μx and μy are one-sided, the critical values are 1.29 and 1.65, respectively. So,

1501−.21900= √σnxx-
400−250= √σy-
 1.65      ny

Once these are known, estimation of a 90% C.I. for μx μy is straightforward.

0Checkpoint
No: 84

7.3 p-value

p-value is defined as the tail probability of a test statistic. While conducting hypothesis tests manually, i.e. with a pencil on paper, use of a p-value is not essential, since calculation of p-value already requires a calculated test statistic. In some cases, we may need to do so, though. A p-value is especially practical when we do our analysis on a computer using a dedicated software. The rule is simple:

H0 is rejected if pvalue < α

To calculate the p-value of a test statistic:

1. Look at H1 to see the rejection side & calculate the test statistic

2I.n Caa nlucutlsahteel tlhe tail probability according to the distribution of the
   test statistic. If the rejection side is the right tail, calculate the right
   tail probability. If the rejection side is the left tail, calculate the left
   tail probability. If the rejection side is both the right and left tails,
   calculate the tail probability at either side; multiply the result by 2

A course-related/pedagogical warning about the p-value is that, my expectation (from students) is to see the proper use of ’test score vs critical value’ comparisons in concluding hypothesis tests rather than pvalue vs α’ comparisons, unless otherwise stated. In your future/professional practice you will have full freedom to enjoy pvalues.

0Checkpoint
No: 85

tfptc(t)

7.4 Type I and Type II errors and the Power of a hypothesis test

Despite Power is not a difficult concept to grasp intuitively, its mathematics is often confusing to students. Patiently go over the following:

As you may recall, a Type I error occurs if the researcher rejects the null hypothesis in favor of the alternative hypothesis when, in fact, the null hypothesis is true. The probability of Type I error is denoted as α. A Type II error, on the other hand, occurs if the researcher fails to reject the null hypothesis when, in fact, the null hypothesis is false. The probability of Type II error is denoted as β. So,

      P (Reject H 0 | H 0 true) = α
 P (Fail to reject H 0 | H 0 true) = 1− α

P (Fail to reject H0 | H0 false) = β

Power  = 1− β = P (Fail to reject H | H false)
                               0   0
              = P (Reject H 0 | H 0 false)

So, in plain language, Power is the ability of a test to avoid a false null hypothesis.

(As a caution, note that there is no requirement of any sort like α + β = 1)

tffβαFRtcu((AEtttIJ|H|HLEC01TT))O RCERJIETCICTAL REGION

To calculate the Power of a test:

1. Determine the rejection condition and area in terms of the null
   distribution

2. Express the rejection condition in terms of the parameter con -
   cerned in the your hypotheses
In a nutshell
3. Determine the alternative distribution by picking a value for the
   parameter concerned, in line with the alternative hypothesis

4. Calculate the probability of the rejection area according to the al-
   ternative distribution

5. Now, you have the Power.

As you may pick infinitely many alternative values for your parameter of interest, there is a multiplicity of values for Power. So, Power, is indeed a function. We often write it as a function of the difference between the alternative and hypothesized parameter values.

Ceteris Paribus in each case:

∙  If μ1− μ0 increases, Power increases

∙  If α decreases, Power decreases
In a nu2tshell
∙  If σ increases, Power decreases

∙  If n increases, Power increases
∙  Fun fact: Power is 0.50 at the critical value

As a closing remark, drawing graphs (rather than calculating) may be very useful to understand the Type II error as well as Power.

The Neyman  -Pearson theory [Optional material]: The classical the-
ory of hypothesis testing, known as the Neyman -Pearson theory, fixes
α  =   P(Type I error) ≤ a constant and minimizes β or maximizes
1 − β. (1 − β) is known as the Power of the test under the alternative
hypothesis.

The Neyman -Pearson lemma: If C is a critical region of size α and k is
a constant such that
(L0/L 1) ≤ k inside C
and
(ILn0/aL nu1)ts≥hekl olutside C
then C is a most powerful critical region of size α for testing H : 𝜃 =
                                                      0
𝜃0 against H 1 : 𝜃 = 𝜃1

∙  Note that likelihood has to be completely specified under the null
   and alternative hypotheses. So, this lemma applies only to testing
   a simple hypothesis versus another simple hypothesis.

∙  L0 is the likelihood under H 0 and L1 is the corresponding likeli-
   hood function under H1.

7.22 EXERCISES ___________________________________________________________     

1. 

In a two-sided (two-tailed) hypothesis test, the test statistic was calculated as 0.18. We know that the distribution of the test statistic (call this A distribution) has the triangular shaped union of the line segments [AB] and [BC], given A(0.00, 0.00), B(2.00, 0.50) and C(4.00, 0.00). Conclude the test at α = 0.005 by calculating and using p-values only. In your answer, clearly define what p-value is.

Solution: This exercise is left as self-study.

2. 

Referring to H0 : μ = 0 against H1 : μ > 0 and using proper drawings of the relevant distributions, demonstrate that

i. Power of a hypothesis test gets higher as the sample size gets larger

ii. Power of a hypothesis test gets higher as population variance gets smaller

Make sure your drawings are clear and well-explained.

Solution: This exercise is left as self-study.

3. 

Consider a large box which contains many white (W) and black (B) balls. We have forgotten the percentage of white balls in the box, but remember that it is either 1
3 or 2
3. Even though we do not know the percentage of white balls in the box we strongly believe that it is 13 (but still believe that it might be 23). Hence we decide to test if the percentage of white balls in the box is 23. For this purpose we draw 20 balls at random with replacement and note their color.

i. What are the hypotheses of this test?

ii. If we decide to use the number of white balls as our test statistic, what is the distribution of the test statistic?

iii. What is the decision rule?

iv. If the sample you observed was:

W W W B B W B W B W B B W B W B W W W W

what would your conclusion be?

v. What is the p-value corresponding to the above sample?

vi. What is the probability of a Type I error and the probability of a Type II error?

Solution: This exercise is left as self-study.

4. 

In the investigation of the average performance of produced kettles, a quality control engineer examines 49 kettles and measures the mean time to heat 1 liter of water from 25 C to 100 C as 75seconds. Knowing that this had a historical variance of 100seconds2, he wants to test at α = 0.05 whether the population mean time is equal to 60seconds or not, as the producer’s advertisements say "1 liter in 1 minute". Help him to correct the mistakes in his statistical test report.

Statistical test report
Engineer’s name: Dumb Dumber Jr.
Date of test: 05 January 2019

Hypotheses:
               H 0 = 60

               H 1 < 60 (He has a problem here ...)
Since historical variance is known, I’ll use t-distribution in my assess-

ment. (... and here) The test statistic is:
                   t = ¯x−-μ0- (... and here)
                         s
and its value is:
                      t = 75−-60-= 0.15
                           100
Lower critical t- value is:

                       t48,0.05 = − 1.684
Since 0.15 > −1.684, I reject H = 60 (... and here) Finally, the mean
                            0
time to boil water for our heaters is less than 60 seconds with some
95%  con fidence, as promised in the advertisements. (... and of course,
here.)

Solution: The hypotheses involved should be written as:

H0 : μ = 60

H1 : μ > 60

As the historical variance of temperatures is known to be 100, the researcher should use:

    75−-60-
z =   10   = 1.5

where the upper-critical z-value is 1.65 in this one-sided test. Since 1.5 < 1.65, we fail to reject H0. The mean time to boil water is not longer than 60 seconds, as promised in the advertisements.

5. 

A researcher investigates whether two different teaching methods yield similar impacts on learning of students. After Method 1 is used in Section 1 and Method 2 is used in Section 2 of the same course, the same final exam is given to both sections. Then the researcher forms a 95% confidence interval as [9.82,17.30] for the difference of exam grades (Section 1 grade minus Section 2 grade). Can you analyze whether there is a difference of 15points between the grades of two sections?

Solution: This exercise is left as self-study.

6. 

The choice of confidence level (1− α) for statistical practices depend on the scientific/technical discipline. Referring to an economist/financial analyst (performing portfolio analysis), a computer scientist (designing and coding national payment systems), an international relations specialist (trying to avoid nuclear conflicts) and a physicist working for the CERN (searching for a very rare subatomic particle), explain how the confidence level must be chosen.

Solution: This exercise is left as self-study.

7. 

We have the following information:

Help him to find the critical value needed.

Solution: This exercise is left as self-study.

A t random  variable with m degrees of freedom, denoted t(m) is
found by:
                            Z
                       t = ∘-2--∼ t(m)
                            χ(mm)

if the numerator and denominator are independent random vari-
aIbnleas n.u Htesrhee,l clonsider the meaning of:
                              2
                             χ(m)
                              m
Previously we said χ2 should be something related to variance. Based
on the definition of χ 2 , do you think the fraction above is the vari-
ance of something? R(me)veal what this something is.

V 1 ∼ χ2m1 and V2 ∼ χ2m 2 being two chi- squared random variables:
                           V1
                      F = -m1 ∼ F
                           Vm22    (m1,m 2)

Can we say that F random variable handles the difference between
two variances? Recall:            Z
                        t(m) = ∘----
                                 χ2(m)
                                 m
Now, square both sides of the expression:
                                 2
In a nutshell            t2  = -Z2-
                          (m)   χ(m)
                                 m2
                             →  χ1-
                                χ2m
                                mχ2
                                -11-
                             →  χ2m
                                m
                             ∼ F1,m
F   has a numerator degrees of freedom of 1 and denominator de-
 1,m
grees of freedom of m.

Regarding the distributions we use in ECON 221 and ECON  222,
remember  the following:

∙  Sum of Bernoullis is Binomial

∙  Binomial with a single trial is Bernoulli
∙  Binomial with an infinitely many trials and infinitesimal probability

   of success is Poisson
∙  Sum of Poissons is another Poisson

∙In Bain noumtisahle wlilth a variance greater than 5 and infinite trials is Normal

∙  Normal with a zero mean and variance of unity is Standard Normal

∙  Sum of squares of Standard Normals is Chi-Squared

∙  Standard Normal divided by the square root of a “Chi- Squared cor-
   rected for its degrees of freedom” is t

∙  Ratio of two Chi- Squareds each corrected for its degrees of freedom
   is F

∙  Square of a t is F