Course 02402 Overview, Hypotheses Concerning Means Introduction to - - PowerPoint PPT Presentation

course 02402 overview hypotheses concerning means
SMART_READER_LITE
LIVE PREVIEW

Course 02402 Overview, Hypotheses Concerning Means Introduction to - - PowerPoint PPT Presentation

Course 02402 Overview, Hypotheses Concerning Means Introduction to Statistics Motivating Example 1 Hypotheses and tests of these 2 Lecture 6: Chapter 7: Hypothesis Test for means One- or Two-Sided Alternative (one-sample setup), 7.4-7.6


slide-1
SLIDE 1

Course 02402 Introduction to Statistics Lecture 6: Chapter 7: Hypothesis Test for means (one-sample setup), 7.4-7.6 Per Bruun Brockhoff

DTU Informatics Building 305 - room 110 Danish Technical University 2800 Lyngby – Denmark e-mail: pbb@imm.dtu.dk

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 1 / 34

Overview, Hypotheses Concerning Means

1

Motivating Example

2

Hypotheses and tests of these One- or Two-Sided Alternative Errors in hypothesis testing

3

Practical Hypothesis Test I P-value Example 1

4

Practical Hypothesis Test II Critical Value Example 1- fortsat

5

One-sample hypothesis test without "known” variance Large samples Small samples - normal distributed data Example 2

6

R (R note 7)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 2 / 34 Motivating Example

Motivating Example A manufacturer of computer screens inform that a screen in average uses 83 W. Furthermore it can be assumed, that the usage is normally distributed with a known variance σ2 = 42 (W)2. A group of consumers wants to test the manufacturers claim and plan to make some measurements of power usage for the given type of computer screens. Formulate a null and alternative hypothesis.

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 4 / 34 Hypotheses and tests of these

Tests of Hypotheses We consider a parameter µ. Often there will be a prior interest linked to a certain value

  • f µ. Therefore we want to test, that is accept or reject,

the hypothesis µ = µ0. Since the estimate of µ is subject to random variation it is not reasonable to expect that µ = µ0 even though they are the same. The question is then how to compare µ and µ0.

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 6 / 34

slide-2
SLIDE 2

Hypotheses and tests of these

Hypotheses Null hypothesis vs. alternative hypothesis H0 : µ = µ0 H1 : µ = µ0 We either choose to accept H0 or to reject H0

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 7 / 34 Hypotheses and tests of these One- or Two-Sided Alternative

One- or Two-Sided Alternative Two-sided alternative H0 : µ = µ0 H1 : µ = µ0 In the case of one-sided alternative, H1 is either H1 : µ < µ0

  • r

H1 : µ > µ0

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 8 / 34 Hypotheses and tests of these One- or Two-Sided Alternative

Tests of Hypotheses A couple of rules of thumb when formulating the hypotheses: Use equal sign in the null hypothesis when possible The alternative hypothesis should be the claim we wish to establish

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 9 / 34 Hypotheses and tests of these Errors in hypothesis testing

Errors in hypothesis testing When testing statistical hypotheses, two kind of errors can

  • ccur:

Type I: Rejection of H0 when H0 is true Type II: Non-rejection of H0 when H1 is true We define P(Type I error) = α P(Type II error) = β

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 10 / 34

slide-3
SLIDE 3

Hypotheses and tests of these Errors in hypothesis testing

An analogy A man is standing in a court of law accused of criminal activity. The null- and the the alternative hypotheses are: H0 : The man is not guilty H1 : The man is guilty

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 11 / 34 Hypotheses and tests of these Errors in hypothesis testing

An analogy Which error can occur? Type I: Reject H0 when H0 is true, that is the man is innocent but judged guilty (α) Type II: Not reject H0 when H1 is true, that is the man is guilty but is acquitted (β)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 12 / 34 Practical Hypothesis Test I

Tests of Hypotheses in 4 Steps

1 Formulate the hypotheses and choose the level of

significance α (choose the "risk-level")

2 Calculate, using the data, the value of the test statistic 3 Calculate the p-value using the test statistic 4 Compare the p-value and the level of significance and

draw a conclusion ∗ An alternative to (4) is to compare the test statistic to the critical value.

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 14 / 34 Practical Hypothesis Test I

Tests of Hypotheses Assume that the data (sample) is normal, that is x1, ..., xn ∈ N(µ, σ2) OR: Large sample (n > 30) We would like to test a null hypothesis about the mean, e.g. H0 : µ = µ0 where µ0 is some value of interest. Dependent on what we want to establish, the alternative hypotheses is formulated and the level of significance α chosen.

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 15 / 34

slide-4
SLIDE 4

Practical Hypothesis Test I

Calculating the Test Statistic We assume that we have formulated a null- and an alternative hypothesis and chosen the level of significance α. Now we need to calculate the test statistic. When testing hypotheses concerning one mean for data that is assumed to follow a normal distribution and σ is known, the test statistic is: Z = ¯ X − µ0 σ/√n

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 16 / 34 Practical Hypothesis Test I P-value

