试图看看DMSO治疗和EPZ治疗在DAPI上是否有显着性差异。我的数据集有三个变量,每个治疗组都有不同数量的个体。以下是我为给出一幅图片而编造的数据:
H 19 EPZ0.5uM 10 25 22H 210H 111EPZ0.5uM 12 24 22H 212H 113EPZ0.5uM 24 24 30<代码>H 214/代码>H 115Z0.5uM 20 20 32H 216F 217
(对不起,我不知道如何在堆栈溢出时格式化表)
导入数据集后,我完成了以下操作:EPZDMSO<-EPZdata[which(EPZdata$Treatment=="DMSO"),] EPZ0.5uM<-EPZdata[which(EPZdata$Treatment=="EPZ0.5uM"),]
尝试使用wilcox.text:wilcox.test(EPZDMSO$DAPI~EPZ0.5uM$DAPI,data=EPZdata,mu=0,alt="two.sided",conf.int=T,conf.level=0.95,paired=FALSE,exact=T,correct=T)
但是得到以下错误消息:Error in model.frame.default(formula = EPZDMSO$DAPI ~ EPZ0.5uM$DAPI, data = EPZdata) : variable lengths differ (found for 'EPZ0.5uM$DAPI')
我需要纠正不平衡的数据吗?
发布于 2020-03-27 00:37:24
您已经接近了,只需要子集到DAPI列。
这是手册页,help(wilcox.test)。
wilcox.test(x,y=空,two.sided= c("two.sided",“较少”,“更大”),mu = 0,配对=假,精确=空,正确=真,conf.int =假,conf.level = 0.95,.)
参数
数据值的数字向量。非有限值(例如,无限值或缺失值)将被省略。
Y是数据值的一个可选的数值向量:与x的非有限值一样,将省略.
因此,比较两组与wilcox.test,x和y应作为数据的载体。
wilcox.test(x = EPZDMSO$DAPI, y = EPZ0.5uM$DAPI,
mu=0, alt="two.sided", conf.int=T, conf.level=0.95,
paired=FALSE, exact=T, correct=T)
Wilcoxon rank sum test with continuity correction
data: EPZDMSO$DAPI and EPZ0.5uM$DAPI
W = 11.5, p-value = 0.07446
alternative hypothesis: true location shift is not equal to 0
95 percent confidence interval:
0 14
sample estimates:
difference in location
9.497565 数据
EPZdata <- structure(list(Treatment = structure(c(1L, 1L, 1L, 2L, 2L, 2L,
2L), .Label = c("DMSO", "EPZ0.5uM"), class = "factor"), DAPI = c(20L,
24L, 23L, 10L, 12L, 14L, 20L), DAPO = c(30L, 26L, 24L, 25L, 24L,
24L, 19L), DAPU = c(40L, 42L, 39L, 22L, 22L, 30L, 32L)), class = "data.frame", row.names = c(NA,
-7L))
EPZDMSO<-EPZdata[which(EPZdata$Treatment=="DMSO"),]
EPZ0.5uM<-EPZdata[which(EPZdata$Treatment=="EPZ0.5uM"),]https://stackoverflow.com/questions/60878127
复制相似问题