I am trying to replicate the example, given in Statistical Models in S. Here is the code given in the book.
data(ethanol)
attach(ethanol)
E.intervals <- co.intervals(E, number = 9, overlap = 1/4)
coplot(NOx ~ C | E, given.values = E.intervals,
panel = function(x,y) panel.smooth(x,y,degree = 1, span = 1))
This code works only in S, because panel.smooth function doesn’t have degree argument.
So I used
coplot(NOx ~ C | E, given.values = E.intervals,
panel = function(x,y,...) panel.smooth(x,y, iter = 1, span = 1))
I would like to use lattice graphics package because it has panel.loess function that is similar to panel.smooth from S, but I haven’t found the function similar to coplot. I think it is xyplot. If it is, can you suggest me the parameter equivalent to given.values?
Here is how it might be done, it is not quite the same but very close.
The difference is the hight of the upper plot, it should be smaller.