I have odds ratios with confidence limits which I want to plot in one graph on logarithmic scale. Based on some information available on web I have used the following code, but it did not produce what I really wanted. What I want is that;
1. All odds ratios should have the same colour
2. All estimates (the centre for each line) should have the same symbol
3. No labelling of lags on the right side, so no factor(lag) ( I don't know what that is called) .
ggplot(ddf, aes(x = lag, y = est, ymin = lcl, ymax = ucl)) + geom_linerange(aes(col = factor(lag)), position=position_dodge(width=0.30)) +
dput(oz)
structure(list(est = c(1.00259829132274, 1.00984590955515, 1.00103468123905,
1.00487653316537, 1.01661914108823, 1.0117330149155, 0.998786945494639,
1.00733107403491, 1.00356216944452, 1.00071264109382, 0.998962901445741,
1.00986332731955), lcl = c(0.996222729695739, 1.00014827111742,
0.990881659533582, 0.99728614205013, 1.00299985978141, 1.00018359042038,
0.987787723766998, 0.995295107518125, 0.982501164372296, 0.967196805282684,
0.982112817002489, 0.988975157702037), ucl = c(1.00901465485562,
1.01963757824217, 1.01129173539759, 1.01252469509969, 1.03042335245412,
1.0234158041323, 1.00990864584365, 1.01951258983543, 1.02507464058187,
1.03538988608662, 1.01610208235615, 1.03119267650217), lag = c(1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)), datalabel = "Written by R. ", time.stamp = "30 Oct 2013 11:09", .Names = c("est",
"lcl", "ucl", "lag"), formats = c("%9.0g", "%9.0g", "%9.0g",
"%9.0g"), types = c(255L, 255L, 255L, 254L), val.labels = c("",
"", "", ""), var.labels = c("est", "lcl", "ucl", ""), row.names = c("1",
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"), version = 12L, class = "data.frame")