2.chi square edit

28
Noorlaily Fitdiarini 1

Upload: igusti-ayu-astrid-skw

Post on 03-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 1/28

Noorlaily Fitdiarini

1

Page 2: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 2/28

Page 3: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 3/28

Comparing the tallies or counts of categorical responses between twoindependent groups  two way cross-classification table (contingency table )

H0: there is no difference between the twopopulation proportions◦ H 0 : p 1=p 2 

H1: two population proportions are not thesame◦ H 0 : p 1≠p 2 

3

Page 4: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 4/28

It is never negative There is a family of chi-square distributions

◦ The shape of the chi-square distribution does notdepend on the size of the sample, but the number

of categories used (k) It is positively skewed

◦ As the number of both d.f. increases, thedistribution begins to approximate the normaldistribution

4

Page 5: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 5/28

5

CHI-SQUARE DISTRIBUTION 

df = 3

df = 5

df = 10

c2

 2-2

Page 6: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 6/28

Compare several proportion (Multinomial Test )

One of nonparametric or distribution-free tests of hypothesis

Data : nominal-scale or ordinal-scale

The test statistic is :

test statistic is equal to the squared difference between theobserved and expected frequencies, divided by the expectedfrequency in each cell of the table

f 0  is observed frequency in a particular cell of a contingency

table f e  is theoretical or expected frequency in a particular cell if the

null hypothesis is true

2 c 

6

e

e

  f  

  f    f   x

2

02

Page 7: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 7/28

RowVariable

Column variable (group)

1 2 totals

successe

s

 X 1 X 2   X 

failures n1-X 1 n2 -X n-X 

totals n1 n2  n

7

Page 8: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 8/28

X 1= number of successes in group 1 X 2 = number of successes in group 2 n 1-X 1= number of failures in group 1 n 2 -X 2 = number of failures in group 2

X= X 1+ X 2  is the total number of successes n-X=(n 1-X 1 )+(n 2 -X 2  ) is the total number of 

failures n 1=the sample size in group 1

n 2 =the sample size in group 2 n=n 1+n 2  is the total sample size 

8

Page 9: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 9/28

Choose

hotel

again?

Hotel

Sheratonlagoon

SheratonNusa Dua

Total

yes 163 154 317

no 64 108 172

Total 227 262 489

9

Page 10: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 10/28

Chi-Square Test: Lagoon, Nusa Dua

Expected counts are printed below observed counts

Lagoon Nusa Dua Total

1 163 154 317

147.16 169.84

2 64 108 172

79.84 92.16

Total 227 262 489

Chi-Sq = 1.706 + 1.478 +

3.144 + 2.724 = 9.053

DF = 1, P-Value = 0.003

10

Page 11: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 11/28

Chi-square test is used to :◦ Test whether an observed set of frequencies couldhave come from a hypothesized populationdistribution

◦ Determine whether the sample observations come

from a particular distribution such as the normaldistribution

◦ Contingency table analysis, is used to test whethertwo traits or characteristics are related (Test of 

Independency )

11

Page 12: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 12/28

 

12

00

(1-α)

α 

χ 2 Region of non-rejection

Region of rejectionCritical value

Reject H0 if χ 2>χ 2U

Otherwise do not reject H0 

Page 13: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 13/28

If the null hypothesis is true, the computed

statistic should be close to zero because thesquared difference between what is actuallyobserved in each cell f 0 , and what is theoretically

expected f e , would be very small On the other hand, if H0 is false, and there are real

differences in the population proportions, thecomputed statistic is expected to be large. Thisis because the difference between what is actually

observed in each cell and what is theoreticallyexpected will be magnified when the difference aresquared

2 c 

2 c 

13

Page 14: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 14/28

The purpose of Goodness-of-Fit Test is tocompare an observed set of frequencies(fo) to an expected set of frequencies (fe).

Ho: no difference between fo and fe H1: there is a difference between fo and fe

The critical value is a chi-square value with

(k - 1) degrees of freedom, where k is thenumber of categories

14

Page 15: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 15/28

 Pemain

JumlahTerjual (fo)

Jumlah yangdiharapkan Terjual

(fe)

Owen 13 20

Ronaldo 33 20

Nesta 14 20

Dida 7 20

Becham 36 20

Zidane 17 20

TOTAL 120 120

15

Page 16: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 16/28

Pemain fo fe (fo –

fe) (fo –

fe)2 

Owen 13 20 -7 49 2,45

Ronaldo 33 20 13 169 8,45

Vieri 14 20 -6 36 1,80

Buffon 7 20 -13 169 8,45

Becham 36 20 16 256 12,80

Zidane 17 20 -3 9 0,45

