You are on page 1of 32

Metode Statistika II

Pertemuan 6 - Uji Hipotesis Ratarata


Oleh : Rudi Salam
rudisalam@stis.ac.id -

Uji Hipotesis Rata-rata

Hypothesis
Tests for
Known

Unknown

Large
Samples

Small
Samples
rudisalam@stis.ac.id -

z
n

Calculating the Test Statistic


Hypothesis
Tests for

Known

Unknown

The test statistic is:

Large
Samples

Small
Samples

rudisalam@stis.ac.id -

tn1snzxn
Calculating the Test Statistic

(continued)

Hypothesis
Tests for

Known

Unknown

The test statistic is:But is

sometimes
approximated
using a z:

Large
Samples

Small
Samples

rudisalam@stis.ac.id -

tn1sn

Calculating the Test Statistic

(continued)

Hypothesis
Tests for

Known

Unknown

The test statistic is:

Large
Samples

Small
Samples

(The population must


be approximately
normal)

rudisalam@stis.ac.id -

Review: Steps in Hypothesis


Testing
1.
2.

Specify the population value of interest


Formulate the appropriate null and
alternative hypotheses

3.

Specify the desired level of significance

4.

Determine the rejection region

5.

6.

Obtain sample evidence and compute


the test statistic
Reach a decision and interpret the
result
rudisalam@stis.ac.id -

Hypothesis Testing Example


Test the claim that the true mean
# of TV sets in US homes is at
(Assume
3.
= 0.8)
least

1. Specify the population value of interest


The mean number of TVs in US homes
2. Formulate the appropriate null and alternative
hypotheses
H : 3
HA: < 3 (This is a lower tail test)
0
3. Specify the desired level of significance
Suppose that = .05 is chosen for this test
rudisalam@stis.ac.id -

Hypothesis Testing Example

(continued)

4. Determine the rejection region


= .05

Reject H0

-z= -1.645

Do not reject
H0

This is a one-tailed test with = .05.


Since is known, the cutoff value is a z value:
Reject H0 if z < z = -1.645 ; otherwise do not
reject H0

rudisalam@stis.ac.id -

.z
x

2
8
4

.
1
6

2
.
0
0
0
8
n1
Hypothesis Testing Example

5. Obtain sample evidence and compute


the test statistic

Suppose a sample is taken with the following


results: n = 100, x = 2.84 ( = 0.8 is assumed
known)

Then the test statistic is:

rudisalam@stis.ac.id -

Hypothesis Testing Example

(continued)

6. Reach a decision and interpret the result


= .05
z
Reject H0

-1.645

Do not reject
H0

-2.0

Since z = -2.0 < -1.645, we reject the null


hypothesis that the mean number of TVs in
US homes is at least 3
rudisalam@stis.ac.id -

Hypothesis Testing Example

(continued)

An alternate way of constructing rejection region:

= .05
x
Reject H0

2.868
2.84
4

Since x = 2.84 <


2.8684, we reject the
null hypothesis

Now
expresse
d in x,
not z
units

Do not reject
H0

0.8
x z
3 1.645
2.8684
n
100

rudisalam@stis.ac.id -

p-Value Approach to Testing

x
Convert Sample Statistic (e.g.
) to
Test Statistic ( Z or t statistic )

Obtain the p-value from a table or


computer

Compare the p-value with

If p-value < , reject H0

If p-value , do not reject H0


rudisalam@stis.ac.id -

p-Value Approach to Testing

(continued)

p-value: Probability of obtaining a


test statistic more extreme ( or
) than the observed sample value
given H0 is true

Also called observed level of


significance
Smallest value of for which H0 can
be rejected
rudisalam@stis.ac.id -

p-value example

Example: How likely is it to see a sample


mean of 2.84 (or something further below
the mean) if the true mean is = 3.0?

P( x 2.84 | 3.0)

2.84 3.0
P z

0.8

100

P(z 2.0) .0228

= .05
p-value
=.0228
x
2.868
2.84

4
rudisalam@stis.ac.id -

p-value example

(continued)

Compare the p-value with

If p-value < , reject H0


If p-value , do not reject
H0

= .05

Here:

p-value = .0228
= .05

Since .0228 < .05, we


reject the null
hypothesis

p-value
=.0228

2.868
4

2.8
4

rudisalam@stis.ac.id -

Example: Upper Tail z Test


for Mean ( Known)
A phone industry manager thinks that
customer monthly cell phone bill have
increased, and now average over $52
per month. The company wishes to
test this claim. (Assume = 10 is
known)

Form hypothesis test:


H0: 52
month

the average is not over $52 per

HA: > 52
month

the average is greater than $52 per

(i.e., sufficient evidence exists to support the


managers claim)
rudisalam@stis.ac.id -

Example: Find Rejection


Region
(continued)

Suppose that = .10 is chosen for this test

Find the rejection region:

Reject H0

= .
10
Do not reject
H0
0

z=1.2
8

Reject H0

Reject H0 if z >
1.28
rudisalam@stis.ac.id -

