0

I'm having some dotchart issues.
I know exactly what data I want represented but I cannot seem to create the required in R.

I saw an example that used ggplot2 Dotplot with error bars, two series, light jitter

And I have all the data I want. e.g. (replace x with 1-7 for each of my seven models) predf.mxdistrst.agree # A visual comparison of the predicted values 1 (low distrust) and 4 (high distrust)

lower.mxdistrst.agree # we want to take the corresponding lower confidence interval for 1 (low distrust) and 4 (high distrust)

upper.mxdistrst.agree # we want to take the corresponding higher confidence interval for 1 (low distrust) and 4 (high distrust)

Should I just rbind the data together and create manually? Does anyone have any coding suggestions as to how I should do this?

To provide the data from one model I want to include in the dotchart:

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

I have created barplots for each model, but I want to put all together in dotchart format. So there are 7 models in total and we want to reflect everything in 1 dotchart/ggplot with dashed linetype.

enter image description here

Thank you for your help!

Claus Wilke
  • 16,992
  • 7
  • 53
  • 104
  • 4
    Put the data in a data frame, then plot it. If you need help putting it in a data frame, then don't show us the data you've extracted, show us commands to extract it from the models. And a reproducible example is always appreciated - it will help you get help much faster. – Gregor Thomas Feb 05 '18 at 14:26
  • Please read over this post and provide a reproducible example. https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – jesstme Feb 06 '18 at 04:44

0 Answers0