I'm working on an example of plotting predicted probabilities from a
proportional odds model.
The steps below generate a data frame, plotdat, that I want to plot with
ggplot.
library(MASS)
data(Arthritis, package=vcd)
arth.polr - polr(Improved ~ Sex + Treatment + Age, data=Arthritis,
Thanks, Dennis
Not quite. I need to have the same lines as in the original, using
plotdat, but then
add the points from your plotdat2
gg - ggplot(plotdat, aes(x = Age, y = Probability, color = Level)) +
geom_line(size=2.5) + theme_bw() + xlim(10,80) +
#geom_point(color=black,
Hi,
May be this helps:
gg - ggplot(plotdat, aes(x = Age, y = Probability, color = Level)) +
geom_line(size=2.5) + theme_bw() + xlim(10,80) + facet_grid(Sex ~ Treatment, #
scales = free, labeller = function(x, y) sprintf(%s = %s, x, y) )
plotdat2 -
3 matches
Mail list logo