41
Statistik TP 608377 A Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Embed Size (px)

Citation preview

Page 1: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Statistik TP608377 A

Pengujian Hipotesis Dua PopulasiBy. Nurvita Arumsari, Ssi, MSi

Page 2: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Chapter Goals

After completing this chapter, you should be able to:

Test hypotheses or form interval estimates for

◦two independent population means Standard deviations known Standard deviations unknown

◦two means from paired samples◦the difference between two population

proportions

Page 3: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Estimating two population values

Population means, independent samples

Paired samples

Population proportions

Group 1 vs. independent Group 2

Same group before vs. after treatment

Proportion 1 vs. Proportion 2

Examples:

Page 4: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Two – Sample Mean Population Test

Page 5: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Hypothesis Tests forTwo Population Means

Lower tail test:

H0: μ1 = μ2

HA: μ1 < μ2

i.e.,

H0: μ1 – μ2 = 0HA: μ1 – μ2 < 0

Upper tail test:

H0: μ1 = μ2

HA: μ1 > μ2

i.e.,

H0: μ1 – μ2 = 0HA: μ1 – μ2 > 0

Two-tailed test:

H0: μ1 = μ2

HA: μ1 ≠ μ2

i.e.,

H0: μ1 – μ2 = 0HA: μ1 – μ2 ≠ 0

Two Population Means, Independent Samples

Page 6: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Two Population Means, Independent Samples

Lower tail test:

H0: μ1 – μ2 = 0HA: μ1 – μ2 < 0

Upper tail test:

H0: μ1 – μ2 = 0HA: μ1 – μ2 > 0

Two-tailed test:

H0: μ1 – μ2 = 0HA: μ1 – μ2 ≠ 0

a a/2 a/2a

-za -za/2za za/2

Reject H0 if z < -za

Reject H0 if z > za

Reject H0 if z < -za/2

or z > za/2

Hypothesis tests for μ1 – μ2

Page 7: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Hypothesis tests for μ1 – μ2

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

Use a z test statistic

Use s to estimate unknown σ , approximate with a z test statistic

Use s to estimate unknown σ , use a t test statistic and pooled standard deviation

Page 8: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Independent Samples

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

Different data sources◦ Unrelated◦ Independent Sample selected from

one population has no effect on the sample selected from the other population

Use the difference between 2 sample means

Use z test or pooled variance t test

*

Page 9: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

σ1 and σ2 known

Page 10: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

σ1 and σ2 known

Assumptions:

Samples are randomly and independently drawn

population distributions are normal or both sample sizes are 30

Population standard deviations are known

*

When σ1 and σ2 are known and both populations are normal or both sample sizes are at least 30, the test statistic is a z-value…

Page 11: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

2

22

1

21

2121

μμxxz

The test statistic for μ1 – μ2 is:

σ1 and σ2 known

*

Page 12: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

2

22

1

21

/221n

σ

n

σzxx

The confidence interval for μ1 – μ2 is:

σ1 and σ2 known(continued)

*

Page 13: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

σ1 and σ2 unknown, large samples

Page 14: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

σ1 and σ2 unknown, large samples

Assumptions:

Samples are randomly and independently drawn

both sample sizes are 30

Population standard deviations are unknown*

Page 15: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

σ1 and σ2 unknown, large samples

Forming interval estimates:

use sample standard deviation s to estimate σ

the test statistic is a z value

(continued)

*

Page 16: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

2

22

1

21

/221n

s

n

szxx

The confidence interval for μ1 – μ2 is:

σ1 and σ2 unknown, large samples (continued)

*

Page 17: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

σ1 and σ2 unknown, small samples

Page 18: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

σ1 and σ2 unknown, small samples

Assumptions:

populations are normally distributed

the populations have equal variances

samples are independent

*

Page 19: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

σ1 and σ2 unknown, small samples

Forming interval estimates:

The population variances are assumed equal, so use the two sample standard deviations and pool them to estimate σ

the test statistic is a t value with (n1 + n2 – 2) degrees of freedom

(continued)

*

Page 20: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

σ1 and σ2 unknown, small samples

The pooled standard deviation is

(continued)

2nn

s1ns1ns

21

222

211

p

*

Page 21: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

21

p/221n

1

n

1stxx

The confidence interval for μ1 – μ2 is:

σ1 and σ2 unknown, small samples (continued)

Where t/2 has (n1 + n2 – 2) d.f.,

and

2nn

s1ns1ns

21

222

211

p

*

Page 22: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Population means, independent samples

σ1 and σ2 known

σ1 and σ2 unknown, n1 and n2 30

σ1 and σ2 unknown, n1 or n2 < 30

σ1 and σ2 unknown, small samples

Where t/2 has (n1 + n2 – 2) d.f.,

and

2nn

s1ns1ns

21

222

211

p

21p

2121

n1

n1

s

μμxxt

The test statistic for μ1 – μ2 is:

*

Page 23: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Paired Samples

Page 24: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Lower tail test:

H0: μd = 0HA: μd < 0

Upper tail test:

H0: μd = 0HA: μd > 0

Two-tailed test:

H0: μd = 0HA: μd ≠ 0

Paired Samples

Hypothesis Testing for Paired Samples

a a/2 a/2a

-ta -ta/2ta ta/2

Reject H0 if t < -ta

