PowerPoint...

31
Ch 15 實習(珊彗)

Transcript of PowerPoint...

Page 1: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

Ch 15 實習(珊彗)

Page 2: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

2

Agenda

ANOVA與chi-square檢驗差異?

Chi-square主要功能?

A goodness-of-fit test for the multinomial

experiment.

檢定是否符合某分配(任何分配都可以)

A contingency table test

獨立性檢定

齊一性檢定

Page 3: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

兩者差異在哪?

3

ANOVA Chi-square

1. Y在兩個不同的統計方法中,代表的是什麼意思?

2. ANOVA檢定什麼?Chi-square test 檢定什麼?

Page 4: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

兩者差異在哪?

4

ANOVA Chi-square

1. Y在 ANOVA表示連續的資料( BA&Accounting的學生,其收入為 31美元)

Y在chi-square test of fit是個數 (表示有31 個學生,屬於BA & accounting

2. Chi-square test 檢定什麼? • MBA major 三類比例有無差異 (或degree四類比例有無差異)

• 檢驗MBA major與degree是否獨立

3. ANOVA檢定什麼? • MBA major 三類平均有無差異 (或degree四類平均有無差異)

Page 5: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

5

1. Chi-Squared Goodness-of-Fit Test We test whether there is sufficient evidence to reject a

pre-specified set of values for pi. Step1:設定假設

Step2:找critical point

Step3: The statistic is

ii

kk

aponeleastAtH

apapapH

:

,...,,:

1

22110

2

1k,

2

ii

k

1i i

2

ii2

npewhere

e

)ef(

Step4:結論

Page 6: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

6

1. Required conditions – the rule of five

The test statistic used to perform the test is only approximately Chi-squared distributed.

For the approximation to apply, the expected cell frequency has to be at least 5 for all the cells (npi < 5).

If the expected frequency in a cell is less than 5, combine it with other cells.

Page 7: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

7

Example 1

Consider a multinomial experiment involving n=300 trials

and k=5 cells. The observed frequencies resulting from

the experiment are shown in the accompanying table,

and the null hypothesis to be tested is as follows (a=0.01)

H0:p1=.1,p2=.2,p3=.3,p4=.2,p5=.2

Test the hypothesis at the 1% significance level.

Cell 1 2 3 4 5

Frequency 24 64 84 72 56

Page 8: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

8

Solution 1 Step1:設定假設

H0: p1=0.1, p2=0.2, p3=0.3, p4=0.2, p5=0.2

H1: At least one pi is not equal to its specified value

Step2:找critical point

Step3: The statistic is

3.132

15,01.0

2

1,

2 k

ii

k

i i

ii

npewhere

e

ef

54.4)(

1

22

Step4:結論

13.3

4.54

There is no enough evidence to infer that at least one pi is not equal to its specific value

Page 9: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

9

Solution 1

H0: p1=0.1, p2=0.2, p3=0.3, p4=0.2, p5=0.2

H1: At least one pi is not equal to its specified value

ii

k

1i i

2

ii2

npewhere

e

)ef(

實際值 理論值n.p

Page 10: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

10

2. 檢定是否符合某分配(任何分配都可以)

Chi-Squared test for Normality

Step1:設定假設

Step2:找critical point

Step3: The statistic is

ddistribute normalnot are data The :H1

ddistribute normal are data The :H0

2

1,

2

pk

要查表才會知道p

npewhere

e

ef

ii

k

i i

ii

1

22 )(

Step4:結論

Page 11: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

Example 2 (Q6)

Chi-Squared test for Normality

11

Page 12: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

12

Solution 2

Chi-Squared test for Normality

Step1:設定假設

Step2:找critical point

Step3: The statistic is

ddistribute normalnot are data The :H1

ddistribute normal are data The :H0

8415.32

124,05.0

2

12,

2 k

要查表才會知道p

npewhere

e

ef

ii

k

i i

ii

1

22 6216.4

)(

Step4:結論

3.8415

4.6216

Page 13: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

Solution 2

13

實際值 理論值n.p=40*p 查表

ei=n*p=40*0.1587=6.348

Page 14: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

14

Z Z<-1 -1<Z<0 0<Z<1 Z>1

P(面積) 0.1587 0.3413 0.3413 0.1587

X X<20.422 20.422<X<26.8 26.8<X<33.18 X>33.18

f 4 20 11 5

0.5-0.1587=0.3413 0.8413-0.5=0.3413

-1 0 1

Page 15: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

15

Page 16: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

16

Page 17: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

17

Z Z<-1 -1<Z<0 0<Z<1 Z>1

P(面積) 0.1587 0.3413 0.3413 0.1587

X X<20.422 20.422<X<26.8 26.8<X<33.18 X>33.18

f 4 20 11 5

原始資料有20筆介於20.44<X<26.8範圍

Page 18: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

Example 3

誠品書店project 在做什麼?

蒐集資料,看單位時間來客數,是否符合poisson分配?

誰是fi 誰是ei?

18

Page 19: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

19

Example 3

Customer arrived have historically followed a poisson distribution: 0 people: 0.0067, 1people=0.040, 2people=0.124, 3people=0.265, 4people=0.4405 (u=4.9)

This year, a sample of 20 customer was drawn and were recorded. Can you conclude, at the 10% level of significance, that this year’s record are following poisson distribution? (兩分鐘為單位)

Customer 0個 1個 2個 3個 4個

Frequency 0 1 4 10 15

Page 20: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

20

Solution H0: The data are possion distributed

H1: The data are not possion distributed

χ2=9.628<11.345. Do not reject Ho. There data are following a possion

distribute.

345.112

115,01.0

2

1,

2 pk

實際值 理論值n.p=20*p

查表

Page 21: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

21

u=4.9, k=0~4

Page 22: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

分配 df p

Normal K-p-1=k-3 2 ( )

Poisson K-p-1=k-2 1 ( )

Binomial K-p-1=k-2 1

22

,u

,u

Page 23: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

23

3. Chi-squared Test of a Contingency Table(列聯表)

This test is used to test whether… two nominal variables are related?( 獨立性檢定)

there are differences between two or more

populations of a nominal variable(齊一性檢定)

MBA major 會受不同degree影響 (獨立性) Accounting分佈與finance分佈是否一致

Page 24: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

24

3. Contingency table 2 test We test whether there is sufficient evidence to reject a

pre-specified set of values for pi. Step1:設定假設

Step2:找critical point

Step3: The statistic is

dependent are variables twoThe :H1

tindependen are variables twoThe :H0

k

i i

ii

e

ef

1

22 )(

Step4:結論

2

)1)(1(,

2

cr

eij =np= (Column j total)(Row i total)

Sample size

Page 25: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

25

Example 4

Conduct a test to determine whether the two

classifications L and M are independent, using the

data in the accompanying contingency table. (Use α

=.05)

M1 M2

L1 28 68

L2 56 36

Page 26: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

26

Solution 4

Conduct a test to determine whether the two

classifications L and M are independent, using the

data in the accompanying contingency table. (Use α

=.05)

Page 27: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

27

Solution 4 H0: The two variables are independent

H1: The two variables are dependent

Reject Ho. There is enough evidence to infer that the two variables

are dependent (有關係).

df=(r-1)(c-1)

實際值 理論值(列*欄/total size)

3.84

4.54

19.10

Page 28: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

28

Example 5

The trustee of a company’s pension plan has solicited the

opinions of a sample of the company’s employees about a

proposed revision of the plan. A breakdown of the responses

is shown in the accompanying table. Is there enough

evidence to infer that the responses differ between the three

groups of employees? (Use α=5%) 齊一假設

Responses Blue-Collar

Workers

White-Collar

Workers

Managers

For 67 32 11

Against 63 18 9

Page 29: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

29

Solution 5

The trustee of a company’s pension plan has solicited the

opinions of a sample of the company’s employees about a

proposed revision of the plan. A breakdown of the responses

is shown in the accompanying table. Is there enough

evidence to infer that the responses differ between the three

groups of employees? (Use α=5%) 齊一假設

Page 30: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

30

Solution

H0: The responses of the three groups are the same

H1: The responses of the three groups are different

χ2=2.27<5.99

Don’t reject Ho. There is not enough evidence to infer that

responses differ among the three groups of employees

Page 31: PowerPoint Presentationguo.ba.ntu.edu.tw/教學課程/大學部/統計學下/講義和作業/C15.pdf · 19 Example 3 Customer arrived have historically followed a poisson distribution:

Excel (Q7&Q8)

Data data analysis plus contingency

table (raw data) (Q7)

Data data analysis plus chi-squared

for normality (Q8)

31