paired testing哪种最好:M型曲线和W型曲线,如何识别出来发展趋势的不同

m
microsat
楼主 (北美华人网)
如果是两个序列,序列A是{3, 3, 3, 3, 3, -3,-3,-3,-3,-3}, 序列B是{-3, -3, -3, -3, -3, 3,3,3,3,3}


那么我们可以用stduent‘s test 的paired测试,来来比较和测试这两个序列是否不一样。


请问除了这个paired student''''s test,还有更好的测试方法?


因为当我们用paired student''''s test来测试序列A和序列B是否不一样的时候,居然pvalue = 1. 这是显然不对的。因为序列A是先高后低,而序列B是先低后高。显然A和B存在巨大差异。


我的代码如下:


a = c( 3, 3, 3, 3, 3, -3, -3, -3, -3, -3)
b = -a
t.test(a,b, paired=TRUE)
运算结果如下:     Paired t-test
data: a and b t = 0, df = 9, p-value = 1 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval:  -4.524314 4.524314 sample estimates: mean of the differences             0 
我最终的目标是,比较两条线(可能不是直线),看这两条线的pattern是否不一样。 比如一条线是八字,另一条线是倒八字。
用什么统计方法能抓住这两条线的pattern是不一样的。
l
lingling7
paired t test is not applied properly here, it is designed to test if the difference between the two (matched) samples are significantly from zero, well, in your case try linear correlation if the samples from two sets are ordered
b
budapestbabe
确定直线pattern的不就是intercept 和 slope吗,这俩parameter不一样就说明两条线不一样了?
m
microsat
paired t test is not applied properly here, it is designed to test if the difference between the two (matched) samples are significantly from zero, well, in your case try linear correlation if the samples from two sets are ordered
lingling7 发表于 2022-06-10 12:28

我试过线性回归。对于W型和M型曲线,线性回归最终都是变成y=0. 也就是找不到两者的差别。但是 显然W型曲线和M型曲线,他俩的pattern是很明显不一样的。
m
microsat
确定直线pattern的不就是intercept 和 slope吗,这俩parameter不一样就说明两条线不一样了?
budapestbabe 发表于 2022-06-10 12:29

存在这样的情况。 一个曲线是W型 一个曲线是M型 结果都变成了y=0,
通过intercept和slope找不到差异。 或者你可以试试,一个是V型曲线,一个是A型曲线(没有中间横线)
l
lingling7
我试过线性回归。对于W型和M型曲线,线性回归最终都是变成y=0. 也就是找不到两者的差别。但是 显然W型曲线和M型曲线,他俩的pattern是很明显不一样的。
microsat 发表于 2022-06-10 12:33

regression is not correlation
t
timeflies2015
错了,
wilxocon sign rank test吧? 如果两组是match的数据 student只能test continuous的 你这个基本就是test一下sign
t
timeflies2015
jonckheere-terpstra test
m
microsat
wilxocon sign rank test吧? 如果两组是match的数据 student只能test continuous的 你这个基本就是test一下sign
媲 发表于 2022-06-10 12:43

还是不行。代码和结果如下。
wilcox.test(a, b, paired=FALSE) 
    Wilcoxon rank sum test with continuity correction
data: a and b W = 50, p-value = 1 alternative hypothesis: true location shift is not equal to 0
Warning message: In wilcox.test.default(a, b, paired = FALSE) :  cannot compute exact p-value with ties
m
microsat
jonckheere-terpstra test
timeflies2015 发表于 2022-06-10 12:44

非常谢谢!
你这个可以判断出来我的例子的不同。也就是a和b的不同。
但是 如果 a = c(1,2,3,4,5,6,7,8,9,10) b = 10*a
 jonckheere.test(c,d)
    Jonckheere-Terpstra test
data:   JT = 45, p-value = 5.511e-07 alternative hypothesis: two.sided
显然a线和b线的pattern是完全一模一样的。所以jonckheere test,也不能使用。
剪秋萝碎米荠
第一,这个数据不是从normal dist来的,不管哪种t test都不合适 第二,paired t测的是if the population mean of the difference=0, 你这sample mean正好就等于零,p value当然等于1了。 第三,Wilcoxon test用的是median不是pattern,估计也不行。 我一时还真想不起来用什么test合适。。。要不试试ks test
m
microsat
第一,这个数据不是从normal dist来的,不管哪种t test都不合适 第二,paired t测的是if the population mean of the difference=0, 你这sample mean正好就等于零,p value当然等于1了。 第三,Wilcoxon test用的是median不是pattern,估计也不行。 我一时还真想不起来用什么test合适。。。要不试试ks test
剪秋萝碎米荠 发表于 2022-06-10 12:56

一个白色的屏幕,x轴,和y轴。
一些图片,M,W,V, ᴧ, 八字的左半部。 无论这些图片投影到屏幕的哪个位置。我们需要一个统计学方法能判断出
“八字的左半部“,是一样的,无论在哪个位置 M和M是一样的,无论在哪个位置 W和W是一样的,无论在哪个位置 V和V是一样的,无论在哪个位置 ᴧ和 ᴧ 是一样的,无论在哪个位置
M和W是不一样的 V, ᴧ, 是不一样的。

m
microsat
jonckheere-terpstra test
timeflies2015 发表于 2022-06-10 12:44

谢谢!你的方法非常好。我前面的一个帖子,搞错了。
剪秋萝碎米荠
一个白色的屏幕,x轴,和y轴。
一些图片,M,W,V, ᴧ, 八字的左半部。 无论这些图片投影到屏幕的哪个位置。我们需要一个统计学方法能判断出
“八字的左半部“,是一样的,无论在哪个位置 M和M是一样的,无论在哪个位置 W和W是一样的,无论在哪个位置 V和V是一样的,无论在哪个位置 ᴧ和 ᴧ 是一样的,无论在哪个位置
M和W是不一样的 V, ᴧ, 是不一样的。


microsat 发表于 2022-06-10 13:02

当然有适合的统计学方法,只不过你之前用的不合适罢了,上面有层主给出答案了。我只是想说,用一个统计学方法之前,搞清楚它的假设和适用的情况,否则给出结果你都没法解释
m
microsat
当然有适合的统计学方法,只不过你之前用的不合适罢了,上面有层主给出答案了。我只是想说,用一个统计学方法之前,搞清楚它的假设和适用的情况,否则给出结果你都没法解释
剪秋萝碎米荠 发表于 2022-06-10 13:11

谢谢!