伙计们,我收集了用于完整析因设计的数据。 为了找出最适合我的模型/问题的分数设计,我想比较应用于不同子集(例如federov,optBlock,Monte Carlo)的相同模型的结果与完整数据的比较。我希望通过针对我的问题案例选择最佳的分数设计来减少将来的时间。 一位同事建议绘制置信区间,如果重叠,则模型结果应相同。 我以为比比比较图比测试也是合理的。因此,我想将我已经实现的两个“%95家族式置信水平”图合并到一个图中,并为两种类型使用不同的颜色。 达成我的目标是否正确?关于R语法,我如何实现此目标。我添加了相应的代码示例。
library(data.table)
federovData <- fread('http://studierfurt.de//data/Federov_Gleichverteilung.csv')
fullData <- fread("http://studierfurt.de/data/ParaTuning_2018.08.13.csv")
# convert categorial variables to factors
fullData$Velotype = factor(fullData$Velotype)
fullData$block = factor(fullData$block)
federovData$Velotype = factor(federovData$Velotype)
federovData$block = factor(federovData$block)
#y-data transformation
fullData$`Relative gap` = log(fullData$`Relative gap`+0.1)
federovData$`Relative gap` = log(federovData$`Relative.gap`+0.1)
fullModel = lm(`Relative gap`~block+SwapRemoveProb*AssignmentMutationProb*Velotype
+I(SwapRemoveProb^2)+I(AssignmentMutationProb^2)
,data=fullData)
federovModel = lm(`Relative gap`~block+SwapRemoveProb*AssignmentMutationProb*Velotype
+I(SwapRemoveProb^2)+I(AssignmentMutationProb^2)
,data=federovData)
federovAn <- aov(`Relative gap`~block+SwapRemoveProb*AssignmentMutationProb*Velotype+I(SwapRemoveProb^2)+I(AssignmentMutationProb^2),federovData)
fullAn <- aov(`Relative gap`~block+SwapRemoveProb*AssignmentMutationProb*Velotype+I(SwapRemoveProb^2)+I(AssignmentMutationProb^2),fullData)
summary(federovAn)
summary(fullAn)
# apply tukey test
federovPostHoc <- TukeyHSD(x=federovAn,which="Velotype",FALSE,conf.level=0.95)
fullPostHoc <- TukeyHSD(x=fullAn,which="Velotype",FALSE,conf.level=0.95)
par(mfrow=c(1,2))
plot(federovPostHoc)
plot(fullPostHoc)
# plot
par(mfrow=c(2,3))
plot(`Relative gap`~block+SwapRemoveProb*AssignmentMutationProb*Velotype
+I(SwapRemoveProb^2)+I(AssignmentMutationProb^2), data = federovData, type = 'p',ylab="Relative gap")
# plot
par(mfrow=c(2,3))
plot(`Relative gap`~block+SwapRemoveProb*AssignmentMutationProb*Velotype
+I(SwapRemoveProb^2)+I(AssignmentMutationProb^2), data = fullData, type = 'p',ylab="Relative gap")