Subscribe to DSC Newsletter

Hi all,

I would like to ask you about a "problem" I have with R. My idea is to show in a summarized plot - like a dotchart, dotplot - the results (odds ratios) obtained from a multivariate logistic regression instead of showing in a table. The problem is that I have tried with the dotplot /dotchart option but I can not control the X-axis limits. Can anyone give a clue, hint to solve it?

Thank you,



Tags: R, dotchart, graphics, logistic, odds, ratio, regression

Views: 279

Replies to This Discussion

Did the parameter "xlim" not work ?

See help("dotchart") , especially the example at the end.
NO, I have tried but I did not work, at least... I will try it again.. Thank you anyway..
example of your code, plz
Hi all,

I solved the problem related with the limits. I forgot to tell you how to customize the ticks, labels in the X axis. Thank you.

The code:

dotplot(odds$Type7 ~ Coef, data = odds,
aspect = 1.25,
xlim = c(-2, 70),
xlab = "Odds",
ylab = "Effects",
panel = function (x, y) {
panel.xyplot(x, y, pch = 16, col = "black")
panel.abline(v=1, lty=2, col=1)
panel.segments(odds$CI1, as.numeric(y),
odds$CI2, as.numeric(y), lty = 1, col = "black")} )
axis(1, at=c(-2,0,1,5,10,20,30,40,50,60,70),


On Data Science Central

© 2021   TechTarget, Inc.   Powered by

Badges  |  Report an Issue  |  Privacy Policy  |  Terms of Service