04-Hypothesis Test & p-value

本文详细介绍了进行假设检验的五个步骤:设定零假设、设置显著性水平、收集数据、计算检验统计量及p值,并通过一个具体例子说明如何根据p值判断是否拒绝零假设。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Hypothesis Test Process

1. Set a Null Hypothesis

The null hypothesis can be thought of as the opposite of the "guess" the research made (in this example the biologist thinks the plant height will be different for the fertilizers).  So the null would be that there will be no difference among the groups of plants.

2. Set the significance level (alpha) 

   
 
H0 is true
H0 is false
Accept
true positive
false positive
Reject
true negative (alpha)
false negative
The term significance level (alpha) is used to refer to a pre-chosen probability, also called Type I error.

3. Collect Data

Usually we use Permutation sampling to collect the new random data for the following hypothesis test, called hypothesis data. The original data is called observed data.

4. Calculate the  test statistic 

Could be the mean of differences, pearson correlation r value and so on. Depend on real situation.

5. Calculate the p-value

the term "p-value" is used to indicate a probability that you calculate after a given study. p = "sum(the situations that can prove the null hypothesis is true)/#ofAllSituations"

If your p-value is less than the chosen significance level then you reject the null hypothesis.


A full example:

Null hypothesis: performance in the finals and semifinals are identical 

Test statistic:  the mean of the fractional improvement. mean(f) where f = (semi_perm - final_perm) / semi_perm

f_mean is calculated from observed data, perm_reps[i] is calculated from hypothesis data.

p-value: sum(perm_reps >= f_mean) / len(perm_reps)


so, if hypothesis is true, the ideal situation is that f_mean is some value close to the average value  of perm_reps so that the p-value should be 0.5;

however, the result shows that p-value equals to 0.001, which means that "f_mean" is not gonna happen in this hypothesis. Hence we reject the hypothesis. 






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值