Reject H0 if t > ta Reject H0 if t < -t /2a

or t > t /2a Where t has n - 1 d.f.

(continued)

Page 25: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Paired Samples

Tests Means of 2 Related Populations Paired or matched samples Repeated measures (before/after) Use difference between paired values:

Eliminates Variation Among Subjects Assumptions:

◦ Both Populations Are Normally Distributed◦ Or, if Not Normal, use large samples

d = x1 - x2

Page 26: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Paired Differences

The ith paired difference is di , wherePaired samples di = x1i - x2i

The point estimate for the population mean paired difference is d :

1n

)d(ds

n

1i

2i

d

n

dd

n

1ii

The sample standard deviation is

n is the number of pairs in the paired sample

Page 27: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Paired Differences

The confidence interval for d isPaired samples

1n

)d(ds

n

1i

2i

d

n

std d/2

Where t/2 has

n - 1 d.f. and sd

(continued)

n is the number of pairs in the paired sample

Page 28: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Two Population Proportions

Page 29: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Goal: Form a confidence interval for or test a hypothesis about the difference between two population proportions, p1 – p2

The point estimate for the difference is p1 – p2

Population proportions

Assumptions: n1p1 5 , n1(1-p1) 5

n2p2 5 , n2(1-p2) 5

Two Population Proportions

Page 30: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Hypothesis Tests forTwo Population Proportions

Population proportions

Lower tail test:

H0: p1 – p2 = 0HA: p1 – p2 < 0

Upper tail test:

H0: p1 – p2 = 0HA: p1 – p2 > 0

Two-tailed test:

H0: p1 – p2 = 0HA: p1 – p2 ≠ 0

a a/2 a/2a

-za -za/2za za/2

Reject H0 if z < -za Reject H0 if z > za Reject H0 if z < -z /2a

or z > z /2a

Page 31: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Two Population Proportions

Population proportions

21

21

21

2211

nn

xx

nn

pnpnp

The pooled estimate for the overall proportion is:

where x1 and x2 are the numbers from samples 1 and 2 with the characteristic of interest

Since we begin by assuming the null hypothesis is true, we assume p1 = p2 and pool the two p

estimates

Page 32: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Two Population Proportions

Population proportions

21

2121

n1

n1

)p1(p

ppppz

The test statistic for p1 – p2 is:

(continued)

Page 33: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Confidence Interval forTwo Population

Proportions

Population proportions

2

22

1

11/221 n

)p(1p

n

)p(1pzpp

The confidence interval for p1 – p2 is:

Page 34: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Contoh Kasus

Page 35: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Pooled sp t Test: Example

You’re a welding inspector. Is there a difference in level of precision between welding machine A & B? You collect the following data: A BNumber 21 25Sample mean 3.27 2.53Sample std dev 1.30 1.16

Assuming equal variances, isthere a difference in average yield ( = 0.05)?

Page 36: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Calculating the Test Statistic

1.2256

22521

1.161251.30121

2nn

s1ns1ns

22

21

222

211

p

2.040

251

211

1.2256

02.533.27

n1

n1

s

μμxxt

21p

2121

The test statistic is:

Page 37: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Solution

H0: μ1 - μ2 = 0 i.e. (μ1 = μ2)

HA: μ1 - μ2 ≠ 0 i.e. (μ1 ≠ μ2)

= 0.05df = 21 + 25 - 2 = 44Critical Values: t = ± 2.0154

Test Statistic:

Decision:

Conclusion:

Reject H0 at a = 0.05There is evidence of a difference in means.

t0 2.0154-2.0154

.025

Reject H0 Reject H0

.025

2.040

040.2

251

211

2256.1

53.227.3

t

Page 38: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Assume you are a welding inspector. In the first inspection, you found some defects in welding result. Then, you got a welding training. After you got a training, you inspect the welding result, like in table. Is the training effective? You collect the following data:

Paired Samples Example

Welding ins.

Number of Defects Difference

Before After

C.B 20 3 -17

T.F 20 6 -14

M.H 15 4 -11

R.K 10 4 -6

M.O 17 7 -10

Page 39: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Assume you are a welding inspector. In the first inspection, you found some defects in welding result. Then, you got a welding training. After you got a training, you inspect the welding result, like in table. Is the training effective? You collect the following data:

d = di

n

159.41n

)d(ds

2i

d

= -11.2

Welding ins.

Number of Defects Difference

Before After

C.B 20 3 -17

T.F 20 6 -14

M.H 15 4 -11

R.K 10 4 -6

M.O 17 7 -10

Paired Samples Example

Page 40: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

Example: Two population Proportions

Is there a significant difference between the proportion of boy and the proportion of girl who will prefer on Welding department?

In a random sample, 52 of 72 boys and 10 of 50 girls indicated they would prefer welding department

Test at the .05 level of significance

Page 41: Pengujian Hipotesis Dua Populasi By. Nurvita Arumsari, Ssi, MSi

The hypothesis test is:

H0: p1 – p2 = 0 (the two proportions are equal)HA: p1 – p2 ≠ 0 (there is a significant difference between proportions)

The sample proportions are:

Boys: p1 = 52/72 = .72

Girls: p2 = 10/50 = .2

.508122

62

5072

0125

nn

xxp

21

21

The pooled estimate for the overall proportion is:

Example: Two population

Proportions(continued)