[R] Mixed model question

Spencer Graves spencer.graves at pdf.com
Fri Jun 17 17:43:41 CEST 2005


	  Have you also tried "lmer" in library(lme4)?  This is newer and 
better in many ways.  Unfortunately, I see only one example in the Help 
file, but you might be able to figure out how to use lmer from the help 
file and from the 125 hits on RSiteSearch("lmer").

	  The definitive work on this subject, from my perspective, is Pinheiro 
and Bates (2000) Mixed-Effects Models in S and S-PLUS (Springer).  This 
book is primarily how to use lme.  I learned a lot from it (and from 
Doug Bates' other book with Don Watts on nonlinear regression).  I 
couldn't find Pinheiro and Bates in the catalog for the library at 
Universidad de Sevilla (though Bates and Watts was listed).

	  Feel free to submit other questions after you've considered this, but 
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html first.  In particular, you 
might have gotten a more helpful reply to this question if you had 
included one of your attempts with "lme", asking what you did wrong or 
what you don't understand about the results.

	  Buena suerte,
	  spencer graves

Alfonso M Sanchez-Lafuente wrote:
> Hi,
> 
> I am new to this list as a poster, but a reader for some time.
> 
> I've using R for several weeks now, and I have a lot of questions about 
> certain procedures. Here I go:
> 
> I want to test if there are differences in the time spent by pollinators 
> visiting flowers of a given plant species, according to a number of 
> experimental manipulations made on those flowers. All experimental 
> manipulations (factor with 5 levels) are replicated within plants (i.e. 
> plant is my sampling unit). Further, I have two populations (two level 
> factor), and a number of pollinator groups (again, two levels, the same 
> in both populations). The response variables in the numbe of seconds 
> invested in each probe. Further, I have plant floral display as a 
> covariate, as it may influence visitation rates.
> 
> I think I have to analyse this desing considering population, pollinator 
> group and their interaction as fixed effects, and treatment nested 
> within plant, and its interaction with population and pollinator group, 
> as random factors.
> 
> In SAS terminology, the model looks like this:
> 
> proc mixed data=flwfunc.visitflower covtest method=reml;
>      class site pollclass treatm plantid;
>      model time = site|pollclass flwinflor / chisq;
>      random treatm site*treatm pollclass*treatm / subject=plantid;
>      lsmeans site pollclass site*pollclass;
> run;
> 
> I've been successfully trying lm, but I think is not suitable for random 
> effects. Thus, I've tried lme, but no success when defining the random 
> part or trying to interpret the results...
> 
> Any help will be welcome!
>




More information about the R-help mailing list