42
1 Pertemuan 09 & 10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun : 2010

1 Pertemuan 09 10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

Embed Size (px)

DESCRIPTION

3 Introduction When the sample size is small, the estimation and testing procedures of large samples are not appropriate. There are equivalent small sample test and estimation procedures for , the mean of a normal population      the difference between two population means  2, the variance of a normal population The ratio of two population variances.

Citation preview

Page 1: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

1

Pertemuan 09 & 10Pengujian Hipotesis

Mata kuliah : A0392 - Statistik EkonomiTahun : 2010

Page 2: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

2

Outline Materi :

• Uji hipotesis rata-rata dan proporsi• Uji hipotesis beda dua rata-rata• Uji hipotesis beda dua proporsi

Page 3: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

3

Introduction• When the sample size is small, the

estimation and testing procedures of large samples are not appropriate.

• There are equivalent small sample test and estimation procedures for , the mean of a normal populationthe difference between two population

means2, the variance of a normal populationThe ratio of two population variances.

Page 4: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

4

The Sampling Distribution of the Sample Mean

• When we take a sample from a normal population, the sample mean has a normal distribution for any sample size n, and

• has a standard normal distribution. • But if is unknown, and we must use s to estimate it, the

resulting statistic is not normalis not normal.

nxz

/

normal!not is / ns

x

x

Page 5: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

5

Student’s t Distribution• Fortunately, this statistic does have a sampling

distribution that is well known to statisticians, called the StudentStudent’’s t distribution, s t distribution, with nn-1 -1 degrees of freedom.degrees of freedom.

nsxt/

•We can use this distribution to create estimation testing procedures for the population mean .

Page 6: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

6

Properties of Student’s t

• Shape depends on the sample size n or the degrees of degrees of freedom, freedom, nn-1.-1.

• As n increase , variability of t decrease because the estimate s is based on more and more information.

• As n increases the shapes of the t and z distributions become almost identical.

•Mound-shapedMound-shaped and symmetric about 0.•More variable than More variable than zz, with “heavier tails”

Applet

Page 7: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

7

Using the t-Table• Table 4 gives the values of t that cut off certain

critical values in the tail of the t distribution.• Index dfdf and the appropriate tail area a a to find

ttaa,,the value of t with area a to its right.

For a random sample of size n = 10, find a value of t that cuts off .025 in the right tail.

Row = df = n –1 = 9

t.025 = 2.262

Column subscript = a = .025

Page 8: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

8

Small Sample Inference for a Population Mean

• The basic procedures are the same as those used for large samples. For a test of hypothesis:

.1on with distributi- taon basedregion rejection aor values- using

/

statistic test theusing tailedor two one :H versus:HTest

0

a00

ndfp

nsxt

Page 9: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

9

Example

A sprinkler system is designed so that the average time for the sprinklers to activate after being turned on is no more than 15 seconds. A test of 5 systems gave the following times:

17, 31, 12, 17, 13, 25 Is the system working as specified? Test using = .05.

