UJI HIPOTESIS
Materi 5 Prof. Dr. Ir. Sugiarto, M.Sc
Tujuan Studi: Pengujian Hipotesis
Completely Randomized Design:
One-way ANOVA
One-way ANOVA: Testing the Hypothesis of Three or
More Equal Population Means
Assumptions:
The sampled populations follow the normal
distribution.
The populations have equal standard deviations.
The samples are randomly selected and are
independent.
Testing the Hypothesis of Three or More Equal
Population Means
• The null hypothesis is when the population means are all the same.
• The alternative hypothesis is when at least one of the means is different.
• The test statistic is the F distribution.
• The decision rule is whether to reject the null hypothesis if F (computed)
is greater than F (table) with numerator and denominator degrees of
freedom or using p value.
• Hypothesis Setup and Decision Rule:
H0: µ1 = µ2 =…= µk
H1: The means are not all equal.
Reject H if F > F level
Reject H if p-value <0 significance,k-1,n-k
0
Testing the Hypothesis of Three or More Equal
Population Means – Example
Recently a group of four major carriers
joined in hiring Brunner Marketing
Research, Inc., to survey recent
passengers regarding their level of
satisfaction with a recent flight. The
survey included questions on ticketing,
boarding, in-flight service, baggage
handling, pilot communication, and so
forth.
Twenty-five questions offered a range of
possible answers: excellent, good, fair, or
poor. A response of excellent was given a Is there a difference in the mean
score of 4, good a 3, fair a 2, and poor a satisfaction level among the four
1. These responses were then totaled, so airlines?
the total score was an indication of the Use the .01 significance level.
satisfaction with the flight. Brunner
Marketing Research, Inc., randomly
selected and surveyed passengers from
the four airlines.
12-6
Testing the Hypothesis of Three or More Equal
Population Means – Example
Step 1: State the null and alternate hypotheses.
H0: µN = µW = µP = µB
H1: The means are not all equal.
Step 2: State the level of significance.
The .01 significance level is stated in the problem.
Step 3: Find the appropriate test statistic.
Because we are comparing means of more than two groups,
use the F statistic.
LO12-2
Testing the Hypothesis of Three or More Equal
Population Means – Example
• Step 4: Formulate a decision rule. The F-statistic will be used to
formulate the decision rule. The F-statistic is a ratio of two
variances, each divided by their degrees of freedom. These are
called mean squares. For this ANOVA, we will divide the
treatment mean square by the error mean square. Therefore, we
need the degrees of freedom for treatments and error to find the
F value for the decision rule.
The degrees of freedom in the numerator:
(Number of treatments – 1) = (k - 1) = 4 - 1 = 3
The degrees of freedom in the denominator:
(Total number of observations – Number of treatments) = (n – k) =
(22 - 4) = 18
LO12-2
Testing the Hypothesis of Three or More Equal
Population Means – Example
From the F-table with the .01 level of significance, the critical
value of F with 3 numerator and 18 denominator degrees of freedom is 5.09.
Numerator degrees of freedom
Reject H0 if F > F,k-1,n-k
or
Denominator degrees of freedom
Reject H0 if F > 5.09
LO12-2
Testing the Hypothesis of Three or More Equal
Population Means – Example
Step 5: Compute the value of F and make a decision.
Creating the Analysis of Variance table:
12-10
Creating the ANOVA Table: Treatment Sum of
Squares, SST, and the ANOVA Table
Step 5 (continued): Compute the value of F and make a decision. The
computed value of F is 8.99, which is greater than the critical value of 5.09, so
the null hypothesis is rejected.
12-11
p-Value in Hypothesis Testing
• p-VALUE is the probability of observing a sample value as extreme as, or more
extreme than, the value observed, given that the null hypothesis is true.
• In testing a hypothesis, we can also compare the p-value to the significance level
().
• Decision rule using the p-value:
Reject H0 if p-value < significance level
10-12
One-way ANOVA with Excel
12-13
Select Menu Data, then click Data analysis.
Select Anova single factor . Click Ok
12-14
Then a display like the following will appear and fill in the input
range, grouped By, label in the first row and ouput range, then click
Ok
12-15
Interpret the result. The population means are
not all equal. The mean scores are not the same for the four airlines; at this point we can only
conclude there is a difference in at least one pair of treatment means. We cannot determine
which of the airlines’ satisfaction mean scores differ (Use Post Hoc Test by SPSS).
Anova: Single Factor
SUMMARY
Groups Count Sum Average Variance
Northern 4 349 87,25 36,91667
WTA 5 391 78,2 58,7
Pocono 7 510 72,85714 30,14286
Branson 6 414 69 13,6
ANOVA
Source of
Variation SS df MS F P-value F crit
Between Groups 890,6838 3 296,8946 8,990643 0,000743 3,159908
Within Groups 594,4071 18 33,02262
Total 1485,091 21
12-16
One Way ANOVA With SPSS
Input data:Click variable view
Click
data
view
Click Menu Analyze, Compare Means, One Way ANOVA
Click Post Hoc
Click continue, click Ok
Post Hoc Tests
Randomized Block Design
• Randomized Block Design is an experimental design which is a development of Completely
Randomized Design, in which a single categorical extraneous variable that can affect the response
of the experimental unit to treatment is identified and the effect of this variable is isolated by
being blocked (group).
• The clustering effectively controlled for an extraneous cause in the experimental analysis.
• The Randomized Block Design is a basic design that uses local control with limited randomization
• In a Randomized Block Design, the experimental material is divided into several groups based on
the homogeneity of the experimental material, and each group is a replication.
Randomized Block Design
• It was attempted during the experiment that the variance in the groups remained
small, meaning that the techniques applied during the experiment were attempted
to be uniform for the experimental units in each group.
• This can be done by allocating experimental units into groups in such a way that the
experimental units in the same group are relatively homogeneous.
• Each group contains a complete treatment.
• By using a Randomized Block Design, each treatment received the same replication.
• In general, it can be said that Randomized Block Design is used when the
experimental material is not homogeneous or there is one other factor besides
treatment that can cause variance.
• Placement of treatment in experimental units was randomized to each group.
Randomized Block Design
Example:
• An experiment was conducted using a Randomized Block Design with six treatments and four
replications.
• First, the experimental material was divided into four groups. Materials that are relatively
homogeneous are grouped together so that the variance in the group remains small.
• Each group was divided into six experimental units, meaning a total of 24 experimental units. First,
randomization was carried out in the first group, then repeated in the other group.
• Randomization was carried out using a random table as was the case in Completely Randomized
Design, but here it was carried out per repetition not all at once, meaning there were limitations in
randomization.
Randomized Block Design
Group Random Design Layout
Latin Square Design
• In the Latin Square Design, the grouping is done in two directions, namely rows and column, so
that the variance between rows and between column can be excluded from random errors.
• In Randomized Block Design, grouping is only done in one direction. By using a Latin square design,
it means that two sources of variance other than the variance caused by treatment can be
eliminated, whereas with a randomized block design there is only one source of variance.
• The Latin square design is generally used when there are two other sources of variance in the
experiment in addition to the variance caused by the treatment.
Latin Square Layout 4x4
Factorial Design
• Factorial Design is an experiment that
investigates the interaction of two or more
independent variables on a single
dependent variable.
• An experiment is called a factorial
experiment if the treatment consists of a
complete combination of levels (between
levels) of two or more factors and each
factor consists of two or more levels.
Factorial Experiments
• The experiments described previously were used only to test the effect of
one factor.
• In fact, there are many factors that influence a process. There are factors
that work alone, there are factors that work together with other factors.
• If the researcher only examines the effect of one factor, it is felt that
understanding of the actual event is very lacking, so many researchers
conduct experiments with more than one factor to determine the effect
of each factor and the cooperation between the factors being tried.
• This desire of researchers can be fulfilled if the research is carried out
using factorial experiments
Factorial Experiments
The factorial experiment produces the following main effects and interaction
effects:
•Main Effect. The main effect shows the influence of the independent
variable on the dependent variable. The main effect represents the
experimental difference in the mean of the dependent variable between the
different levels of each single experimental variable.
•Interaction Effect. The interaction effect indicates the difference in the
mean of the dependent variable caused by the specific combination of
independent variables. The interaction effect shows the effect on the
dependent variable that is caused by the combination of two or more
independent variables. Interaction occurs when the effect of one treatment
is different at various levels of the other treatment
Randomized Block Design, Latin Square, Factorial
Experiments: Two-way ANOVA
• Two-way ANOVA: Testing the Hypothesis of Three or More Equal
Population Means Using a Blocking Variable. For the two-factor
ANOVA, we test whether there is a significant difference between the
treatment effect and whether there is a difference in the blocking
effect.
• The two-way ANOVA table now includes a “blocks” source
of variation in addition to treatment, error, and total.
Notice there are “b” blocks.
Two-Way ANOVA: Testing the Hypothesis of Three or More Equal
Population Means using a Blocking Variable
WARTA, the Warren Area Regional
Transit Authority, is expanding bus
service from the suburb of Starbrick into
the central business district of Warren.
There are four routes being considered
from Starbrick to downtown Warren:
(1) via U.S. 6, (2) via the West End, (3)
via the Hickory Street Bridge, and (4) via
Route 59.
WARTA conducted several tests to determine whether there was a difference in the
mean travel times along the four routes. Because there will be many different drivers, the
test was set up so each driver drove along each of the four routes. The next slide shows
the travel time, in minutes, for each driver-route combination. At the .05 significance level,
is there a difference in the mean travel time along the four routes? If we remove the effect
of the drivers, is there a difference in the mean travel time?
This is a two-way ANOVA. The routes are the treatments and the drivers are the blocks.
12-34
Two-Way ANOVA: Testing the Hypothesis of Three
or More Equal Population Means Using a Blocking
Variable – Example
Observed Sample Data:
Two-Way ANOVA: Testing the Hypothesis of Three or
More Equal Population Means Using a Blocking
Variable – Example
Step 1: State the null and alternate hypotheses.
H0: µu = µw = µh = µr
H1: Not all treatment means are the same.
Step 2: State the level of significance.
The .05 significance level is stated in the problem.
Step 3: Find the appropriate test statistic.
Because we are comparing means of more than two groups,
use the F-statistic.
Two-Way ANOVA: Testing the Hypothesis of Three
or More Equal Population Means Using a Blocking
Variable – Example
• Step 4: Formulate a decision rule. The F-statistic will be used to
formulate the decision rule. The F-statistic is a ratio of two
variances, each divided by their degrees of freedom. These are
called mean squares. For the two-way ANOVA, we will divide the
treatment mean square by the error mean square. Therefore, we
need the degrees of freedom for treatments and error to find the
F value for the decision rule.
The degrees of freedom in the numerator:
(Number of treatments – 1) = (k – 1) = 4 – 1 = 3
The degrees of freedom in the denominator:
(Number of treatments – 1)(Number of blocks – 1) =
(k – 1)(b - 1) = (4 – 1)(5 – 1) = (3)(4) = 12
Two-Way ANOVA: Testing the Hypothesis of Three
or More Equal Population Means Using a Blocking
Variable – Example
From the F-table with the .05 level of significance, the critical
F value with 3 numerator and 12 denominator degrees
of freedom is 3.49.
Numerator degrees of freedom
Step 4: State the decision rule.
Reject H0 if F > F,v1,v2
Denominator degrees of freedom
F > F.05,k-1,(k – 1)(b – 1)
F > F.05,4-1,(4 – 1)(5 – 1)
F > F.05,3,12
F > 3.49
Two-Way ANOVA: Testing the Hypothesis of Three or More Equal
Population Means – Example Using a Blocking Variable
Step 5: Compute the value of F and make a decision. The computed value of F is 7.93,
which is greater than the critical value of 3.49, so the null hypothesis is rejected.
Step 6: Interpret the Result. At least one pair of mean route times are different.
12-39
LO12-4
Two-Way ANOVA: Testing the Hypothesis of Three or More
Equal Population Means Using a Blocking Variable – Excel
Example
Using Excel to perform the calculations, we conclude:
(1)The mean time is not the same for all drivers.
(2)The mean times for the routes are not all the same.
Two Way Anova with Excel
• On the menu, click Data, Data Analysis
Choose Anova: Two Factor Without
Replication. Click OK.
In the Input Range box, point to cells B2 to E6.
In the Output Range box, point to cell A10.
Click OK.
The following results were obtained:
Conclusion
Using Excel to perform the calculations, we conclude:
(1)The mean time is not the same for all drivers.
(2)The mean times for the routes are not all the same
Two-way ANOVA with Replication
With Excel
Click Data, Data Analysis
Klik Define Range, untuk pengisian Minimum ketikkan 1 dan untuk pengisian Maximum ketikkan 3
Dari hasil uji didapat nilai Kruskall Walis yang dalam hal ini ditunjukkan oleh Chi-Square sebesar 4.271 dengan Asymp Sig sebesar
0.118. Nilai Asymp Sig 0.118 > 0.05, dengan demikian disimpulkan bahwa tidak cukup bukti untuk menolak Ho. Hasil temuan
menyatakan tidak didapati perbedaan kinerja dari 3 tipe penggajian tenaga staff penjualan.
• Uji Cochran termasuk dalam keluarga statistika nonparametrik. Uji Cochran digunakan untuk melakukan pengujian
terhadap n populasi yang berhubungan.
•
• Kapan Uji Cochran digunakan?
• Uji Cochran digunakan pada saat pengguna ingin melakukan pengujian terhadap n populasi yang berhubungan,
pada kondisi data yang diuji memiliki skala ukur nominal, dengan kasus dikotomi (hanya ada dua kemungkinan
pilihan).
• PT Digital Capital Market telah mengembangkan empat software moving average baru dalam rangka menjawab
kebutuhan para analis di pasar saham. Ke empat software baru yang dikembangkan tersebut (dinyatakan dalam
kode A, B, C dan D) memiliki kemampuan menyajikan hasil moving average yang diyakini lebih komprehensif
dibandingkan software- software yang saat ini beredar di pasar dan banyak digunakan oleh para analis saham
dalam melakukan technical analysis. Dari empat software baru yang dikembangkan tersebut, satu sama lain
berbeda spesifikasinya. Masing-masing software telah dilengkapi fitur-fitur yang disinyalir dibutuhkan oleh para
analis saham. Meskipun demikian masing-masing software tetap saja memiliki keunggulan dan kekurangan
dibandingkan yang lainnya. Sebelum ke empat software diluncurkan ke pasar, PT Digital Capital Market
melakukan uji pendahuluan untuk memperoleh gambaran tanggapan para analis terhadap ke empat software
yang akan diluncurkan tersebut. Dalam uji coba diminta kesediaan 12 analisis pasar saham yang terkemuka untuk
mencoba ke empat software tersebut dan diminta memberi tanggapan preferensi untuk setiap software. Setiap
analis saham diminta menilai kemampuan dari keempat software tersebut dan sebagai tanggapannya setiap
analis boleh menyukai lebih dari satu bahkan ke empat software yang dikembangkan tersebut namun boleh juga
tidak menyukai sama sekali. Bila analis saham menyukai software yang dikembangkan, mereka diminta memberi
nilai 1 (satu) dan sebaliknya bila mereka tidak menyukai diminta memberi nilai 0 (nol). Hasil uji coba tertera pada
tabel berikut:
• Dalam penelitian ini ditetapkan hipotesis
sebagai berikut:
• Ho: analis saham menunjukkan kesukaan
yang sama terhadap ke empat software
yang dikembangkan PT Digital Capital
Market
• Ha: setidaknya didapati adanya
perbedaan kesukaan analis saham
terhadap ke empat software yang
dikembangkan PT Digital Capital Market
Menu Analize, klik Nonparametric Test, klik Legacy Dialogs, klik k Related Samples
• Hasil analisis menunjukkan nilai Cochran's Q sebesar
4.784, dengan Asymp. Sig. sebesar 0,188 > 0,05,
sehingga dapat disimpulkan tidak cukup bukti untuk
menolak H0 , dengan demikian analis saham
menunjukkan kesukaan yang sama terhadap ke
empat software yang dikembangkan PT Digital Capital
Market.
• Uji Friedman merupakan uji yang termasuk dalam keluarga statistika nonparametrik. Uji ini digunakan untuk
menguji ukuran pemusatan lebih dari dua populasi, analog dengan Two Way ANOVA pada uji statistika parametrik.
•
• Kapan Uji Friedman digunakan?
1. Uji Friedman digunakan pada saat melakukan pengujian terhadap n populasi yang berhubungan, pada kondisi data
yang diuji bukan dikotomi (tidak hanya ada dua kemungkinan pilihan).
2. Skala ukur unit amatan nominal atau ordinal
3. Skala ukur unit amatan interval atau rasio, namun data tidak berdistribusi Normal
4. Sampel yang digunakan berukuran kecil (< 30)
• Telah dihasilkan cake yang diproduksi menggunakan tiga jenis bahan baku tradisional Indonesia. Terhadap ke tiga
cake yang dihasilkan tersebut diberikan kode A, B dan C. Cake A berbahan baku rebung, cake B berbahan baku
daun teh, cake C berbahan baku lobak. Dengan kandungan bahan baku lainnya yang serba sama, dilakukan
pengujian apakah didapati perbedaan kelezatan dari cake yang dihasilkan. Enam orang penguji rasa yang
merupakan pakar di bidang cake diminta melakukan penilaian dengan memberikan skor 0 bila menurut mereka
rasa cake yang dicoba biasa saja , skor 1 bila dirasa cake yang dicoba lezat, dan skor 2 bila menurut mereka cake
yang dicoba sangat lezat.
• Dari hasil uji rasa didapat nilai Friedman yang dalam
hal ini ditunjukkan oleh Chi-Square sebesar 8.435,
dengan Asymp Sig sebesar 0.015. Nilai Asymp Sig 0.015
< 0.05, dengan demikian disimpulkan bahwa Ho
ditolak, berarti tidak semua cake yang dihasilkan
menggunakan bahan baku yang berbeda-beda tersebut
memiliki rata-rata kelezatan yang sama.