Hi guys:
Some months ago, I did see a message from Dr Bates, announcing a book he was writing on mixed models using lme4. Have any of you got an idea whether this book is already published?

Cheers
Leo




________________________________
De: "r-sig-mixed-models-request@r-project.org" <r-sig-mixed-models-request@r-project.org>
Para: r-sig-mixed-models@r-project.org
Enviado: Martes, 18 de octubre, 2011 5:00:02
Asunto: R-sig-mixed-models Digest, Vol 58, Issue 20

Send R-sig-mixed-models mailing list submissions to
    r-sig-mixed-models@r-project.org

To subscribe or unsubscribe via the World Wide Web, visit
    https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
or, via email, send a message with subject or body 'help' to
    r-sig-mixed-models-request@r-project.org

You can reach the person managing the list at
    r-sig-mixed-models-owner@r-project.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-sig-mixed-models digest..."


Today's Topics:

   1. Re: longitudinal analysis of nested samples (Christopher Eckert)
   2. Re: parameter restrictions (Ben Bolker)
   3. Re: Observer-level random effects & the varianc (Ross Culloch)
   4. to interpret the interactions of treatment factors in    lme4
      (Likan Zhan)
   5. mcmcsamps for binomial models in lmer (Gillian Raab)
   6. Re: longitudinal analysis of nested samples (ONKELINX, Thierry)


----------------------------------------------------------------------

Message: 1
Date: Mon, 17 Oct 2011 09:37:31 -0400
From: Christopher Eckert <chris.eckert@queensu.ca>
To: r-sig-mixed-models@r-project.org
Subject: Re: [R-sig-ME] longitudinal analysis of nested samples
Message-ID: <8DC43B42-85D9-4F10-9F0E-B44C6194F76D@queensu.ca>
Content-Type: text/plain; charset=us-ascii


Chris Eckert
Department of Biology
Queen's University
Kingston, Ontario K7L 3N6 Canada
chris.eckert@queensu.ca


> 
> Date: Mon, 17 Oct 2011 08:20:19 +0000
> From: "ONKELINX, Thierry" <Thierry.ONKELINX@inbo.be>
> To: Giancarlo Sadoti <gcsadoti@yahoo.com>,
>     "r-sig-mixed-models@r-project.org"    <r-sig-mixed-models@r-project.org>
> Subject: Re: [R-sig-ME] longitudinal analysis of nested samples
> Message-ID:
>     <AA818EAD2576BC488B4F623941DA74273B8A26EA@inbomail.inbo.be>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Dear Giancarlo,
> 
> You will need to have a look at your data. Since you claim that TR has 4 levels but the model output indicates only one (Number of obs: 560, groups: TR, 1).
> 
> The trees are nested within point. Therefore a more likely model is lmer(V ~ YR + (1|PT/TR), data=TREES) or lmer(V ~ YR + (1|PT) + (1|PT:TR), data=TREES) Both models are identical, the second is a bit more verbose but more clear. If the points are nested within transects then you can simply add it to the model: lmer(V ~ YR + (1|Transect) + (1|Transect:PT) + (1|Transect:PT:TR), data=TREES)
> 
> These are models with only a random intercept. You can add random slopes as well. E.g. if you want a random slope along year at the tree level:
> lmer(V ~ YR + (1|Transect) + (1|Transect:PT) + (1 + YR|Transect:PT:TR), data=TREES)
> 
> Best regards,
> 
> Thierry
> 
I am interested in this analysis and have a question for Dr. Onlelinx:
He suggested that for a random slopes and intercepts model, one would use:
> lmer(V ~ YR + (1|Transect) + (1|Transect:PT) + (1 + YR|Transect:PT:TR), data=TREES)
Why is the 4th term (1+ YR|Transect:PT:TR) why not just (YR|Transect:PT:TR)?
Thanks very much for any light you can shed on this.
I'm still coming to terms with lmer syntax.

Chris Eckert
Department of Biology
Queen's University
Kingston, ONtario, Canada



------------------------------

