



Hi again to all,
 
Honoré, thanks for your reply. I feel that I did not explain my main doubt properly (plus I realized that I made a mistake about Gelman and Hill´s book example: their grouping factor predictor also has one value per level of the grouping factor and not a series of them as I thought before). 
My main doubt is whether I can answer my question using a mixed model approach.  I want to understand whether the effect on survival of the proportion of conspecifics in the seedling neighborhood is moderated by species-level attributes. One of such attributes is how common (abundant) is the species across the landscape (my LANDSPABN variable). 
I have been thinking that I can do this in two ways. One is conducting two separate analysis: first using lmer to obtain (random) species level coeficients for the effect of conspecifics and then use simple weighted linear regressions to explain those coeficients as a function of species commonnes. I would use the variance of the estimated coeficients as weights. Is this a valid approach?Alternatively I was wondering if I can do this directly in a mixed model. From an example in Gelman and Hill (2007) book I thought I could model the dependence of conspecific effects on species-level attributes by including an interaction between my conspecific effect and the species level attribute. This is, for the fixed part of my model:
 
ALIVE~CONSPp+TOTABN+ LANDSPABN+ CONSPp:LANDSPABN 

A non-trivial question about the model implementation is whether the random term (1+CONSPp| fSPECIES) has to be included or not in the model. The inclusion of this term in the model is what makes the difference between the interaction being significant or not. In the traditional ANOVA framework (which I am still more familiar with) I would say that once I include the random slope in the model my single species-level moderator ( LANDSPABN) does not add anything to the model but I think this is not the way it works in the mixed modeling (likelihood) framework.
Is the interaction term (CONSPp:LANDSPABN) really answering the question on the dependence of the conspecific effect on the commoness of the species?Is including the random term (1+CONSPp| fSPECIES)  needed in the model?Any light on these issues is highly appreciated.Best,
 
Edwin
 
 
> From: r-sig-mixed-models-request@r-project.org
> Subject: R-sig-mixed-models Digest, Vol 65, Issue 59
> To: r-sig-mixed-models@r-project.org
> Date: Wed, 23 May 2012 12:00:02 +0200
> 
> ------------------------------
> 
>  
> Message: 6
> Date: Wed, 23 May 2012 09:22:32 +0100
> From: Samadori Honor? Biaou <hbiaou@gmail.com>
> To: Edwin Lebrija Trejos <elebrija@hotmail.com>
> Cc: r-sig-mixed-models@r-project.org
> Subject: Re: [R-sig-ME] Group level predictors in mixed models
> Message-ID:
> 	<CAGm8FZ2Xv1vc+qt25Tu6HxGMfFdMmh1jg_JmS2t67C1f6BwO=g@mail.gmail.com>
> Content-Type: text/plain
> 
> Hi Edwin,
> 
> You can perhaps test between alternate models using the R built in anova()
> function. It gives a p-value indicating if models are significantly
> different (if not, since the addition of the new term does not
> significantly improve the model fit, you would prefer the simpler model).
> For example, M1 and M2 below differ only by the inclusion of (1|fSPECIES),
> and you can probably test if this addition improve the model fit by using
> anova():
> 
> M1<-lmer(ALIVE~CONSPp+TOTABN+ LANDSPABN+ CONSPp:LANDSPABN +
> (1|PLOT)+(1|YEAR), data=oneyrseedl,family=binomial)
> 
> M2<-lmer(ALIVE~CONSPp+TOTABN+ LANDSPABN+ CONSPp:LANDSPABN +
> (1|PLOT)+(1|YEAR) + (1|fSPECIES), data=oneyrseedl,family=binomial)
> 
> anova (M1, M2)                     # The test for the alternate models
> 
> 
> Please use "help (anova)" for more details and documentation about this
> function.
> 
> Hope it helps,
> 
> Best regards,
> 
> Dr. Ir. Samadori Honoré BIAOU
> Web pages:
> http://sites.google.com/site/hbiaou/
> www.fa-up.bj/staff/Biaou.html
> Skype: hbiaou
> Tel +229 94 55 81 46 / 99 97 97 00
> 
> 
> 
> 
> 2012/5/23 Edwin Lebrija Trejos <elebrija@hotmail.com>
> 
> >
> >
> >
> >
> > Dear R-sig-mixed-models subscribers, I am analizing survival (ALIVE) of
> > one year-old seedlings of over a hundred species as a function of the total
> > number of seedlings (TOTABN) and the proportion of conspecifics seedlings
> > (CONSPp) in their neighborhood (sampling quadrat). The data comes from
> > monitoring seedling dynamics trough time (YEAR) in a series of forest plots
> > (PLOT). A crucial part of the analysis is to understand the variation in
> > responses between species (SPECIES). For now, I have one continuous
> > species-level variable, abundance across the landscape (LANDSPABN), that I
> > would like to use to explain the variation between species. After reading a
> > number of printed and online references on advanced statistical models it
> > seems to me that my problem could be properly analyzed using hierarchical
> > bayesian modelling but I am just beggining to understand lmer (and R) and I
> > was wondering if using such tools I can also perform a meaningfull
> > analysis.My first approach in lmer was to specify a model with varying
> > intercept and slope for the effect of conspecifics, i.e. (1+CONSPp|SPECIES)
> > and to extract from the results the conditional modes (using terminology in
> > Prof. Bates draft book) of the random effects (and their variances) to
> > model them separately as a function other continuous predictors (using
> > simple weighted linear regressions). The full model of this approach is:
> > M1<-lmer(ALIVE~CONSPp+TOTABN+(1+CONSPp|SPECIES)+(1|PLOT)+(1|YEAR),
> > data=oneyrseedl,family=binomial).  After further reading I found an example
> > from Gelman and Hill 2007 in which he includes "group level predictors".
> > Specifically in their example, a predictor X1 appears both as fixed (y~ X1)
> > and random effect (1+ X1 | grouping factor) with the grouping factor
> > predictor (X2) modelled as an interaction with X1. So their full model is y
> > ~ X1 + X2 + X1:X2+ (1 + X1 | grouping factor).  I thought I may be able to
> > specify a similar model to directly incorporate my continuous species-level
> > variable (species abundance across the landscape) to explain the variation
> > in the effect of conspecifics on seedling survival. One crucial difference
> > between my case and Gelman and Hill´s case is that my continuous
> > species-level variable has only one value per species (my grouping factor)
> > while their X2 has a series of values per grouping factor. I thus think
> > that if include the continuous species-level variable in the model I do not
> > need to include a random slope for the effects of conspecifics (with
> > SPECIES as a grouping factor) as I feel it would control for all the
> > variation that could be more meaningfully explained by my species-level
> > variable (or any other species-level variable I may come up later).  Thus,
> > the model I am thinking about would  be: M2<-lmer(ALIVE~CONSPp+TOTABN+
> > LANDSPABN+ CONSPp:LANDSPABN + (1|PLOT)+(1|YEAR),
> > data=oneyrseedl,family=binomial).  I am doubting if a random intercept by
> > SPECIES is still needed (i.e. (1|fSPECIES).I hope I have exposed my problem
> > clearly. I would highly appreciate any insight from the mixed model
> > experts.Kind regards,Edwin
> >        [[alternative HTML version deleted]]
> >
> >
> > _______________________________________________
> > R-sig-mixed-models@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >
> >
> 
> 	[[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> 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 65, Issue 59
> **************************************************

 		 	   		  
	[[alternative HTML version deleted]]

