rotating the grid to plot horizontal errors bars with Hmisc::xYplot in R
I'm using xYplot to plot my regressions results with error bars. However, xYplot only plots horizontal error bars, and I need vertical error bars. Looking around for a solution, I found [this thread][1] where someone asked roughly the same question. After some messages, the user who asked the question says that "I just  discovered that using the xYplot (Hmisc) and rotating the grid
viewport (and the labels etc) given me exactly what I need".

So I looked around on how to rotate the grid and found that using grid library and pushviewport etc. you can rotate the grid. However, my code isn't working. Here is what I tryed so far:

    estimate=structure(list(coefi = c(-5.08608456607495, -4.17906898422091, 
    -2.85696514398422, -3.06968196245069, -2.73660002514793, -1.0017403629931, 
    -1.66291850690335, 0.431265159072978, -0.472895611533531, 0.845421348865878, 
    -0.437434919008876, 0.269041451577909, -0.233066564595661, 0.0137190330621302, 
    -2.94808159763314, 1.9166875739645), lower = c(-8.1895, -6.8485, 
    -5.214125, -5.532875, -5.106625, -3.271625, -3.97375, -0.09773, 
    -1.340625, 0.415125, -0.86615, 0.02665125, -0.5861, -2.079, -5.626625, 
    0.8115125), upper = c(-2.11475, -1.611125, -0.5602375, -0.7309625, 
    -0.3721375, 1.259875, 0.7167875, 0.9672875, 0.39035, 1.30025, 
    -0.05634125, 0.5115, 0.07237875, 2.14275, -0.3653, 4.202625), 
    x = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
    16)), .Names = c("coefi", "lower", "upper", "x"), row.names = c("alpha.1.", 
    "alpha.2.", "alpha.3.", "alpha.4.", "alpha.5.", "alpha.6.", "alpha.7.", 
    "b.income", "b.democracy", "b.ginete", "b.educ", "b.patent", 
    "b.fdi", "b.0", "mu.alpha", "sigma.alpha"), class = "data.frame")

    legenda=c(as.character(seq(1970,2000,5)),"PIB_pc", "democ",  "legis", "educ", "patent", "FDI",  "b.0", "mu.ano", "var.ano" )

    grid.newpage()
    pushViewport(viewport(angle = 90, name = "VP"))
    upViewport() 
    xYplot(Cbind(coefi,lower, upper) ~x, data=estimate, , varwidth = TRUE, ylab="Betas",
    xlab="Inclinação das Covariáveis com respectivos 95% intervalos de credibilidade \n N=409",
    ylim=with(estimate,c(min(lower)-.5, max(upper)+.5)),  scales=list(cex=1.2, x = list(at=seq(1,16,     by=1), labels = legenda)) ,abline=c(list(h=0), lty="dotted", col= "grey69"), xlab.top="Adesão ao Tratado de Cooperação de Patentes, 1970-2000", draw.in = "VP")

I'd apreciate any help.

  [1]: http://r.789695.n4.nabble.com/R-Hmisc-or-Lattice-plot-with-error-bars-Depth-independent-variable-on-Y-axis-td811365.html
rotating the grid to plot horizontal errors bars with Hmisc::xYplot in R
===

I'm using xYplot to plot my regressions results with error bars. However, xYplot only plots horizontal error bars, and I need vertical error bars. Looking around for a solution, I found [this thread][1] where someone asked roughly the same question. After some messages, the user who asked the question says that "I just  discovered that using the xYplot (Hmisc) and rotating the grid
viewport (and the labels etc) given me exactly what I need".

So I looked around on how to rotate the grid and found that using grid library and pushviewport etc. you can rotate the grid. However, my code isn't working. Here is what I tryed so far:

    estimate=structure(list(coefi = c(-5.08608456607495, -4.17906898422091, 
    -2.85696514398422, -3.06968196245069, -2.73660002514793, -1.0017403629931, 
    -1.66291850690335, 0.431265159072978, -0.472895611533531, 0.845421348865878, 
    -0.437434919008876, 0.269041451577909, -0.233066564595661, 0.0137190330621302, 
    -2.94808159763314, 1.9166875739645), lower = c(-8.1895, -6.8485, 
    -5.214125, -5.532875, -5.106625, -3.271625, -3.97375, -0.09773, 
    -1.340625, 0.415125, -0.86615, 0.02665125, -0.5861, -2.079, -5.626625, 
    0.8115125), upper = c(-2.11475, -1.611125, -0.5602375, -0.7309625, 
    -0.3721375, 1.259875, 0.7167875, 0.9672875, 0.39035, 1.30025, 
    -0.05634125, 0.5115, 0.07237875, 2.14275, -0.3653, 4.202625), 
    x = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
    16)), .Names = c("coefi", "lower", "upper", "x"), row.names = c("alpha.1.", 
    "alpha.2.", "alpha.3.", "alpha.4.", "alpha.5.", "alpha.6.", "alpha.7.", 
    "b.income", "b.democracy", "b.ginete", "b.educ", "b.patent", 
    "b.fdi", "b.0", "mu.alpha", "sigma.alpha"), class = "data.frame")

    legenda=c(as.character(seq(1970,2000,5)),"PIB_pc", "democ",  "legis", "educ", "patent", "FDI",  "b.0", "mu.ano", "var.ano" )

    grid.newpage()
    pushViewport(viewport(angle = 90, name = "VP"))
    upViewport() 
    xYplot(Cbind(coefi,lower, upper) ~x, data=estimate, , varwidth = TRUE, ylab="Betas",
    xlab="Inclinação das Covariáveis com respectivos 95% intervalos de credibilidade \n N=409",
    ylim=with(estimate,c(min(lower)-.5, max(upper)+.5)),  scales=list(cex=1.2, x = list(at=seq(1,16,     by=1), labels = legenda)) ,abline=c(list(h=0), lty="dotted", col= "grey69"), xlab.top="Adesão ao Tratado de Cooperação de Patentes, 1970-2000", draw.in = "VP")

I'd apreciate any help.

  [1]: http://r.789695.n4.nabble.com/R-Hmisc-or-Lattice-plot-with-error-bars-Depth-independent-variable-on-Y-axis-td811365.html