[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-mixed-models
Subject:    Re: [R-sig-ME] how to add a line to a dotplot() of ranef:s?
From:       Dennis Murphy <djmuser () gmail ! com>
Date:       2011-08-28 8:23:24
Message-ID: CADv2QyEv0naJGboqzAuaXwPDcukXaUP8N6we+z-E9JSjfMBTYw () mail ! gmail ! com
[Download RAW message or body]

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@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@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

_______________________________________________
R-sig-mixed-models@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic