Last active
October 12, 2022 06:24
-
-
Save threecifanggen/1c7bd10ec67652f08c84cc30c19730eb to your computer and use it in GitHub Desktop.
[单样本Wilcoxon检验] 用`Python`实现的Wilcoxon检验 #wilcoxon #python #one-sample-test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| ### 例子 | |
| 正常男性尿检中位数$M_0$为$0.33\mu mol/L$,抽取工厂血铅含量如下,求是否符合正常。 | |
| """ | |
| import statsmodels.stats as sts | |
| M_0 = 0.33 | |
| M = [0.29, 0.31, 0.34, 0.37, 0.38, 0.41, 0.47, 0.52, 0.69, 0.72, 0.73, 0.77, 0.78, 0.80, 0.83, 0.92, 0.95, 0.97] | |
| sts.descriptivestats.sign_test(M, M_0) # (7.0, 0.001312255859375) 有显著差异 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment