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

Dennis Murphy djmuser at gmail.com
Sun Aug 28 10:23:24 CEST 2011


Hi:

Are you looking for something like Figure 4.2 in the Lattice book?
http://lmdvr.r-forge.r-project.org/figures/figures.html
(Click on Figure 4.2)

If so, then try this:

dat<-data.frame(id=c("a","b","c"),val=c(-1,0,0.3))
dotplot(id~val,data=dat, origin = -1, type = c('p', 'h'))

The origin provides the starting point of val.

HTH,
Dennis

On Sat, Aug 27, 2011 at 4:28 PM, Hans Ekbrand <hans at sociologi.cjb.net> wrote:
> 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
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>




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