data(ChickWeight)
head(ChickWeight)
plot( ChickWeight$Time, ChickWeight$weight, col=ChickWeight$Diet)
chick = reshape(ChickWeight, idvar=c("Chick","Diet"), timevar="Time",
direction="wide")
head(chick)
chick = na.omit(chick)对x和y进行t检验,在x中添加一只体重为200克的雏鸡(1只雏鸡)。这个测试的p值是多少?测试的p值可用以下代码: t.test(x,y)$p.value
对Wilcoxon测试也是如此。Wilcoxon检验对异常值具有较强的鲁棒性。此外,它有较少的假设,即t检验的基础数据的分布.
当我试着做Wilcoxon测试时:
wilcox.test(c(x, 200), y)我知道这个错误:
Warning message:
In wilcox.test.default(c(x, 200), y) :
cannot compute exact p-value with ties发布于 2022-01-15 20:07:12
使用exactRankTests::wilcox.exact
如果x是一个权重,例如时间0,例如chick$weight.0和y是一个权重,例如时间2,例如chick$weight.2
然后你可以这样做:
使用wilcox.test,您将收到一条警告消息:
> wilcox.test(c(chick$weight.0, 200), chick$weight.2)$p.value
[1] 6.660003e-14
Warning message:
In wilcox.test.default(c(chick$weight.0, 200), chick$weight.2) :
cannot compute exact p-value with ties使用能够处理领带的exactRankTests::wilcox.exact():
t.test(chick$weight.0,chick$weight.2)$p.value
6.660003e-14
exactRankTests::wilcox.exact(c(chick$weight.0, 200), chick$weight.2)$p.value
[1] 5.889809e-18https://stackoverflow.com/questions/70724754
复制相似问题