Skip to content
Prev 178678 / 398506 Next

effects package --- add abline to plot

On Apr 28, 2009, at 12:00 AM, Prew, Paul wrote:

            
I have concerns that you are considering these probabilities. They are  
not going to be probabilities. They are effects.
I do not know why that is happening and you have not provided a  
minimal executable example. The vectorized use of abline does succeed  
in a simper example:

 > plot(.5,.5)
 > abline(h=c(0.1,0.2,0.3,0.4,0.5,0.6))

  .... so the problem may lie in how the effects package completes its  
plot function for this particular object. You ought to provide at a  
minimum the results of str on that object. Perhaps it executes a  
device call and then turns off the device? However I loaded the  
effects package and ran that abline call after the example:

 > mod.cowles <- glm(volunteer ~ sex + neuroticism*extraversion,
+     data=Cowles, family=binomial)
 > eff.cowles <- allEffects(mod.cowles, xlevels=list(neuroticism=0:24,
+     extraversion=seq(0, 24, 6)))
 > eff.cowles


I did not get what I expected, which would have been a single  
horizontal line at 0.4 but rather got four lines roughly at 0.351,  
0.378, 0.408, 0.439. Even then, I would have expected one more line  
before the upper limits of that plot, which makes me think these four  
lines were the results of arguments 0.3 ,0.4, 0.5, 0.6.   Most R  
plotting is done in the coordinate system rather than with absolute  
coordinates, but perhaps the mixture of base graphics with lattice  
graphis is ht eproblem
David Winsemius, MD
Heritage Laboratories
West Hartford, CT