Statistik 1 9 uji hipothesis dua sampel
-
Upload
selvin-hadi -
Category
Education
-
view
434 -
download
5
Transcript of Statistik 1 9 uji hipothesis dua sampel
Control GroupExperimental Group
Sample1
Sample2
Untuk menguji efek ramuan herbal terhadap peningkatan kemampuan memori, diambil dua sampel secara acak, satu sampel diberikan ramuan dan sampel lain diberikan placebo. Satu bulan kemudian dilakukan uj i memori untuk kedua sampel.
95
15
77
1
1
1
===
n
s
x
105
12
73
2
2
2
===
n
s
x
Hasil uj i statistik 77 - 73 = 4. Apakah perbedaan tersebut signif ikan ataukah kebetulan saja (sampling error)?
Ramuan Placebo
Overview
l
GOALS1. Understand the difference between dependent and
independent samples.2. Conduct a test of hypothesis about the difference
between two independent population means when both samples have 30 or more observations.
3. Conduct a test of hypothesis about the difference between two independent population means when at least one sample has less than 30 observations.
4. Conduct a test of hypothesis about the mean difference between paired or dependent observations.
5. Conduct a test of hypothesis regarding the difference in two population proportions.
Chapter ElevenUji Hipothesis Dua SampelUji Hipothesis Dua Sampel
Two Sample Tests
TEST FOR EQUAL VARIANCESTEST FOR EQUAL VARIANCES TEST FOR EQUAL MEANSTEST FOR EQUAL MEANS
HHo
HH1
Population 1
Population 2
Population 1
Population 2
HHo
HH1
Population 1
Population 2
Population 1 Population 2
Tahapan Uji Statistik secara Umum Anggaplah kita tertarik menguji parameter population (θ) sama dengan k. H0: θ = k H1: θ ≠ k
Pertama, kita perlu memperoleh estimasi sampel (q ) terhadap parameter population (θ).
Kedua, pada umumnya uji statistik akan berupa: t=(q-k)/σq
Bentuk σq tergantung pada apa yang dimaksud dengan q .
Jumlah sampel dan Hipothesis akan menentukan distribusi statistiknya. Jika θ adalah rata-rata populasi, dan jumlah
samplenya lebih dari 30, t mendekati distribusi normal.
Membandingkan dua populasi Kita ingin mengetahui apakah distribusi
perbedaan dalam rata-rata sampel memiliki rata-rata 0.
Jika kedua sampel mengandung setidaknya 30 pengamatan kita gunakan distribusi z sebagai uji statistik.
Hypothesis Tests for Two Population Means
Format 1Format 1
Two-Tailed Two-Tailed TestTest
Upper One-Upper One-Tailed TestTailed Test
Lower One-Lower One-Tailed TestTailed Test
0.0:
0.0:
21
210
≠−
=−
µµµµ
AH
H
0.0:
0.0:
21
210
>−
≤−
µµµµ
AH
H
0.0:
0.0:
21
210
<−
≥−
µµµµ
AH
H
Format 2Format 2
21
210
:
:
µµµµ
≠
=
AH
H
21
210
:
:
µµµµ
>
≤
AH
H
21
210
:
:
µµµµ
<
≥
AH
H
Preferred
Two Independent Populations: Examples
1. Seorang ekonom hendak menentukan apakah ada perbedaan rata-rata pendapatan keluarga pada dua kelompok sosial ekonomi yang berbeda. Apakah mahasiswa Unair berasal dari keluarga
dengan pendapatan yang lebih tinggi daripada mahasiswa Unhas?
1. Seorang panitia penerimaan mahasiswa sebuah perguruan tinggi ingin membandingkan nilai rata-rata UNAS calon mahasiswa yang berasal dari sekolah menengah di pedesaan & perkotaan.
Apakah siswa dari sekolah menengah di pedesaan memiliki nilai rata-rata UNAS yang lebih rendah dibandingkan dari sekolah menengah di perkotaan?
Two Dependent Populations: Examples
1. Seorang analis Pinlabs Unair ingin membandingkan rata-rata skor TOEFL para mahasiswa sebelum & sesudah mengikuti Kursus Persiapan TOEFL.
2. Nike ingin menguji apakah ada perbedaan daya tahan 2 bahan sol sepatu. Salah satu jenis dipasang pada satu sepatu, jenis lain di sepatu lain dari pasangan yang sama.
Thinking Challenge
1. Peringkat Miles per gallon mobil sebelum & sesudah memakai ban radial.
2. Daya tahan lampu yang diproduksi dua pabrik yang berbeda
3. Perbedaan kekuatan 2 metal: satu mengandung alloy, yang lain tidak
4. Daya tahan dua ban sepeda motor: satu dipasang di depan, dan satu di pasang dibelakang
Are they independent or dependent?
independent
independent
dependent
dependent
Hypothesis Testing: 1. Two Population Means
The test statistic is the standard normal (Z) if : The population standard deviations are known, or The population standard deviations are unknown
but the two samples both contain at least 30 observation.
1 2
2 21 2
1 2
X XZ
s sn n
−=+
c o nt. .
Note : The Z test statistic No assumption about the shape of either
population is required The samples are from independent population
(that are not related in any way) Variance of distribution of differences in sample
means :
1 2
2 22 1 2
1 2X X
s ss
n n−= +
Contoh 1Dua kota, Bojonegoro dan Tuban dipisahkan oleh Sungai Bengawan. Ada persaingan antara kedua kota. Koran lokal baru-baru ini melaporkan bahwa pendapatan rumah tangga rata-rata di Bojonegoro sebesar Rp 38 juta dengan deviasi standar sebesar Rp 6 juta untuk sampel 40 rumah tangga. Art ikel yang sama melaporkan pendapatan rata-rata di Tuban sebesar Rp 35 juta dengan deviasi standar Rp 7 juta untuk 35 rumah tangga sampel. Pada t ingkat signif ikansi 0,01 dapatkah kita simpulkan bahwa pendapatan rata-rata di Bojonegoro lebih t inggi?
EXAMPLE 1 c o ntinue d
Step 1: State the null and alternate hypotheses.
H0: µB ≤ µT ; H1: µB > µT
Step 2: State the level of significance. The .01 significance level is stated in the problem.
Step 3: Find the appropriate test statistic. Because both samples are more than 30, we can use z as the test statistic.
Example 1 c o ntinue d
Step 4: State the decision rule. The null hypothesis is rejected if z is greater than 2.33.
33.2=αz0
Rejection Region α = 0.01
H0: µB ≤ µT ; H1: µB > µT
Probabil i ty density of z stat ist ic : N(0,1)
Acceptance Region α = 0.01
Example 1 c o ntinue d
Step 5: Compute the value of z and make a decision.
2 2
38 351.98
(6) (7)40 35
z−= =+
33.2=αz0
H0: µB ≤ µK ; H1: µB > µK
1.98
Rejection Region α = 0.01
Acceptance Region α = 0.01
Example 1 c o ntinue d
Keputusanhipotesis nol tidak ditolak. Kita tidak bisa menyimpulkan bahwa rata-rata pendapatan rumah tangga di Bojonegoro lebih besar.
Example 1 c o ntinue d
The p -value is: P(z > 1.98) = .5000 - .4761 = .0239
33.2=αz0
Rejection Region α = 0.01
H0: µB ≤ µK ; H1: µB > µK
1.98
P-value = 0.0239
Hypothesis Testing: 2. Small Sample Tests of Means
The t distribution is used as the test statistic if one or more of the samples have less than 30 observations.
The required assumptions are:1. Both populations must follow the normal
distribution.2. The populations must have equal standard
deviations.3. The samples are from independent
populations.
Small sample test of means c o ntinue d
Finding the value of the test statistic requires two steps.Step 1: Pool the sample standard deviations.
2
)1()1(
21
222
2112
−+−+−=
nn
snsnsp
+
−=
21
2
21
11nn
s
XXt
p
Step 2: Determine the value of t from the following formula.
Or:
1 2
2 21 1 2 2
1 2 1 2
( 1) ( 1) 1 12
X Xt
n s n sn n n n
−= − + − + ÷ ÷+ −
Contoh 2 Sebuah studi oleh EPA membandingkan
konsumsi bahan bakar mobil penumpang domestik dan impor. Sebuah sampel yang terdiri dari15 mobil domestik menunjukkan rata-rata sebesar 33,7 mil/galon dengan deviasi standar 2,4 mil/galon. Sampel12 mobil impor menunjukkan rata-rata 35,7 mpg dengan deviasi standar 3,9.
Pada tingkat signifikansi 0,05 dapatkah EPA menyimpulkan bahwa konsumsi bahan bakar mobil impor lebih tinggi?
Example 2 c o ntinue d
Step 1: State the null and alternate hypotheses. H0: µD ≥ µI ; H1: µD < µI
Step 2: State the level of significance. The .05 significance level is stated in the problem.
Step 3: Find the appropriate test statistic. Both samples are less than 30, so we use the t distribution.
EXAMPLE 2 c o ntinue d
Step 4: The decision rule is to reject H0 i f t<-1.708. There are 25 degrees of freedom.
708.1−=αt 0
Rejection Region α = 0.05
05.0
:
:0
=<
≥
αµµµµ
IDA
ID
H
H
Probabil i ty density of t stat ist ic : t (df=25)
EXAMPLE 2 c o ntinue d
918.921215
)9.3)(112()4.2)(115(
2
))(1())(1(
22
21
222
2112
=−+
−+−=
−+−+−=
nn
snsnsp
Step 5: We compute the pooled variance:
Example 2 c o ntinue d
We compute the value of t as follows.
1 2
2
1 2
1 1
33.7 35.71.640
1 19.918
15 12
p
X Xt
sn n
−=
+ ÷
−= =− + ÷
Example 2 c o ntinue d
708.1−=αt 0
Rejection Region α = 0.05
05.0
:
:0
=<
≥
αµµµµ
IDA
ID
H
H
-1.640H0 is not rejected. There is insufficient sample evidence to claim a higher mpg on the imported cars.
Hypothesis Testing: 3. Involving Pa ire d Observations
Independent samples are samples that are not related in any way.
Dependent samples are samples that are paired or related in some fashion. For example: If you wished to buy a car you would look at the same car at two (or more) different dealerships and compare the prices.
If you wished to measure the effectiveness of a new diet you would weigh the dieters at the start and at the finish of the program.
Hypothesis Testing Involving Pa ire d Observations (dependent sample)
Use the following test when the samples are dependent:
where is the mean of the differences is the standard deviation of the differences n is the number of pairs (differences)
or
ns
dt
d
=
dsd
dd n= ∑
2( )
1d
d ds
n
∑ −=−
22 ( )
1d
dd
nsn
∑∑ −=
−
Contoh 3 Sebuah lembaga survei independen
membandingkan biaya sewa harian untuk menyewa mobil dari Hertz dan Avis. Sebuah sampel acak dari delapan kota menunjukkan informasi yang tercatat dalam tabel. Pada tingkat signifikansi 0.05 dapat lembaga survei tersebut menyimpulkan bahwa ada perbedaan dalam sewa yang dibebankan?
EXAMPLE 3 c o ntinue d
City Hertz ($) Avis ($)
Atlanta 42 40
Chicago 56 52
Cleveland 45 43
Denver 48 48
Honolulu 37 32
Kansas City 45 48
Miami 41 39
Seattle 46 50
EXAMPLE 3 c o ntinue d
Step 1: State the null and alternate hypotheses.
H0: µd = 0 ; H1: µd ≠ 0
Step 2: State the level of significance. The .05 significance level is stated in the problem.
Step 3: Find the appropriate test statistic. We can use t as the test statistic.
EXAMPLE 3 c o ntinue d
Step 4: State the decision rule. H0 is rejected if t < -2.365 or t > 2.365. We use the t distribution with 7 degrees of freedom.
365.22/ =αt
H0: µB ≤ µK ; H1: µB > µK
Rejection Region IIprobabil i ty=0.025
Acceptance Region α = 0.05
Rejection Region IProbabil i ty =0.025
365.22/ −=αt
Probabil i ty density of t stat ist ic : t (df=7)
Example 3 c o ntinue d
City Hertz ($) Avis ($) d d2
Atlanta 42 40 2 4
Chicago 56 52 4 16
Cleveland 45 43 2 4
Denver 48 48 0 0
Honolulu 37 32 5 25
Kansas City 45 48 -3 9
Miami 41 39 2 4
Seattle 46 50 -4 16
Example 3 c o ntinue d
00.18
0.8 ==Σ=n
dd
( )1623.3
1888
78
1
222
=−
−=
−
Σ−Σ=
nnd
dsd
894.081623.3
00.1 ===ns
dt
d
Example 3 c o ntinue d
Step 5: Because 0.894 is less than the critical value, do not reject the null hypothesis. There is no difference in the mean amount charged by Hertz and Avis.
365.22/ =αt
H0: µB ≤ µK ; H1: µB > µK
Rejection Region IIprobabil i ty=0.025
Acceptance Region α = 0.05
Rejection Region IProbabil i ty =0.025
365.22/ −=αt
0.894
Hypothesis Testing: 4. Two Sample Tests of Proportions We investigate whether two samples came
from populations with an equal proportion of successes.
The two samples are pooled using the following formula.
where X1 and X2 refer to the number of successes in the respective samples of n 1 and n 2.
21
21
nn
XXpc +
+=
Two Sample Tests of Proportions c o ntinue d
The value of the test statistic is computed from the following formula.
or21
21
)1()1(npp
npp
ppz
cccc −+−−=
1 2
1 2
ˆ ˆ
1 1(1 )c c
p pZ
P Pn n
−=
− + ÷
Contoh 4
Apakah pekerja yang belum menikah (unmarried) lebih cenderung absen dari pekerjaan dari pekerja menikah (married)? Sebuah sampel 250 pekerja menikah menunjukkan 22 absen lebih dari 5 hari tahun lalu, sementara sampel 300 pekerja menikah menunjukkan absen lebih dari lima hari. Gunakan tingkat signifikansi .05.
Example 4 c o ntinue d
The null and the alternate hypothesis are:
H0: πU ≤ π M H1: π U > π M
The null hypothesis is rejected if the computed value of z is greater than 1.65.
Example 4 c o ntinue d
The pooled proportion is
1036.250300
2235 =++=cp
The value of the test stat ist ic is
10.1
250)1036.1(1036.
300)1036.1(1036.25022
30035
=−+−
−=z
Example 4 c o ntinue d
The null hypothesis is not rejected. We cannot conclude that a higher proportion of unmarried workers miss more days in a year than the married workers.
The p -value is:P(z > 1.10) = .5000 - .3643 = .1457
Contoh 1
Seorang dosen berpendapat bahwa nilai ujian kls A lebih rendah dari pada kls B. Suatu penelitian dilakukan untuk menguji pendapat tersebut dengan sampel masing-masing 50 orang. Hasilnya rata-rata kls A 60 dengan simpangan baku 15 dan rata-rata kls B 70 dengan simpangan baku 20. Ujilah pendapat tersebut dengan α = 5%
Contoh 2
Mhs UTS UASA 64 54B 62 77C 45 50D 66 54E 70 89F 62 56G 80 72H 54 65I 65 76
Dengan α = 0,05 ujilah apakah ada perbedaan nilai UTS dan UAS ?
Contoh 4
Pimpinan perusahaan berpendapat bahwa konsumen lebih menyukai produk A dari pada B. Untuk membuktikan pendapat tsb tim marketing melakukan penelitian dengan mengambil sampel 200 orang. Hasilnya 70 orang menyukai produk A dan 65 orang menyukai produk B. Ujilah dengan taraf signifikansi 5%
- END -
Chapter ElevenTwo Sample Tests of Two Sample Tests of HypothesisHypothesis