I have need of creating a plot displaying confidence intervals (for the mean bias in parameter estimates) with one panel or facet for each of the two parameters in question.
I can do this in base R graphics, but the result is not as aesthetically pleasing as I would like. I have attached an example graphic in the file "eg.pdf". I would like to try using ggplot2, but cannot get my head around the syntax. (Life is a struggle when one is old and senile!) I have been shown in the past how to produce a single-facet plot of such confidence intervals, basically using the geom_errorbar() function, but I cannot see how to produce multiple facets, depending on a "param" factor. I have thrashed around a bit but after succeeding in only confusing myself, I thought I would save wear and tear on my brain by asking this list. I'm sure the answer is pretty simple, but I'm just too stupid to see it. Can anyone give me a recipe for creating, with ggplot(), a graphic like unto that shown in "eg.pdf", but prettier? I have attached the data that were used to create "eg.pdf" in the form of a data frame, in a file called "egData.txt". This file was produced by dput() so read it in using dget("egData.txt"). With eternal gratitude. cheers, Rolf Turner -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276
eg.pdf
Description: Adobe PDF document
structure(list(Ndat = c(100, 500, 1000, 1500, 2000, 100, 500, 1000, 1500, 2000), lower = c(0.209325514321019, 0.0403237235334606, 0.0145196529159657, 0.0216209917402008, -0.00989822805983288, 1.67646857307238, 0.293606879421865, 0.126166692157642, 0.135454331658732, -0.0506914315997755), estimate = c(0.328510135047226, 0.0804793047005517, 0.0401822279422254, 0.0422410687789209, 0.00959659685206644, 2.42401777661119, 0.512738636066594, 0.262346592121412, 0.245742220593958, 0.0555399174577091), upper = c(0.447694755773433, 0.120634885867643, 0.0658448029684851, 0.0628611458176411, 0.0290914217639658, 3.17156698015001, 0.731870392711323, 0.398526492085181, 0.356030109529183, 0.161771266515194 ), param = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L ), .Label = c("alpha", "beta"), class = "factor")), class = "data.frame", row.names = c(NA, -10L))
______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.