specified) as ng(not worki 15:Hspecified) as (working 15:H

a

0

Page 10: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

10

ExampleData:Data: 17, 31, 12, 17, 13, 25First, calculate the sample mean and standard deviation, using your calculator or the formulas in Chapter 2.

387.75

61152477

1

)(

167.196

115

222

nnxx

s

nxx i

Page 11: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

11

ExampleData:Data: 17, 31, 12, 17, 13, 25Calculate the test statistic and find the rejection region for =.05.

5161 38.16/387.715167.19

/

:freedom of Degrees :statisticTest

0

ndfns

xt

Rejection Region: Reject H0 if t > 2.015. If the test statistic falls in the rejection region, its p-value will be less than = .05.

Page 12: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

12

ConclusionData:Data: 17, 31, 12, 17, 13, 25Compare the observed test statistic to the rejection region, and draw conclusions.

.015.2 if HReject :RegionRejection 38.1 :statisticTest

0

t

t

Conclusion: For our example, t = 1.38 does not fall in the rejection region and H0 is not rejected. There is insufficient evidence to indicate that the average activation time is greater than 15.

15:H 15:H

a

0

Page 13: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

13

Approximating the p-value

• You can only approximate the p-value for the test using Table 4.

Since the observed value of t = 1.38 is smaller than t.10 = 1.476,

p-value > .10.

Page 14: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

14

The exact p-value

• You can get the exact p-value using some calculators or a computer.

One-Sample T: TimesTest of mu = 15 vs mu > 15

Variable N Mean StDev SE MeanTimes 6 19.17 7.39 3.02

Variable 95.0% Lower Bound T PTimes 13.09 1.38 0.113

p-value = .113 which is greater than .10 as we approximated using Table 4.

Applet

Page 15: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

15

Testing the Difference between Two Means

normal. be must spopulation two the small, are sizes sample the Since

and variancesand and means with2 and 1 spopulation from drawn are and size of samples random tindependen 9,Chapter in As

22

21 .21

21

μμ

nn

•To test: •H0:D0 versus Ha:one of three

where D0 is some hypothesized difference, usually 0.

Page 16: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

16

Testing the Difference between Two Means

•The test statistic used in Chapter 9

•does not have either a z or a t distribution, and cannot be used for small-sample inference. •We need to make one more assumption, that the population variances, although unknown, are equal.

2

22

1

21

21z

ns

ns

xx

Page 17: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

17

Testing the Difference between Two Means

•Instead of estimating each population variance separately, we estimate the common variance with

2)1()1(

21

222

2112

nn

snsns

21

2

021

11

nns

Dxxthas a t distribution with n1+n2-2=(n1-1)+(n2-1) degrees of freedom.

•And the resulting test statistic,

Page 18: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

18

Example• Two training procedures are compared by

measuring the time that it takes trainees to assemble a device. A different group of trainees are taught using each method. Is there a difference in the two methods? Use = .01.

Time to Assemble

Method 1 Method 2

Sample size 10 12

Sample mean 35 31

Sample Std Dev

4.9 4.5

0:H 210

21

2

21

11

0:statisticTest

nns

xxt

0:H 21a

Page 19: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

19

Example• Solve this problem by approximating the p-

value using Table 4.

Time to Assemble

Method 1 Method 2

Sample size 10 12

Sample mean 35 31

Sample Std Dev 4.9 4.5

99.1121

101942.21

3135:statisticTest

t

Applet

942.2120

)5.4(11)9.4(9

2)1()1(

:Calculate

22

21

222

2112

nn

snsns

Page 20: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

20

Example

value)-(21)99.1(

)99.1()99.1( :value-

ptP

tPtPp

.025 < ½( p-value) < .05

.05 < p-value < .10

Since the p-value is greater than = .01, H0 is not rejected. There is insufficient evidence to indicate a difference in the population means.

df = n1 + n2 – 2 = 10 + 12 – 2 = 20

Page 21: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

21

Testing the Difference between Two Means

•If the population variances cannot be assumed equal, the test statistic

•has an approximate t distribution with degrees of freedom given above. This is most easily done by computer.

2

22

1

21

21

ns

ns

xxt

1)/(

1)/(

2

22

22

1

21

21

2

2

22

1

21

nns

nns

ns

ns

df

Page 22: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

22

The Paired-Difference Test

•Sometimes the assumption of independent samples is intentionally violated, resulting in a matched-pairsmatched-pairs or paired-difference testpaired-difference test.•By designing the experiment in this way, we can eliminate unwanted variability in the experiment by analyzing only the differences,

ddii = = xx11ii – – xx22ii

•to see if there is a difference in the two population means,

Page 23: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

23

Example

• One Type A and one Type B tire are randomly assigned to each of the rear wheels of five cars. Compare the average tire wear for types A and B using a test of hypothesis.

Car 1 2 3 4 5Type A 10.6 9.8 12.3 9.7 8.8

Type B 10.2 9.4 11.8 9.1 8.3

0:H 0:H

21a

210

• But the samples are not independent. The pairs of responses are linked because measurements are taken on the same car.

Page 24: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

24

The Paired-Difference Test

.1on with distributi- taon basedregion rejection aor value- theUse

. s,difference theofdeviation standard andmean theare and pairs, ofnumber where

/0

statistic test theusing 0 :H test we0:H test To d0210

ndfp

dsdn

nsdt

i

d

d

Page 25: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

25

ExampleCar 1 2 3 4 5Type A 10.6 9.8 12.3 9.7 8.8

Type B 10.2 9.4 11.8 9.1 8.3

Difference .4 .4 .5 .6 .5

0:H 0:H

21a

210

.0837

.48 Calculate

1

22

nndd

s

ndd

ii

d

i8.12

5/0837.048.

/0

:statisticTest

ns

dtd

Page 26: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

26

ExampleCarCar 1 2 3 4 5Type A 10.6 9.8 12.3 9.7 8.8

Type B 10.2 9.4 11.8 9.1 8.3

Difference .4 .4 .5 .6 .5

Rejection region: Reject H0 if t > 2.776 or t < -2.776.

Conclusion: Since t = 12.8, H0 is rejected. There is a difference in the average tire wear for the two types of tires.

Page 27: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

27

Key Concepts

Page 28: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

28

The test statistic is a value computed from the sample data, and it is used in making the decision about the rejection of the null hypothesis.

z = p - p

pqn

Test statistic for proportions

Test statistic for proportions

Page 29: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

Solution: The preceding example showed that the given claim results in the following null and alternative hypotheses: H0: p = 0.5 and H1: p > 0.5. Because we work under the assumption that the null hypothesis is true with p = 0.5, we get the following test statistic:

npq

z = p – p

= 0.56 - 0.5

(0.5)(0.5) 880

= 3.56

Page 30: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

Figure 7-3

Page 31: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

31

Inferences about Two Proportions

Assumptions1. We have proportions from two

independent simple random samples.

2. For both samples, the conditions np 5 and nq 5 are satisfied.

Page 32: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

32population 2.

The corresponding meanings are attachedto p

2, n

2 , x

2 , p

2. and q

2 , which come from^^

Notation for Two Proportions

For population 1, we let: p

1 = population proportion

n1 = size of the sample x1 = number of successes in the sample

p1 = x1 (the sample proportion)

q1 = 1 – p

1 ^^

n1

^

Page 33: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

33

The pooled estimate of p1 and p

2

  is denoted by p.

Pooled Estimate of p

1 and p

2

q = 1 – p

=p n1 + n

2

x1 + x

2

Page 34: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

34

Test Statistic for Two Proportions

For H0: p1 = p

2 , H0: p1

p2 , H0: p1

p2

H1: p1

p2 , H1: p1

< p2 , H1: p

1> p

2

+z =

( p1

– p2 ) – ( p

1 – p

2 )^ ^

n1

pqn2

pq

Page 35: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

35

Test Statistic for Two Proportions

where p1 – p

2 = 0 (assumed in the null hypothesis)

=p1

^ x1

n1

p2

^ x2

n2

=and

and q = 1 – pn1 + n

2

p = x

1 + x

2

For H0: p1 = p

2 , H0: p1

p2 , H0: p1

p2

H1: p1

p2 , H1: p1

< p2 , H1: p

1> p

2

Page 36: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

Example:

Page 37: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

Example:

200n1

n1= 200

x1 = 24

p1 = x1 = 24 = 0.120^

n2

n2 = 1400x2 = 147p2 = x2 = 147 = 0.105

1400^

H0: p1 = p2, H1: p1 > p2

p = x1 + x2 = 24 + 147 = 0.106875 n1 + n2 200+1400q = 1 – 0.106875 = 0.893125.

Page 38: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

Example:

200n1

n1= 200

x1 = 24

p1 = x1 = 24 = 0.120^

n2

n2 = 1400x2 = 147p2 = x2 = 147 = 0.105

1400^

z = (0.120 – 0.105) – 0(0.106875)(0.893125) + (0.106875)(0.893125)

200 1400

z = 0.64

Page 39: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

Example:

200n1

n1= 200

x1 = 24

p1 = x1 = 24 = 0.120^

n2

n2 = 1400x2 = 147p2 = x2 = 147 = 0.105

1400^

z = 0.64This is a right-tailed test, so the P-value isthe area to the right of the test statistic z = 0.64. The P-value is 0.2611.Because the P-value of 0.2611 is greater than the significance level of = 0.05, we fail to reject the null hypothesis.

Page 40: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

Example: For the sample data listed in Table 8-1, use a 0.05 significance level to test the claim that the proportion of black drivers stopped by the police is greater than the proportion of white drivers who are stopped.

200n1

n1= 200

x1 = 24

p1 = x1 = 24 = 0.120^

n2

n2 = 1400x2 = 147p2 = x2 = 147 = 0.105

1400^

z = 0.64Because we fail to reject the null hypothesis, we conclude that there is not sufficient evidence to support the claim that the proportion of black drivers stopped by police is greater than that for white drivers. This does not mean that racial profiling has been disproved. The evidence might be strong enough with more data.

Page 41: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

Example:

200n1

n1= 200

x1 = 24

p1 = x1 = 24 = 0.120^

n2

n2 = 1400x2 = 147p2 = x2 = 147 = 0.105

1400^

Page 42: 1 Pertemuan 09  10 Pengujian Hipotesis Mata kuliah : A0392 - Statistik Ekonomi Tahun: 2010

4242

SELAMAT BELAJAR SEMOGA SUKSES SELALU