Dear John and Tom,

Thank you for your suggestions.  The thing that I am now wondering is if I
need to take account of the variance in the random effects into my
confidence intervals, as well as the fixed effects?  The effect and lsmeans
package compute intervals based only on fixed effects I think...

>From speaking to a few people I was starting to think that maybe only the
fixed effects needed to be accounted for in the CIs since I am trying to
make inferences about the differences between levels of only fixed effects,
but coming across this post:

https://stat.ethz.ch/pipermail/r-sig-mixed-models/2011q1/015895.html

made me think that in fact the random effects do need to be taken account
of.  The post above provides me with a solution for my Gaussian models
(using languageR and a mcmc simulation for confidence interval creation),
as does my SO post (
http://stackoverflow.com/questions/18421064/extract-treatment-means-from-an-lmer-object-and-calculate-error-bars/18433570#comment27114068_18433570
 - I am sorry for the overlap here) but I am still stuck as to what to do
with my proportion-based models, which have a binomial error distribution -
I don't think languageR allows for a mcmc estimation of confidence
intervals for anything other than a Gaussian distribution (this link
http://www.inside-r.org/packages/cran/languageR/docs/plotLMER.fnc says that
" For Gaussian models, 95% highest posterior density credible intervals can
be added").

If either of you have any advice on the above I would be very glad to hear
it!

Thanks once again,

Sarah


On Mon, Aug 26, 2013 at 7:27 PM, Tom Wenseleers <
Tom.Wenseleers@bio.kuleuven.be> wrote:

> Dear Sarah,
> The effect package I believe would give confidence intervals as if they
> would be calculated from the SE on the Wald statistics, so this is not
> totally ideal.
> Would the lsmeans package perhaps work better for you? That I believe can
> also work with glmer objects, so should cover both the Gaussian and
> binomial case...
> (The plotting you'll have to do yourself though, unlike in the effects
> package.)
>
> Cheers,
> Tom
>
> -----Original Message-----
> From: r-sig-mixed-models-bounces@r-project.org [mailto:
> r-sig-mixed-models-bounces@r-project.org] On Behalf Of John Fox
> Sent: 26 August 2013 19:27
> To: 'Sarah Dryhurst'
> Cc: r-sig-mixed-models@r-project.org
> Subject: Re: [R-sig-ME] Error bars for treatment interactions in Gaussian
> and Binomial mixed models
>
> Dear Sarah,
>
> You might try effect(), Effect(), or allEffects() in the effects package.
>
> I hope this helps,
>  John
>
> > -----Original Message-----
> > From: r-sig-mixed-models-bounces@r-project.org [mailto:r-sig-mixed-
> > models-bounces@r-project.org] On Behalf Of Sarah Dryhurst
> > Sent: Monday, August 26, 2013 12:03 PM
> > To: r-sig-mixed-models@r-project.org
> > Subject: [R-sig-ME] Error bars for treatment interactions in Gaussian
> > and Binomial mixed models
> >
> > I have a model that I am running via lme4:
> >
> > m1 <- lmer (Dependent ~ Tmt1 * Tmt2 + (1 | Block / Tmt1))
> >
> > I am running this model for each of the three years of my experiment
> > in turn.  Each treatment is a two level factor (treatment and control).
> > It is
> > a split plot design (with Treatment 2 embedded within Treatment 1
> > embedded within block).
> >
> > I'm interested in plotting each level of the interaction between the
> > two treatments (i.e. 4 means), and some measure of error around each
> > of these treatment means, for each year in turn.  This first set of
> > models are Gaussian, but I have another set which use a binomial error
> > distribution.
> >
> > I am wondering if there is any package available that calculates
> > interaction treatment means and their error bars for such models?
> >  Everything I come across completely ignores the random effect
> > variation in error bar calculation (e.g.the effects package)...
> >
> > I tried plotLMER.fnc in language R which was useful for my Gaussian
> > model, but doesn't work for the Binomial one (as the error
> > calculations are based on an mcmc simulation).  Further I cannot
> > actually extract the HPD 95% CI values for each treatment that
> > plotLMER gives me!
> >
> > Using the ez package I have been able to predict the treatment means
> > and calculate the variance for these means, but I am unsure how to
> > convert these variances to appropriate error estimations by hand (as I
> > am assuming I need to take account of the random effect variance
> > too?).  Again this is only for the Gaussian models...
> >
> > If anyone has any suggestions it would be much appreciated!  Sorry if
> > this is a simple question - I am new to these models :-)
> >
> > Thanks in advance,
> >
> > Sarah
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > 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
>



-- 
NERC PhD Student
Community Ecology and Global Change
Department of Biology
Imperial College, London
email: sarah.dryhurst08@imperial.ac.uk

	[[alternative HTML version deleted]]

