Skip to content

setting effect plot parameters

2 messages · otoolem, John Fox

#
Dear Malcolm,

You can't specify some trellis arguments to plot.eff() because some of them,
such as scales, will conflict with trellis arguments that are already set by
plot.eff(), the plot() method for objects of class "eff" produced by
effect(). Likewise arguments that you specify via trellis.par.set() may be
overridden by plot.eff().

You should be able to do some of what you want by specifying arguments such
as ticks.x to plot.eff() -- see ?plot.eff. Also, plot.eff() returns an
object that inherits from "trellis" and consequently you should be able to
manipulate it with the update() method for "trellis" objects. For example,

library(effects)
mod <- lm(prestige ~ type*(income + education), data=Prestige)
(eff <- effect("type*income", mod))
(p <- plot(eff))
update(p, scales=list(x=list(at=seq(10000, 20000, 5000), 
                             labels=seq(10000, 20000, 5000))))

Finally the object returned by effect() has a reasonably simple structure
and you should be able to construct a customized plot by using the
information in the object, e.g., with xyplot().

I hope that this helps,
 John

-------------------------------------------------------
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
but
(via
standard
xyplot
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com