I'm trying to plot the results of a regression and I need to plot the coefficients estimated plus 95% confidence interval (actually I have 95% credibility interval, since I'm fitting a Bayesian model, but the idea is the same). And in the x axis, I need to put the name of each variable.
Here what I tried, but it didn't work.
library(lattice)
library(Hmisc)
betas1=c(0.4271611, -0.4730473, 0.8428530, -0.4356814, 0.2699920, -0.2308315)
quantiles.beta = matrix(c(-0.09015,-1.30900, 0.43290, -0.85280, 0.02675, -0.56850, 0.93940, 0.37390, 1.28900, -0.03920, 0.52410, 0.07017), ncol=2)
xYplot(Cbind(betas1,quantiles.beta) ~ seq(0, 125, 25), varwidth = TRUE, ylab="Betas",
xlab="Ano", ylim=c(-1.5, 1.5), scales=list(cex=1.2, x = list(at=seq(0,125, by=25),
labels = c("PIB per cap.", "democracia", "ginete_park", "educ","patentes", "FDI" ) ),
abline=c(list(h=0), lty="dotted",
col= "grey69"), main="Betas estimados no modelo 1",
sub="Inclinação das Covariáveis com respectivos 95% intervalo de credibilidade estimados no modelo1"))
Thanks in advance for any help.
ps.: helping to set title, xlab and ylab font and size would be a plus to me.