使用7模型输出创建点图的ggplot

时间:2018-02-05 13:31:12

标签: r plot ggplot2 rstudio models

我有一些点图问题 我确切地知道我想要表示什么数据,但我似乎无法在R中创建所需的数据。

我看到了一个使用ggplot2的例子 Dotplot with error bars, two series, light jitter

我拥有我想要的所有数据。例如(对于我的七个型号中的每一个,将x替换为1-7) predf.mxdistrst.agree#预测值1(低不信任)和4(高度不信任)的视觉比较

lower.mxdistrst.agree#我们想采取相应的较低置信区间为1(低不信任)和4(高不信任)

upper.mxdistrst.agree#我们想要相应的较高置信区间为1(低不信任)和4(高不信任)

我应该将数据整合在一起并手动创建吗?有没有人有任何编码建议,我应该怎么做?

提供我想要包含在圆点图中的一个模型的数据:

predf.m3distrst.agree # A visual comparison of the values 1 (low distrust)and 4 (high trust) 

##         1         2         3         4 
 0.3760939 0.4879099 0.6009491 0.7041654
lower.m3distrst.agree # we want to take the corresponding lower confidence 
interval for 1 (low distrust) and 4 (high distrust)
##         1         2         3         4 
## 0.2691181 0.4146136 0.5410089 0.6270332
upper.m3distrst.agree # we want to take the corresponding higher confidence 
interval for 1 (low distrust) and 4 (high distrust)
##         1         2         3         4 
## 0.4830697 0.5612062 0.6608894 0.7812975

我已经为每个模型创建了条形图,但我想将它们全部放在点图格式中。所以共有7个模型,我们希望用虚线型反映1 dotchart / ggplot中的所有内容。

enter image description here

感谢您的帮助!

0 个答案:

没有答案