Review:
Finding Critical Value - One
Tail
What is z given =
0.10?

.90

.10

= .
.50 .40

10

0 1.28

Standard Normal
Distribution Table
(Portion)

.07

.08

.09

1.1 .3790 .3810 .3830


1.2 .3980 .3997 .4015
1.3 .4147 .4162 .4177

Critical
Value
= 1.28
rudisalam@stis.ac.id -

5
3
.
1

5
2
z

0
.
8
0
n64
Example: Test Statistic

(continued)

Obtain sample evidence and compute the


test statistic
Suppose a sample is taken with the
following results: n = 64, x = 53.1

(=10

was assumed known)

Then the test statistic is:

rudisalam@stis.ac.id -

Example: Decision

(continued)

Reach a decision and interpret the


result:
Reject H
0

= .
10
Do not reject
H0
0

1.28

Reject H0

z = .88

Do not reject H0 since z = 0.88


1.28
i.e.: there is not sufficient evidence that
the
rudisalam@stis.ac.id -

p -Value Solution

(continued)

Calculate the p-value and compare to

p-value = .
1894
Reject H0
= .10
0
Do not reject
H0

1.28
z=.
88

Reject H0

P( x 53.1 | 52.0)

53.1 52.0
P z

10

64

P(z 0.88) .5 .3106


.1894

Do not reject H0 since p-value = .1894 >


= .10
rudisalam@stis.ac.id -

Example: Two-Tail Test


( Unknown)
The average cost of a
hotel room in New
York is said to be
$168 per night. A
random sample of 25
hotels resulted in x
= $172.50 and
s = $15.40. Test at
the
= 0.05 level.

H0: =
168 HA:
168

rudisalam@stis.ac.id -

1
7
2
.
5
0

1
6
8
tn1

1
.
4
6
s
4
n

Example Solution: Two-Tail


Test
H0: =
168 HA:
168
= 0.05
n = 25
is unknown,
so
use a t
statistic
Critical Value:
t24 = 2.0639

/2=.02
5

/2=.02
5

Reject H0

-t/2

-2.0639

Do not reject
H0
0

Reject H0

t/2

1.4
6

2.0639

Do not reject H0: not sufficient evidence


that true mean cost is different than $168

rudisalam@stis.ac.id -

Uji Proporsi Satu Populasi

rudisalam@stis.ac.id -

Uji Hipotesis untuk Proporsi

Melibatkan nilai kategori

Dua outcome yang mungkin

Sukses (memiliki karakteristik tertentu)

Gagal (tidak memiliki karakteristik tertentu


tersebut)

Fraksi atau proporsi populasi dalam


kategori sukses" dinotasikan dengan p

Proporsi

Proporsi sampel pada kategori sukses

dinyatakan dengan p

(continued)

x number of successes in sample


p

n
sample size

Ketika np dan n(1-p) paling tidak bernilai


5, p dapat diapproksimasi dengan
distribusi normal dengan rata-rata dan
standar deviasi
p(1 p)

p
p
p

Uji Hipotesis untuk Proporsi

Distribusi

sampling dari p
adalah normal,
sehingga
statistic ujinya
adalah z :

p p
p(1 p )
n

Hypothesis
Tests for p
np 5
and
n(1-p) 5

np < 5
or
n(1-p) < 5
Not
discussed in
this chapter

Example: z Test for


Proportion
A marketing company
claims that it receives
8% responses from its
mailing. To test this
claim, a random
sample of 500 were
surveyed with 25
responses. Test at
the = .05
significance level.

Check:
n p = (500)(.08)
=40

n(1-p) = (500)(.92)
=460
rudisalam@stis.ac.id -

Z Test for Proportion:


Solution
Test Statistic:

H 0: p = .
08 HA: p
.08
= .05

n = 500, p = .05
Critical Values:
1.96
Rejec
t

Rejec
t
.
025

-2.47

.05 .08
2.47
.08(1 .08)
500

Decision:

.
025
-1.96 0

pp

p(1 p)
n

1.96

Reject H0 at = .05

Conclusion:
There is sufficient
evidence to reject
the companys claim
of 8% response rate.

rudisalam@stis.ac.id -

p -Value Solution

(continued)

Calculate the p-value and compare to


(For a two sided test the p-value is always two sided)
Do not reject
H0

Reject
H0

/2 = .
025

Reject H0
/2 = .
025

.
0068

.
0068

-1.96
z=
-2.47

p-value = .
0136:

P(z 2.47) P(x 2.47)


2(.5 .4932)
2(.0068) 0.0136

1.96
z=
2.47

Reject H0 since p-value = .0136 <


= .05
rudisalam@stis.ac.id -

Soal
Sebuah uang logam dilantun 20 kali dan
menghasilkan 5 muka. Apakah dari sini
cukup ada alasan untuk menolak hipotesis
bahwa uang tadi setangkup dan meyakini
tandingannya bahwa muka muncul kurang
dari 50%? Sebutkan p-value nya.

Chapter Summary

Terima Kasih

rudisalam@stis.ac.id -

You might also like