Message: 2
Date: Mon, 17 Oct 2011 14:48:17 +0000 (UTC)
From: Ben Bolker <bbolker@gmail.com>
To: r-sig-mixed-models@r-project.org
Subject: Re: [R-sig-ME] parameter restrictions
Message-ID: <loom.20111017T155049-287@post.gmane.org>
Content-Type: text/plain; charset=utf-8

Shu Ding <dingx099@...> writes:

> *is there a simple way in R to add parameter restrictions to linear mixed
> effects models. Specifically I would like to restrict slope coefficients to
> be*
> 
> *b1<0 and 0<b2< -b1 and 0<b3< -b1-b2 and ? and 0<b7< -b1-b2-b3-b4-b5-b6.*
> 
> * *
> 
> *Can I use lmeControl, optim, optimx? And How?*
> 

  I don't think there's an easy way to do this.
  You could use AD Model Builder, which allows box constraints 
(lower < parameter < upper ) on individual parameters; reparameterization
(e.g. make b2' = -b2/b1, constrain it between 0 and 1, then b2 will
be constrained between 0 and -b1); and generalized penalties.  But
there's a pretty steep learning curve.


  Ben Bolker



------------------------------

Message: 3
Date: Mon, 17 Oct 2011 08:27:47 +0100
From: Ross Culloch <ross.culloch@durham.ac.uk>
To: r-sig-mixed-models@r-project.org
Cc: highstat@highstat.com
Subject: Re: [R-sig-ME] Observer-level random effects & the varianc
Message-ID: <6136B577-57A8-4C53-AB48-3AA1EA86CBEA@dur.ac.uk>
Content-Type: text/plain


> Subject: Re: [R-sig-ME] Observer-level random effects & the varianc
> Message-ID:
>     <1b2697e9233051b4681cc1534e6e183f10ecf803@sitemail.hostway.com>
> Content-Type: text/plain
> 
> 

Hi Alain, 

thanks for the reply - much appreciated..

> Dear Ross,
> 
> In our upcoming book "Zero Inflated Models and Generalized Linear
> Mixed Models with R" (sorry for the advertising here)

No doubt, like your other books that one will also be on the shelf in our lab once it is published (although sadly that will be after the thesis is due) :)

> we have a
> section in which we simulate data and apply GLMMs with and without an
> observation level random effect. Just a plain simple linear mixed
> model with a random intercept, and some extra noise added for the
> OLRE.
> 
> Y_ij = alpha + beta * X_ij + a_i + eps_ij
> 
> a_i      ~ N(0, sigma1^2)
> eps_ij ~ N(0, sigma2^2)
> 
> In most scenarios (different values for sigma1 and sigma2) both
> variances are estimated close to what they should be. Occasionally I
> see (real) data sets in which the OLRE consumes all the variation,

Indeed, for a data set that I did not present that is the case - which I must admit, I really don't understand. 

> and
> the variance of the random effect a_i is nearly 0. This is confusing
> as the steps are often along the lines of:
> 
> Y_ij = alpha + beta * X_ij + a_i
> a_i      ~ N(0, sigma1^2)
> 
> Sigma1 bigger than 0....but..he.....there is overdispersion....add
> the OLRE.....and then the sigma1 is close to 0. I guess that is a
> scenario where the a_i are all close to 0 anyway.

That seems to be true for my data sets, the values are very low in the first instance, add the OLRE and then it just = 0

> 
> To fully understand the mechanism of the OLRE I suggest that you
> simulate data according to the model above..use different valeus for
> sigma1 and sigma2...and then estimate them. It helps understanding
> what such models do!

I'll give that a go, thanks for the advice!

> 
> In my opinion it is perhaps better to ask yourself the question why
> there is overdispersion (zero inflation, correlation, outliers,
> missing covariates, large variation in the data, non-linear patterns
> modeled as linear). Instead of fixing the problem with a big canon the
> like observation level REs I prefer to dig deeper and fix the problem
> in the appropriate way.

