---
tags: 機率與統計
title: 第十六週活動
---
## 活動一
Let's study the differences between expert and consumer ratings by considering medal ratings for wines: gold (G), silver (S) or bronze (B). Three categories were established :
(1) Rating is the same: {(G, G), (S, S), (B, B)}
(2) Rating differs by one medal: {(G, S), (S, G), (S, B), (B, S)}
(3) Rating differs by two medals: {(G, B), (B, G)}
The observed frequencies for these three categories were 69, 102, and 45, respectively. On the hypothesis of equally likely expert ratings and consumer ratings being assigned completely by chance, each of the 9 medal pairs has probability 1/9. Carry out an appropriate chi-squared test using a significance level of .10
>$H_0 = u_a=\frac{3}{9},u_b=\frac{4}{9},u_c=\frac{2}{9}\ \Sigma=1(皆為隨機評分)$
>$H_a = 以上至少有一不成立(至少有一方認真評分)$
>$n=69+102+45=216$
>$df=3-1=2$
>$x^2 = \Sigma\frac{(n_i-(n\times u_i))^2}{n\times u_i}=\frac{(69-(216\times\frac{3}{9}))^2}{216\times\frac{3}{9}}+\frac{(102-(216\times\frac{4}{9}))^2}{216\times\frac{4}{9}}+\frac{(45-(216\times\frac{2}{9}))^2}{216\times\frac{2}{9}}=0.6875$
>$4.615>x^2$
>$沒有顯著的證據支持H_a,所以無法拒絕H_0,專家和消費者皆為隨機評分$
## 活動二
A random sample of smokers was obtained, and each individual was classified by both gender and age when he or she first started smoking. The data in the accompanying table is listed as below:
Gender
Male Female
<16 25 10
Age 16-17 24 32
18-20 28 17
\>20 19 34
(a) Calculate the proportion of males in each age category; do the same for females. Based on these proportions, does it appear there might be an association between gender and the age when an individual first smokes?
| Age | Male | Female |
| -------- | --- | -- |
| <16 | 0.26 | 0.11 |
|16 - 17| 0.25 | 0.34|
|18 - 20| 0.29| 0.18 |
| > 20| 0.19 | 0.37 |
>第一次抽煙與年齡是有關係的,整體趨勢為向上
(b) Carry out a test of hypotheses to decide whether there is an association between the two factors?
>$H_0=與年齡無關$
>$H_a=與年齡有關$
>$n=189$
>$x^2 = \Sigma\frac{(n_i-(n\times u_i))^2}{n\times u_i}=\frac{(25-(189\times0.26))^2}{189\times0.26}...=14.462$
>$df=(row-1)\times(col-1)=3$
>$\alpha=0.05時7.815,\alpha=0.01時11.345$
>$有顯著證據可以拒絕H_0,所以可以得知抽煙與年齡有相關$