Skip to content

Commit

Permalink
s4: statistics: ch10: student-practices: ex10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 committed Jun 5, 2024
1 parent 5ccdc52 commit 1c3328b
Showing 1 changed file with 142 additions and 0 deletions.
142 changes: 142 additions & 0 deletions semester-4/statistics/ch10/main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -792,3 +792,145 @@ $ <10.2-overlineD-小樣本抽樣分配>
][
*為獨立樣本*.
]

= 兩個母體比例差 $p_1-p_2$ 之區間估計

#blk[
*比例大樣本*

$
n p >= 10 and n(1-p)>= 10 \
n_1p_1, n_1(1-p_1) >= 10 \
n_2p_2, n_2(1-p_2) >= 10
$ <3-big-sample>
]

#blk[
*新的統計量和分配*

$
hat(p)_1-hat(p)_2
$ <3-new-statistic>

$
((hat(p)_1-hat(p)_2) - (p_1-p_2))/sqrt((p_1(1-p_1))/n_1+(p_2(1-p_2))/n_2) tilde Z
$ <3-sampling-distribution>
]

== 大樣本,$p_1-p_2=0$

#question("ex10.12")[
某私立大學統計系的學生因爲發覺女性抽煙的人數有日益增多的傾向,因此想要做一項統計調查,看看女性抽煙的比例是否逐漸逼近男性抽煙的比例。他從一群人中隨機抽出200位男性,發現其中有85 位有抽煙的習慣;另外也隨機抽出150位女性,發現其中有30 位有抽煙的習慣。試求兩性抽煙比例差 $p_1-p_2$ 之95%的信賴區間。
][
*題幹*

兩個母體 $p_1, p_2$,抽出兩個樣本:

+ $n_1=200, hat(p)_1 &= 85/200 = 0.425$ \
+ $n_2=150, hat(p)_2 &= 30/150 = 0.2$

想要求出

+ $p_1-p_2$ 的 95% C.I.
+ $p_1-p_2>0$ 嗎?

*Question 1*

因為符合 @3-big-sample (大於 10),本題之抽樣分配為 @3-sampling-distribution

$
((hat(p)_1-hat(p)_2) - (p_1-p_2))/sqrt((p_1(1-p_1))/n_1+(p_2(1-p_2))/n_2) tilde Z
$

計算 $p_1-p_2$ 的 95% 信賴區間

$
c &= (hat(p)_1-hat(p)_2) plus.minus Z_(alpha/2) sqrt((hat(p)_1(1-hat(p)_1))/n_1+(hat(p)_2(1-hat(p)_2))/n_2) \
&= 0.131 or 0.319
$

$p_1-p_2$ 的 95% 信賴區間為 $(0.131, 0.319)$

*Question 2*

+ $
cases(
H_0: p_1-p_2 <= 0 \
H_1: p_1-p_2 > 0 "(宣稱)"
)
$
+ 拒絕域

$
R R &= { Z | Z > Z_(alpha) } \
&= { Z | Z > 1.645 }
$
+ 計算 $p_1-p_2$$Z$ 值。這裡要使用 pooled value

$
hat(p)_P &= (overline(x)_1 + overline(x)_2)/(n_1+n_2) \
&= (85+30)/(200+150) = 0.3285714286
$

$
Z &= (0.225-0)/sqrt((hat(p)_1(1-hat(p)_1))/n_1+(hat(p)_2(1-hat(p)_2))/n_2) \
&= (0.225-0)/sqrt((hat(p)_P(1-hat(p)_P))/n_1+(hat(p)_P(1-hat(p)_P))/n_2) \
&= 4.44
$

因為 $Z=4.44 > 1.645$$Z in R R$,拒絕 $H_0$

故在 95% 信賴區間下,接受 $p_1-p_2>0$ 的宣稱。
]

#question("ex10.14")[
//wip
][]

== 大樣本,$p_1-p_2!=0$

#question("ex10.13")[
某洗面乳製造廠商廣告宣稱,購買其公司之洗面乳產品的女性顧客多於男性顧客至少20%。但消基會懷疑廠商的廣告宣稱,因此隨機抽出300位女性,其中有120位使用此產品;另外也隨機抽出200位男性,其中則有50位使用此產品。試求在顯著水準為$alpha=0.05$的條件下,檢定廠商所廣告宣稱是否正確。
][
兩個母體 $p_1, p_2$,分別抽出 $n_1=300, hat(p)_1=120/300=0.4$$n_2=120, hat(p)_2=50/200=0.25$ 的樣本.

*建立虛無假設*

$
cases(
H_0: p_1-p_2 >= 0.2 "(宣稱)" \
H_1: p_1-p_2 < 0.2
)
$

*抽樣分配*

因為是大樣本,所以分配是

$
((hat(p)_1-hat(p)_2) - (p_1-p_2))/sqrt((p_1(1-p_1))/n_1+(p_2(1-p_2))/n_2) tilde Z
$

$p_1-p_2$$alpha=0.05$ 拒絕域為

$
R R = { Z | Z < Z_(alpha) } = { Z | Z < -1.645 }
$

*計算 $p_1-p_2$$Z$ 值*

$
hat(p_1)-hat(p_2) = 0.4-0.25=0.15
$

$
Z &= (0.15 - 0.2)/sqrt((p_1(1-p_1))/n_1+(p_2(1-p_2))/n_2) \
&= -1.20
$

因為 $Z=-1.20 > -1.645$$Z in.not R R$,不拒絕 $H_0$

*結論*

故在 $alpha=0.05$ 下,接受廠商的宣稱。
]

0 comments on commit 1c3328b

Please sign in to comment.