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. 






The Mann-Kendall test is a non-parametric statistical test used to determine the presence or absence of a monotonic trend in a data series. It is commonly used in environmental studies, hydrology, and climate science to detect trends in time series data. The Mann-Kendall test is based on the rank correlation between the data values and their order in time. The test calculates the number of upward and downward trends in the data series, and compares them to the expected number of trends under the null hypothesis of no trend. The test statistic is calculated as follows: S = ∑ (sgn(xi – xj)) where sgn is the sign function, xi and xj are the data values at times i and j, and the summation is over all pairs of times i and j. The test statistic S is compared to its expected distribution under the null hypothesis using a standard normal distribution. A positive value of S indicates an increasing trend, while a negative value indicates a decreasing trend. The p-value of the test is then calculated based on the normal distribution. If the p-value is less than the significance level (usually 0.05), the null hypothesis of no trend is rejected and a monotonic trend is detected in the data series. If the p-value is greater than the significance level, the null hypothesis cannot be rejected and no trend is detected. The Mann-Kendall test is a powerful tool for detecting trends in time series data, but it has some limitations. It assumes that the data are independent and identically distributed, and it may not be suitable for detecting trends in data with complex patterns or non-monotonic trends.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值