[R] small issue with densityplot
Horace Tso
Horace.Tso at pgn.com
Tue Aug 21 23:23:53 CEST 2007
Thank you Prof. Bates and Deepayan. As the title of this thread suggests, it is a minor issue once the user is familar with where to look for hints. But better documentation certainly won't hurt.
H.
>>> "Douglas Bates" <bates at stat.wisc.edu> 8/21/2007 1:44:11 PM >>>
On 8/21/07, Horace Tso <Horace.Tso at pgn.com> wrote:
> Deepayan, you're right. Now I realize anyone could write a densityplot function to apply on a different class of objects. I guess I should write to the author of lme4 which from what I could see does not describe a densityplot. By the way, it is used in Baayen, Davidson, and Bates (2006).
You're right. It's my bad for not documenting that the coda package
is required for plots of the results of mcmcsamp. I was trying to
piggy-back on the work that the authors of the coda package had done
on diagnostics, etc. It was actually Deepayan and I who added the
lattice-based plots to the coda package for exactly this purpose (did
you remember that, Deepayan?).
In some ways it might be better to remove the dependence on coda and
write the classes and methods in the lme4 package. That way I can use
S4 classes and irritate all those people who rail against S4 classes
and methods (and you know who you are).
> >>> "Deepayan Sarkar" <deepayan.sarkar at gmail.com> 8/21/2007 11:17:39 AM >>>
> On 8/21/07, Horace Tso <Horace.Tso at pgn.com> wrote:
> > Hi folks,
> >
> > This is really minor but to someone not familiar with the various tentacles of the lmer package it could be really annoying. I was trying to plot the posterior density of the fixed effect parameters of a lmer model,
> >
> > > hr.mcmc = mcmcsamp(hr.lmer, n=50000)
> > > densityplot(hr.mcmc, plot.points=F)
> >
> > There is this error,
> >
> > "Error in densityplot(hr.mcmc, plot.points = F) :
> > no applicable method for "densityplot" "
> >
> > It kind of smells like something I've come across before. So I checked the mcmcsamp help page, and alas, the example suggests that the package coda is needed.
> >
> > >From the help page of densityplot alone, there is no way one could figure out this dependency. It says, together with histogram, it is part of lattice.
> >
> > Could the function author *please* make clarification in future editions of lattice.
>
> There is nothing to clarify. densityplot() is a generic function, and
> it is not possible for the author of the generic function to
> anticipate and document all possible methods, especially those in
> other packages. I would say that since you are using mcmcsamp(), it's
> perfectly reasonable to expect you to look at its help page to figure
> out what you can do with the results.
>
> What gave you the idea that densityplot would work on the result of
> mcmcsamp in the first place?
>
> -Deepayan
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list