Hello all,
I try use effects package.
I have linear model:
fit=lm(y~x*z)
Then I need plot such as:
y axis is y
x axis is x
plot lines for each level z.
I use code:
plot(effect("x*z",fit,xlevels=list(x=levels(x),z=levels(z))),multiline=TRUE)
(The idea comes from "Effect Displays in R for Generalised Linear
Models" by
John Fox)
The code, according the paper, would produce all levels of effect to one graph
instead producing too many panels in the graph. I try to use it but I have
problem:
x has 5 levels and z has 12.
I just get plot with y on vertical axis, z on horizontal axis and lines for
each level x. I think that happened because x has less levels than z.
Please, give me advise, what option I should change or add to get right plot.
I modified this code:
plot(effect("neuroticism*extraversion",mod.cowles,xlevels=list(neuroticism=0:24,extraversion=seq(0,24,6))),multiline=TRUE,ylab="Prabability(Volunteer)")>
Thank you in advance.
Natalia.