# 生物統計研讀筆記 - One Sample Tests of Hypothesis

• ## Hypothesis involving the Means $\mu$

• Student test: $t=\frac{\bar{X}-\mu}{\frac{s}{\sqrt{n}}}$
• Tail 方向對分布圖形的記法: Tail 描述機率分布函數數字掉落下來的末端，因此 Left Tail 表示尾巴在左端，預期主要機率分布在右邊。反之亦然
• Two Tail: $$\begin{array}{ll} H_0: \mu=c & E(t)=0 \ H_a: \mu \neq c & E(t) \neq 0 \end{array}$$
• Left Tail: $$\begin{array}{ll} H_0: \mu \geq c & E(t) \geq 0 \ H_a: \mu<c & E(t)<0 \end{array}$$
• Right Tail: $$\begin{array}{ll} H_0: \mu \leq c & E(t) \leq 0 \ H_a: \mu>c & E(t)>0 \end{array}$$
• Sample Size:
• the sample size for a one-tailed test can be estimated by $n=\left[\frac{\left(z_\alpha+z_{1-\beta}\right) \sigma}{\mu_0-\mu}\right]^2$
• ## Hypothesis involving the Variance $\sigma$

• Chi-square test: $\chi^2=\frac{(n-1) s^2}{\sigma^2}$
• ## Nonparametric Statistics

• 不需要對母群體分佈的常態分佈假設，對於母群體分佈未知或者樣本數太少時適用
• ### Sign Test

• Test theory:
• If $H_0$ is true ( $M = M_0$ ), then any observation $X_i$ has probability 1/2 of lying below $M_0$ and probability 1/2 of lying above. So any difference $X_i - M_0$ has probability of 1/2 being negative or positive
• When observations equal the hypothesized median ( $M_0$ and $X - M_0 = 0$ ). General procedure is to remove such points from observation
• Let $S_-$ and $S_+$ denote the number of negative and positive signs
• If $H_0$ is true, the probability of + or - is 1/2 , analogous to ﬂipping a fair coin. -> binomial distribution
• Confidence Interval:
• Ex: (with p = 0.5), F(4) = 0.0154 and F(5) = 0.0481. The smallest value of d with a P value greater than or equal to 0.025 is therefore d = 5. -> Find the the point which rank = 5
• ### Wilcoxon Signed-Rank Test

• 根據與 Median 的差異絕對值大小排序來建立 Rank, 並依序原先差異的正負來給予 rank 值 + or -
• 如果 排序為 1, 2, 3, 4, 5，但 3, 4, 5 實際 value 一樣，則皆給予 midrank 4, -> 1, 2, 4, 4, 4, 再下一個 rank 則變為 6 ，即 1, 2, 4, 4, 4, 6
• 加總 Positive Ranks 和 Negative Ranks
• the absolute value of the sum of the negative ranks. $W_-$
• the sum of the positive ranks. : $W_+$
• 檢查總數是否符合原先樣本總數：Total should be: $W_{-}+W_{+}=\sum_{i=1}^n i=\frac{n(n+1)}{2}$
• Each test statistic is one-half of the sum of all the ranks: $E\left(W_{-}\right)=E\left(W_{+}\right)=\frac{n(n+1)}{4}$
• 選擇 $W_-$ , $W_+$ 中 Minimum 的數值查表
• #### Decision Rules

• Right tailed test (波峰分佈偏左，負得更多):
• if $H_\alpha$ if true -> 代表 Positive ( $W_+$ ) 比預期中更多
• Too few negative ranks -> $H_0$ is rejected
• If $P < \alpha$ -> Little evidence to support $H_0$
• Two tailed test
• the test statistic $W$ is the minimum of $W_-$ and $W_+$
• Compare the $P:value$ with $\alpha$ ( $\frac{\alpha}{2}$ )