Calculating the P-Value The p-value of the test measures the difference between the data and H0. When testing hypotheses concerning one mean for data that can be assumed to follow a normal distribution and σ is known the p-value for the test statistic Z is achieved by looking up in the normal distribution (Table 3). If the p-value is smaller than α, H0 is rejected If the p-value is bigger than α, H0 is accepted

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 17 / 34 Practical Hypothesis Test I Example 1

Example 1 A manufacturer of computer screens inform that a screen in average uses 83 W. Furthermore it can be assumed, that the usage is normally distributed with a known variance σ2 = 42 (W)2. A group of consumers wants to test the manufacturers claim and plan to make some measurements of power usage for the given type of computer screens. Formulate a null and alternative hypothesis.

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 18 / 34 Practical Hypothesis Test I Example 1

Example 1 12 measurements are performed: 82 86 84 84 92 83 93 80 83 84 82 86 From these measurements the mean usage is estimated to ¯ X = 84.92. Carry out the hypothesis test. Use a significance level of α = 1%

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 19 / 34

slide-5
SLIDE 5

Practical Hypothesis Test I Example 1

Example 1

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 20 / 34 Practical Hypothesis Test II Critical Value

Comparing to a Critical Value: Instead of using the p-value we can compare the test statistic to a critical value, zα (or zα/2 in two-sided tests) When testing hypotheses concerning one mean for data that can be assumed to follow a normal distribution and σ is known, we have H1 Reject H0 if µ < µ0 Z < −zα µ > µ0 Z > zα µ = µ0 Z < −zα/2

  • r Z > zα/2

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 22 / 34 Practical Hypothesis Test II Example 1- fortsat

Example I - now with critical value instead

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 23 / 34 One-sample hypothesis test without "known” variance Large samples

Calculating the Test Statistic When testing hypotheses concerning one mean for data that can be assumed to follow a normal distribution and σ is unknown, but the sample is large (n > 30), the test statistic is: Z = ¯ X − µ0 s/√n since Z ∼ N(0, 12) the p-value for the test statistic Z is achieved by looking up in the normal distribution (Table 3).

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 25 / 34

slide-6
SLIDE 6

One-sample hypothesis test without "known” variance Large samples

Comparing to a Critical Value In stead of using the p-value we can compare the test statistic to a critical value, zα (or zα/2 in two-sided tests) When testing hypotheses concerning one mean for data that can be assumed to follow a normal distribution and σ is unknown but the sample is large, we have H1 Reject H0 if µ < µ0 Z < −zα µ > µ0 Z > zα µ = µ0 Z < −zα/2

  • r Z > zα/2

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 26 / 34 One-sample hypothesis test without "known” variance Small samples - normal distributed data

Calculating the Test Statistic When testing hypotheses concerning one mean for data that can be assumed to follow a normal distribution but σ is unknown and the sample is small (n < 30), the test statistic is: t = ¯ X − µ0 s/√n Since t ∼ t(n − 1) the p-value for the test statistic t is achieved by looking up in the t-distribution (Table 4).

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 27 / 34 One-sample hypothesis test without "known” variance Small samples - normal distributed data

Comparing to a Critical Value Instead of using the p-value we can compare the test statistic to a critical value, tα (or tα/2 in two-sided tests) When testing hypotheses concerning one mean for data that can be assumed to follow a normal distribution and σ is unknown and the sample is small, we have H0 Reject H0 if µ < µ0 t < −tα µ > µ0 t > tα µ = µ0 t < −tα/2

  • r t > tα/2

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 28 / 34 One-sample hypothesis test without "known” variance Example 2

Example 2 In an American study it was desired to compare the content

  • f arsenic in the drinking water at 8 different localities. The

following measurements were registered

Locality water test (ppm) 1 2.2 2 4.1 3 2.1 4 0.8 5 0.1 6 3.2 7 2.9 8 2.2 ¯ x = 2.2 og s2

x = 1.64

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 29 / 34

slide-7
SLIDE 7

One-sample hypothesis test without "known” variance Example 2

Example 2 The health authority would like to test if the mean content

  • f arsenic in the drinking water can be assumed to be 2

ppm. Carry out this hypothesis test by using a significance level

  • f α = 5%

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 30 / 34 One-sample hypothesis test without "known” variance Example 2

Example 2

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 31 / 34 R (R note 7)

R (R note 7)

> x=c(10,13,16,19,17,15,20,23,15,16) > t.test(x,mu=20,conf.level=0.99) One-sample t-Test data: x t = -3.1125, df = 9, p-value = 0.0125 alternative hypotheses: mean is not equal to 20 99 percent confidence interval: 12.64116 20.15884 sample estimates: mean of x 16.4

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 33 / 34 R (R note 7)

Overview, Hypotheses Concerning Means

1

Motivating Example

2

Hypotheses and tests of these One- or Two-Sided Alternative Errors in hypothesis testing

3

Practical Hypothesis Test I P-value Example 1

4

Practical Hypothesis Test II Critical Value Example 1- fortsat

5

One-sample hypothesis test without "known” variance Large samples Small samples - normal distributed data Example 2

6

R (R note 7)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 6 Fall 2012 34 / 34