Following your GLMM book and your paper (of which I don't have to hand to properly reference) among other sources, I have checked for all of these potential concerns and accounted for them all (well, missing covariates are hard to account for, so that may be the only exception). 

I really appreciate that point of view, ('fixing with cannon') and I will have a look at simulating the data - but as a skeptic (or perhaps better put as a field research pretending to play statistician) my main concern is (especially considering your long list of potential 'problems') is that I don't know what this cannon ball is trying to fix. But if the OLRE does affect the result would it be safe to say that there is 'a problem'? 

Cheers,

Ross

> 
> Alain
> www.highstat.com [1]
> 
>     Hello all, I am comparing two GLMMs (please see below), one that
> includes the observer-level random effect (OLRE) and one that does
> not. As I understand it, without the OLRE the variance is absorbed in
> the FINAL_ID_FAC (variance = ca. 0.14). By comparing the two models
> there is clearly a considerable difference in the variance of the
> FINAL_ID_FAC, and more importantly the OLRE, which now explains
> considerably more of the variance (ca. 0.4) as compared to the
> FINAL_ID_FAC (ca. 0.12). Ultimately, I am interested in using the
> random effect (FINAL_ID_FAC) to make inference on the importance of
> considering individual in the model. My concern is that the OLRE is
> accounting for the variation within and between individuals, which is
> what I am trying to (somehow) quantify. Previous researchers have
> published without using OLRE (as this field of ecology is constantly
> evolving this very understandable!). However, my results lead me to
> different conclusions (by using the BLUPs for each ID in a subsequent
> analysis) depending on whether or not I include or exclude the OLRE. I
> have posted about this before (many thanks to David Duffy for his
> reply) and I have read numerous posts from other members that
> constantly post on this forum, perhaps I have missed the point, but I
> am still not entirely comfortable with exactly what variation the OLRE
> is accounting for. Many thanks for your time, and any advice you are
> willing to share! Ross
> ########################################################################################
> Generalized linear mixed model fit by the Laplace approximation
> Formula: cbind(PC_C_T, PC_C_F) ~ S_ACT_PUP_PROP + S_POOL_DIST + (1 |
> FINAL_ID_FAC) Data: MODEL_DATA_ID_2009 AIC BIC logLik deviance 1149
> 1170 -570.4 1141 Random effects: Groups Name Variance Std.Dev.
> FINAL_ID_FAC (Intercept) 0.14343 0.37872 Number of obs: 1525, groups:
> FINAL_ID_FAC, 15 Fixed effects: Estimate Std. Error z value Pr(>|z|)
> (Intercept) -3.95641 0.11727 -3374 < 2e-16 *** S_ACT_PUP_PROP 0.42450
> 0.05467 7.76 8.21e-15 *** S_POOL_DIST 0.15400 0.07245 2.13 0.0336 *
> --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
> Correlation of Fixed Effects: (Intr) S_ACT_ S_ACT_PUP_P -0.170
> S_POOL_DIST -0.079 -0.045
> ########################################################################################
> Generalized linear mixed model fit by the Laplace approximation
> Formula: cbind(PC_C_T, PC_C_F) ~ S_ACT_PUP_PROP + S_POOL_DIST + (1 |
> FINAL_ID_FAC) + (1 | OBS_INDEX) Data: MODEL_DATA_ID_2009 AIC BIC
> logLik deviance 1144 1171 -567.2 1134 Random effects: Groups Name
> Variance StdDev. OBS_INDEX (Intercept) 0.40142 0.63358 FINAL_ID_FAC
> (Intercept) 011623 0.34092 Number of obs: 1525, groups: OBS_INDEX,
> 1525; FINAL_ID_FAC, 15 Fixed effects: Estimate Std. Error z value
> Pr(>|z|) (Intercept) -4.13969 0.11132 -37.19 < 2e-16 ***
> S_ACT_PUP_PROP 0.43440 0.05960 729 3.12e-13 *** S_POOL_DIST 0.15137
> 0.07498 2.02 0.0435 * --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*?
> 0.05 ?.? 0.1 ? ? 1 Correlation of Fixed Effects: (Intr) S_ACT_
> S_ACT_PUP_P -0.179 S_POOL_DIST -0.081 -0038
> ########################################################################################
> 
> 
> Links:
> ------
> [1] http://www.highstat.com/
> 
> 
>     [[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------


    [[alternative HTML version deleted]]



------------------------------

Message: 4
Date: Tue, 18 Oct 2011 10:09:15 +1100
From: Likan Zhan <zhanlikan@hotmail.com>
To: r-sig-mixed-models@r-project.org
Subject: [R-sig-ME] to interpret the interactions of treatment factors
    in    lme4
Message-ID: <BLU0-SMTP2152436453390AB4DC4379FB3E40@phx.gbl>
Content-Type: text/plain; charset="us-ascii"


> Dear Dr. Maechler,

> I am writing to ask a clarification when I am trying to use "lme4" package in R.

> If in our experiment, both A and B are three levels treatment factors:
> A:1,2,3;
> B:1,2,3

> And we use the following model to fit our data:
> model=lmer(response~A*B+(1|subject)+(1|trial),data=xx)

> and the following is the result of the fixed-effects:

> Fixed-effects

> (Intercept)    t=100, p<.000
>  A2           t=1.0, p<.9
>  A3           t=1.0, p<.9
>  B2           t=10,  p<.008
>  B3           t=1.0, p<.9
>  A2:B3        t=100, p<.000   <===
>  A3:B3        t=1.8, p<.6
>  A3:B2        t=1.0, p<.7
>  A3:B3        t=1.0, p<.6

> Could you tell me what is the meaning of the significant effect of "A2:B3",
> what is the null hypothesis of it?

> Thank you very much.

> Likan



------------------------------

Message: 5
Date: Tue, 18 Oct 2011 09:32:10 +0100
From: Gillian Raab <gillian.raab@gmail.com>
To: r-sig-mixed-models@r-project.org
Subject: [R-sig-ME] mcmcsamps for binomial models in lmer
Message-ID:
    <CAJCiz0xAYZUQw-JJiW-a1BkUwfd4=bgxVzt6i+Vsy2ph=NU8PA@mail.gmail.com>
Content-Type: text/plain

I have some functions that uses an old version of the lme4 package where
mcmcsamp was implemented for binomial models. WHen I try to run it on the
latest lmer implementation I get messages saying "Update not yet written".

Is there any chance it may be written some time soon? The old version used
to work fine for getting reasonable confidence intervals for variance
components. If not are there alternatives that would not take too much
rewriting. Would MCMCsamp have similar syntax?

Here is some sample models from my functions.

#A univariate model:
    fitres1<-lmer(cbind(pos,neg)~1+(1|STUDY),
    family=binomial(link = "logit"),data=TPR )
    spl1<-mcmcsamp(fitres1,Nmcmc+5000)[-1:-5000,]

# a bivariate model
fitres<-lmer(cbind(pos,neg)~(GROUP)*(logit_-1)+(logit_-1|STUDY),
        family=binomial(link = "logit"),data=dd)
         spl<-mcmcsamp(fitres,Nmcmc+5000)[-1:-5000,]



With many thanks to all you R folk for making things available.

-- 
Gillian M Raab
10 Ainslie Place EH3 6AS
tel 0131 226 6234
mobile 07748 678 551

    [[alternative HTML version deleted]]



------------------------------

Message: 6
Date: Tue, 18 Oct 2011 08:43:07 +0000
From: "ONKELINX, Thierry" <Thierry.ONKELINX@inbo.be>
To: Christopher Eckert <chris.eckert@queensu.ca>,
    "r-sig-mixed-models@r-project.org" <r-sig-mixed-models@r-project.org>
Subject: Re: [R-sig-ME] longitudinal analysis of nested samples
Message-ID:
    <AA818EAD2576BC488B4F623941DA74273B8A312D@inbomail.inbo.be>
Content-Type: text/plain; charset="us-ascii"

Dear Chris,

(1 + A|B)  and (A|B) are identical. (1 + A|B) just is more explicit about the presence of the random intercept.

Best regards,

Thierry

----------------------------------------------------------------------------
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium

Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium

tel. + 32 54/436 185
Thierry.Onkelinx@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey



------------------------------

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


End of R-sig-mixed-models Digest, Vol 58, Issue 20
**************************************************
	[[alternative HTML version deleted]]


