我有来自两种不同情况(癌症和正常)的菌落计数数据,两种药物联合治疗:A (3水平)和B (2水平)。对于菌落,我有不同的types+total,但我可以在不同的测试中观察不同的类型。
df <- data.frame( Patient = rep( 1:6, 6), Disease = rep( c( "cancer", "normal"), 18), DrugA = c( rep( 0, 12), rep( 30, 12), rep( 100, 12)), DrugB = rep( c( rep( 0, 6), rep( 2, 6)), 3), n.colonies = sample( 10:300, size = 36) )
head(df)我的问题是,我想比较两种情况(癌症和正常)的不同治疗(结合DrugA和DrugB)。为此,我做了以下工作:
df$treatment.factor <- paste( df$DrugA, df$DrugB, sep = ".")
library(stats)
a <- aov( formula = n.colonies ~ Disease:treatment.factor, data = df)
summary(a)
TukeyHSD(a)结果返回所有可能的组合,包括相同条件下的不同处理选项。我有什么办法限制测试组仅针对不同疾病的同一treatment.factor?我在考虑做一些有趣的t检验,并对多个比较做正确的测试,但这对我来说似乎并不完全正确。我也在考虑对每一种情况进行回归(基于DrugB分离),但只有3分(三种浓度的DrugA)对此也没有帮助。
有什么建议吗?谢谢!
爱德华多
发布于 2018-08-01 11:59:46
我不确定能理解。也许你想:
library(lsmeans)
lsmeans(a, pairwise ~ Disease:treatment.factor | treatment.factor)$contrasts
treatment.factor = 0.0:
contrast estimate SE df t.ratio p.value
cancer - normal -101.333333 74.31826 24 -1.364 0.1854
treatment.factor = 0.2:
contrast estimate SE df t.ratio p.value
cancer - normal -92.333333 74.31826 24 -1.242 0.2261
treatment.factor = 100.0:
contrast estimate SE df t.ratio p.value
cancer - normal 50.666667 74.31826 24 0.682 0.5019
treatment.factor = 100.2:
contrast estimate SE df t.ratio p.value
cancer - normal 1.666667 74.31826 24 0.022 0.9823
treatment.factor = 30.0:
contrast estimate SE df t.ratio p.value
cancer - normal 9.000000 74.31826 24 0.121 0.9046
treatment.factor = 30.2:
contrast estimate SE df t.ratio p.value
cancer - normal 79.333333 74.31826 24 1.067 0.2964https://stackoverflow.com/questions/51621269
复制相似问题