重学 Statistics, Cha9 Hypothesis Tests

9.1 Developing Null and Alternative Hypotheses

Null Hypothesis H0: a tentative assumption about a population parameter such as a population mean or a population proportion.
Alternative Hypothesis Ha: the opposite of what is stated in the null hypothesis

我们想测试瓶装可乐有没有和标签所说,至少67.6盎司,因此建立了以下的假设,这个假设应用于 label 是错的,瓶子装少了
H0: μ >= 67.6
Ha: μ < 67.6

但是当我们分别站在生产工厂和消费者的角度去思考,消费者如果拿到的真正容量少于67.6,那么则会不满足标准;但是多余67.6,对工厂来说,是亏了。 于是,我们建立以下的假设:
H0: μ = 67.6
Ha: μ != 67.6

因此,这是一个 two-tailed test, 而用大于或小于的符号,是 one tailed test.

9.2 Type I and Type II Errors

这里写图片描述

Level of Significance: The level of significance is the probability of making a Type I error when the null hypothesis is true as an equality.
The Greek symbol α (alpha) is used to denote the level of significance, and common choices for α are .05 and .01.
当 level of significance 大的时候,也就是所 type I error可能性很大的时候,可能是 α使用的比较大。

Because of the uncertainty associated with making a Type II error when conducting significance tests, statisticians usually recommend that we use the statement “do not reject H0”
instead of “accept H0.”

9.3 Population Mean: σ Known

One-Tailed Test

Step 1: Develop null and alternative hypotheses
Step 2: Decide μ(一般用 hypothesis里的来做) and α
Step 3: Collect sample data and compute test statistic

Lower Tail Test: H0: μ>= μ0 Ha: μ < μ0
Upper Tail Test: H0: μ<= μ0 Ha: μ > μ0

因为 σ已知,σ=0.18. n=36, 因此 σx = 0.03

所以可以计算 z=x¯μ0σx¯

这里写图片描述

p-value approach

A p-value is a probability that provides a measure of the evidence against the null hypothesis provided by the sample. Smaller p-values indicate more evidence against H0.

For a lower tail test, P-value is the probability of obtaining a value for the test statistic as small as or smaller than that provided by the sample.
这里写图片描述

举个例子:Hilltop Coffee想要检测饮料是不是按标准所说,里面有3磅,所以建立了 hypothesis。
H0: μ>= 3 Ha: μ < 3
于是检测了36个 sample,得到 样本平均数是 2.92,问题:x̅=2.92 是不是足够小来 reject H0? 已知 σ = 0.18, n=36,那么可以计算 z = -2.67。
所以根据定义:p-value is the probability that the test statistic z is less than or equal to -2.67. 于是可以查表得到,当 z=-2.67时,可能性是0.0038,所以 p-value 是0.0038。This p-value indicates a small probability of obtaining a sample mean of x̅=2.92 or smaller when sampling from a population with μ=3.

第二个问题:0.0038是不是足够小?
于是我们主要看 α,the selection α=0.01 means that the director is willing to tolerate a probability of 0.01 of rejecting the null hypothesis when it is true as an equality μ=3

所以得到我们的 Rejection Rule Using p-value:
Reject H0 if p-value <= α

当 level of significance 大的时候,也就是所 type I error可能性很大的时候,可能是 α使用的比较大。α大,可以忍受的 error 就大,两边的区间都不管,直接 reject.

Critical Value Approach

The critical value approach requires that we first determine a value for the test statistic called the critical value.

例如:用 α=0.01来得到 z= -2.33,于是 reject H0 if z <= -2.33
这里写图片描述
这里写图片描述

Two-Tailed Test

P-value approach

Two Tail Test: H0: μ= μ0 Ha: μ != μ0
这里写图片描述

With a level of significance of α = 0.05, we do not reject H0 because the p-value = 0.126 > 0.05
这里写图片描述

Critical value approach

这里写图片描述
这里写图片描述

STEPS of HYPOTHESIS TESTING
Step1: Develop the null and alternative hypotheses
Step2: Specify the level of significance
Step3: Collect the sample data and compute the value of the test statistic
p-Value Approach
Step4: Use the value of the test statistic to compute the p-value
Step5: Reject H0 is the p-value <= α
Critical Value Approach
Step4: Use the level of significance to determine the critical value and the rejection rule.
Step5: Use the value of the test statistic and the rejcetion rule to determine whether to reject H0

有问题:如果我增大 n,那么 z 会变大?是的,但是 n 变大,取得的 sample mean 就会越靠近 μ,相应的,取得原来那个离μ有点远的 sample mean 的可能性就会减少

Relationship between interval estimation and Hypothesis Testing

这里写图片描述

9.4 Population Mean : σ Unknown

The test statistic has a t distribution with n-1 degrees of freedom:
t=x¯μ0s/n

案例: H0: μ <=7 Ha: μ>7
通过计算可以得到 t = 1.84,t 有 n-1=59 degrees of freedom
于是通过找表,需要得到 p-value,发现 p-value 在0.05和0.25之间,又因为 α=0.05,所以要 reject the null hypothesis.

这里写图片描述

9.5 Population Proportion

The methods used to conduct the hypothesis test are similar to those used for hypothesis tests about a population mean.
这里写图片描述

9.7 Calculating the Probability of Type II Error

案例: H0: μ >=120 Ha: μ<120
If Ho is not rejected, the decision will be to accept the shipment.

如何计算 the Probability of Type II Error?
1. 什么情况下会犯 Type II error?
When true population mean is less than 120 and we make the decision to accept Ho.
So we must select a value of μ less than 120. For example μ=112, if μ=112, what is the probability of accept H0 and committing a Type II error?
当 x̅ >116.71, 我们会 accept the decision. 所以通过计算得到 z= (116.71-112)/ (12/6) = 2.36. 查表得到 the probability of making a Type II error as β, we see that when μ= 112, β = .0091
这里写图片描述
这里写图片描述

这里的 power 是什么? That is the probability of correctly reject the null hypothesis is 1- the probability of makeing a Type II error.

The procedure is:
1. Formulate the null and alternative hypotheses.
2. Use the level of significance α and the critical value approach to determine the critical value and the rejection rule for the test
3. Use the rejection rule to solve for the value of the sample mean corresponding to the critical value of the test statistic.
4. Use the results from step 3 state the values of the sample mean that lead to the acceptance of H0. These values define the acceptance region for the test
5. Use the sampling distribution of x ̄ for a value of μ satisfying the alternative hypothesis, and the acceptance region from step 4, to compute the probability that the sample mean will be in the acceptance region. This probability is the probability of making a Type II error at the chosen value of μ.

9.8 Determining the Sample Size for a Hypothesis Test About a Population Mean

In the upper panel of the figure the vertical line, labeled c, is the corresponding value of x̅.
这里写图片描述

这里写图片描述

当我们还是用之前的案例: Shipments were rejected if H0: μ >= 120 was rejected.

Type I error statement: If the mean life of the batteries in the shipment is μ=120, I am willing to risk an α=.05 probability of rejecting the shipment.
Type II error statement: If the mean life of the batteries in the shipment is five hours under the specification (i.e., μ=115), I am willing to risk a β=.10 probability of accepting the shipment.
这里写图片描述
Rounding up, we commend a sample size of 50.

We can make three observations about the relationship among α, β , and the sample size n.
1. Once two of the three values are known, the other can be computed.
2. For a given level of significance α, increasing the sample size will reduce β.
3. For a given sample size, decreasing α will increase β , whereas increasing α will decrease β.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章