0 34,40

16

e

eo

  f    f    f  

2

)(

2

 X 

Page 17: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 17/28

Contoh :Dosen mengharapkan distribusi nilai ujian: A = 40%, B = 40%, dan C = 20%. Hasil

ujian menunjukkan distribusi nilai sebagaiberikut :

A : 30 orang B : 20 orang C : 10 orang

Uji dengan level of significance 10%,apakah distribusi nilai tersebut sesuaidengan harapan dosen tersebut ?

17

Page 18: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 18/28

If there are only two cells, the expectedfrequency in each cell should be 5 or more

For more than two cells, Chi-Square should notbe used if more than 20% of the expected

frequency cells have expected frequency lessthan 5.

18

Page 19: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 19/28

Level of Management fo fe

Foreman 30 32

Supervisor 110 113

Manager 86 87

Middle Manager 23 24

 Assistant vice president  5 2

Vice president  5 4Senior vice president  4 1

TOTAL 263 263

19

Page 20: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 20/28

Level of Management fo fe

Foreman 30 32

Supervisor 110 113

Manager 86 87

Middle Manager 23 24

Vice president  14 7

TOTAL 263 263

20

Page 21: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 21/28

Purpose: To test whether the observedfrequencies in a frequency distribution matchthe theoretical normal distribution.

Procedure:◦ Determine the mean and standard deviation of the

frequency distribution.◦ Compute the z-value for the lower class limit and

the upper class limit for each class.◦ Determine fe for each category◦ Use the chi-square goodness-of-fit test to

determine if fo coincides with fe.

21

Page 22: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 22/28

Salary ($ 000) frequency20  – 30 4

30  – 40 20

40 –

50 4150  – 60 44

60  – 70 29

70  – 80 16

80  – 90 2

90  – 100 4

TOTAL 16022

76.13

03.54

  

 

Page 23: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 23/28

Salary (S 000) Z Value Area fe

Under 30 Under  –

1.75 0.0401 6.41630  – 40 -1.75 to -1.02 0.1138 18.208

40  – 50 -1.02 to -0.29 0.2320 37.120

50 –

60 -0.29 to 0.43 0.2805 44.88060  – 70 0.43 to 1.16 0.2106 33.696

70  – 80 1.16 to 1.89 0.0936 14.976

80 or more over 1.89 0.0294 1.704

1 160

23  

 

x Z 

Page 24: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 24/28

Salary (S 000) fo fe (fo –

 fe) (fo –

fe)2 

Under 30 4 6.416 -2.416 5.837 0.910

30  – 40 20 18.208 1.792 3.211 0.176

40  – 50 41 37.120 3.880 15.054 0.406

50  – 60 44 44.880 -0.880 0.774 0.017

60  – 70 29 33.696 -4.696 22.052 0.654

70  – 80 16 14.976 1.024 1.049 0.07080 or more 6 1.704 1.296 1.680 0.357

160 160 2.590

24

e

eo

  f  

  f    f   2)(

2

 X 

Page 25: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 25/28

Suppose we knew the mean and standarddeviation of population but wished to find

whether some sample data conform tothe normal distribution,d.f. = k - 1

On the other hand, if we don’t know the

mean and standard deviation of population but we wish to test whethersome sample data follow the normaldistribution,

d.f. = k – p – 1 (where p is the number of populationparameter being estimated from thesample data)

25

Page 26: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 26/28

Contingency table analysis is used to testwhether two traits or variables are related.

Two-way classification table Each observation is classified according to two

variables. d.f. : (number of rows-1)(number of columns-

1). The expected frequency (fe) is computed as:

Coefficient of Contingency :

26

total Grand 

total Coloumntotal  Row  f  e _ 

 _  _ 

 N  X 

 X C 

2

2

Page 27: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 27/28

Manajer produksi meneliti tingkat kerusakanpada mesin produksi. Hasilnya pengamatanterhadap barang yang diproduksi sebagaiberikut

Apakah kerusakan tersebut disebabkanmesin atau kebetulan saja ? Uji dengan =0,05

l 27

Kondisi Mesin 1 Mesin 2 Mesin 3Rusak 12 15 6

Baik 88 105 74

Page 28: 2.Chi Square edit

7/28/2019 2.Chi Square edit

http://slidepdf.com/reader/full/2chi-square-edit 28/28

Lembaga riset meneliti apakah adahubungan antara jenis surat kabar yangdibaca dengan kelompok masyarakat.Hasilnya sebagai berikut :

Uji dengan = 0,1

28

Surat Kabar Kelompok A B C

 Atas 170 124 90

Menengah 120 112 100Bawah 130 90 88