How to plot logistic models with many categorical variables?
Specifically,
I'm creating the following kind of model (more variables are still to be added):
glm(cancer ~ trt + factor(exposure) + skin +
gender + factor(age), family = binomial, data = dta)
which is about modelling how different variables affect the risk of getting skin cancer.
One can see that it would be interesting to plot along both age (range: integers [28, 84]) and exposure (range: integers [1, 21]), however plotting against two variables doesn't seem to be possible in a typical y-x setting so plotting against two variables would either be a 3D plot or is there perhaps some other way?


plot(y ~ x, col = "that third factor", type = 'p')should work if the third factor is a factor. Alternatively you could look at theggplot2package. – JAD Oct 20 '16 at 14:30