[R-sig-ME] how to add a line to a dotplot() of ranef:s?

Hans Ekbrand hans at sociologi.cjb.net
Sun Aug 28 01:28:44 CEST 2011


I have been struggling with this for some hours now and turn to you
for help. I think I'm missing something that is obvious to many of
you.

I would like to add a line to a dotplot of ranef:s, and I think
panel.abline() is the right function, but no line gets added when I
use it like this:

dotplot(my.null.model.fit$ranef, panel.abline(v=0, col="red"))

my other tries have been variations of the following

dotplot(my.null.model.fit$ranef,panel=function(...){
    panel.dotplot(...)
    panel.abline(v=0, col="red")
    })

Error in dotplot.formula(.nn ~ values | ind, ss, se = se, prepanel = prepanel.ci,  : 
  formal argument "panel" matched by multiple actual arguments

I tried to mimic this:

dat<-data.frame(id=c("a","b","c"),val=c(-1,0,0.3))
dotplot(id~val,data=dat,panel=function(...){
    panel.dotplot(...)
    panel.abline(v=0, col="red")
    panel.lmline(dat$val, 1:3)
    })

Any hints on the right syntax greatly appreciated,

--
Hans Ekbrand




More information about the R-sig-mixed-models mailing list