Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/691718ed-7ba4-8006-96d5-a66e0d9678fe
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: 好!我們就來算一下這個 p 值 怎麼來的。還是用「1000 個新生兒 → 520 男嬰,480 女嬰」這個例子。 === 好!我們就來算一下這個 p 值 怎麼來的。還是用「1000 個新生兒 → 520 男嬰,480 女嬰」這個例子。 ==== - H0H_0H0:男嬰出生率 = 0.5 ==== * n=1000n = 1000n=1000(總樣本數) * X=520X = 520X=520(觀察到的男嬰數) 在 H0H_0H0 下,男嬰數 XXX 服從 二項分布: X∼Binomial(n=1000,p=0.5)X \sim \text{Binomial}(n=1000, p=0.5)X∼Binomial(n=1000,p=0.5) ==== 二項分布的機率公式是: ==== P(X=k)=(nk)pk(1−p)n−kP(X=k) = \binom{n}{k} p^k (1-p)^{n-k}P(X=k)=(kn)pk(1−p)n−k 這裡 n=1000n=1000n=1000,p=0.5p=0.5p=0.5。 ==== 因為我們做的是「雙尾檢定」(H1:p≠0.5H_1: p \neq 0.5H1:p=0.5), ==== p 值是「觀察到比 520 更極端(偏離 500)的結果的機率」。 也就是: p-value=P(X≤480)+P(X≥520)p\text{-value} = P(X \leq 480) + P(X \geq 520)p-value=P(X≤480)+P(X≥520) ==== 直接算二項分布太麻煩(1000 很大),所以通常用 常態近似: ==== X∼Normal(μ=np,σ2=np(1−p))X \sim \text{Normal}(\mu=np, \sigma^2=np(1-p))X∼Normal(μ=np,σ2=np(1−p)) * μ=1000×0.5=500\mu = 1000 \times 0.5 = 500μ=1000×0.5=500 * σ=1000×0.5×0.5=250≈15.81\sigma = \sqrt{1000 \times 0.5 \times 0.5} = \sqrt{250} \approx 15.81σ=1000×0.5×0.5=250≈15.81 計算 Z 分數: Z=520−50015.81≈1.265Z = \frac{520 - 500}{15.81} \approx 1.265Z=15.81520−500≈1.265 ==== 查標準常態分布表: ==== P(Z≥1.265)≈0.103P(Z \geq 1.265) \approx 0.103P(Z≥1.265)≈0.103 因為是雙尾檢定: p-value=2×0.103=0.206p\text{-value} = 2 \times 0.103 = 0.206p-value=2×0.103=0.206 ==== - p≈0.206>0.05p \approx 0.206 > 0.05p≈0.206>0.05 → 沒有足夠證據拒絕虛無假設。 ==== * 也就是說,520 vs. 480 這個差異統計上可能只是隨機。 ✅ 重點:p 值的計算流程就是 # 設定 H0H_0H0(用二項分布建模)。 # 算出觀察值的 Z 分數。 # 用標準常態分布算出「比觀察值更極端的機率」。 要不要我幫你實際用 Python/Excel 算一次 精確二項檢定 的 p 值(而不是近似),給你比較看看?
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)