社区,我对我和版主的meta分析有一个问题。不幸的是,我的错误条重叠了。这就是为什么我要找个机会把我的台词改几英寸。我知道ggplot中的dodge.position函数。在"normal“plot函数中有类似的函数吗?
这是我的代码:
plot(coef.rma(meta_LGOOCBdimension_MI)[1:3], type="o", pch=19, ylim=c(0, 1.2),
xlab="OCB Dimension", ylab="Standardized Correlation", xaxt="n", bty="l")
arrows(x0=1:3, y0=coef(summary(meta_LGOOCBdimension_MI))$ci.lb[1:3], x1=1:3,
y1=coef(summary(meta_LGOOCBdimension_MI))$ci.ub[1:3], code=3, angle=90, length=0.05)
axis(side=1, at=1:3, labels=c("OCB-I","OCB-O","OCB-CH"))
lines(coef.rma(meta_LGOOCBdimension_MI)[4:5], type="o", pch=15, lty="dotted")
arrows(x0=1:2, y0=coef(summary(meta_LGOOCBdimension_MI))$ci.lb[4:5], x1=1:2,
y1=coef(summary(meta_LGOOCBdimension_MI))$ci.ub[4:5], code=3, angle=90, length=0.05)
lines(coef.rma(meta_LGOOCBdimension_MI)[6:8], type="o", pch=17, lty="dashed")
arrows(x0=1:3, y0=coef(summary(meta_LGOOCBdimension_MI))$ci.lb[6:8],
x1=1:3, y1=coef(summary(meta_LGOOCBdimension_MI))$ci.ub[6:8],
code=3, angle=90, length=0.05)
legend("topright", legend=c("vandewalle", "button", "other"),
lty=c("solid", "dotted", "dashed"), pch=c(19,15, 17))
title("Estimated Average Effects based on the Interaction Model")这将导致以下输出:

发布于 2019-12-14 20:41:20
我找到了以下解决方案来调整x值:
plot(c(1,2,3), coef.rma(meta_LGOOCBdimension_MI)[1:3], type="o", pch=19,
xlim=c(1,3.2), ylim=c(0,1.2), xlab="OCB Dimension",
ylab="Standardized Correlation", xaxt="n", bty="l")
arrows(x0=1:3, y0=coef(summary(meta_LGOOCBdimension_MI))$ci.lb[1:3],
x1=1:3, y1=coef(summary(meta_LGOOCBdimension_MI))$ci.ub[1:3],
code=3, angle=90, length=0.05)
axis(side=1, at=1:3, labels=c("OCB-I","OCB-O","OCB-CH"))
lines(c(1.05,2.05), coef.rma(meta_LGOOCBdimension_MI)[4:5], type="o",
pch=15, lty="dotted")
arrows(x0=c(1.05,2.05), y0=coef(summary(meta_LGOOCBdimension_MI))$ci.lb[4:5],
x1=c(1.05,2.05), y1=coef(summary(meta_LGOOCBdimension_MI))$ci.ub[4:5],
code=3, angle=90, length=0.05)
lines(c(1.1,2.1,3.1), coef.rma(meta_LGOOCBdimension_MI)[6:8], type="o",
pch=17, lty="dashed")
arrows(x0=c(1.1,2.1,3.1), y0=coef(summary(meta_LGOOCBdimension_MI))$ci.lb[6:8],
x1=c(1.1,2.1,3.1), y1=coef(summary(meta_LGOOCBdimension_MI))$ci.ub[6:8],
code=3, angle=90, length=0.05)
legend("topright", legend=c("Vandewalle (1997)", "Button et al. (1996)", "Other"),
lty=c("solid", "dotted", "dashed"), pch=c(19,15, 17))
title("Estimated Average Effects based on the Interaction Model")绘图:

https://stackoverflow.com/questions/59335124
复制相似问题