[R-sig-ME] lme4: plotting profile density (not Zeta) manually not by lattice

Simon Harmel @|m@h@rme| @end|ng |rom gm@||@com
Mon Oct 26 15:51:26 CET 2020


Ben,
I expect the exact same plots that densityplot(profile(fitted_model)) from
lattice produces?

again, densityplot(profile(fitted_model)) throws an error for the model in
my original question (and generally when any parameter's likelihood
distribution is highly spiked or funny-looking)

On Mon, Oct 26, 2020, 8:19 AM Ben Bolker <bbolker using gmail.com> wrote:

>     Can you clarify a bit what you want to plot?
>    as.data.frame(p) is a good way to retrieve a simple data frame from
> profile objects that you can then transform/use to plot as you see fit.
>
>    Ben Bolker
>
> On 10/25/20 8:54 PM, Simon Harmel wrote:
> > Dear All,
> >
> > I'm trying to plot the sampling distributions of my model parameters
> using `
> > densityplot()` from the `lattice` package but lattice often throws an
> error
> > even if one of the estimate's density distribution is highly skewed or
> > funny-looking.
> >
> > Is there a better package or a better way (even manually) to plot the
> > densities (not Zeta) from a `profile()` call?
> >
> > library(lattice)
> > library(lme4)
> >
> > hsb <- read.csv('
> > https://raw.githubusercontent.com/rnorouzian/e/master/hsb.csv')
> > m31 <- lmer(math ~ ses*meanses + (ses | sch.id), data = hsb)
> >
> > p <-  profile(m31)
> > densityplot(p)
> > Error in UseMethod("predict") :
> >    no applicable method for 'predict' applied to an object of class
> "NULL"
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-mixed-models using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



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