[R] xyplot, loess and se

Luca De Benedictis debene at unimc.it
Sat May 8 13:24:19 CEST 2004


Dear R-friends,
in plotting x and y, conditioning on z, I am trying to find a way to 
make the standard errors appearing together with the loess in the 
trellis plot.
I have tried the following code without success.

x <- x
y <- y
z.two.groups <- equal.count(z, number=2, overlap=.1)
 > xyplot(x~y | z.two.groups,
+ prepanel = function(x, y)
+ prepanel.loess(x, y, span = .75, se = TRUE),
+ panel = function(x, y){
+ panel.grid(h = 2, v = 2, lwd = 2)
+ panel.xyplot(x, y, cex = 0.6)
+ panel.loess(x, y, span = .75, se = TRUE)
+ },
+ par.strip = list(cex = .75),aspect = 2,
+ xlab = list("x",cex = 1),
+ ylab = list("y",cex = 1),
+ main=list("", cex=2)
+ )

Any help would be appreciated

Luca




More information about the R-help mailing list