Hello: I am using R mainly on windows XP, version 2.5. I?m a biologist, with a medium level statistics background. I have a problem stating a two-way factorial design where both factors are random. I?m using the lmer() function implemented in the Matrix package version 0.99. My design is as follows: Two species were randomly selected from a total of 4 species. This species are present in five different populations, again selected at random. Five trees per species were selected randomly in each population and fruit number was estimated. The main question is to estimate variance components for species, population and their interaction. Since both species are present in each population, I figured they are not nested, but are crossed. There is no fixed factor. I conducted a normal aov() to estimate variance components manually via EMS approximation: fm1 <- aov(fruto~pop*spp, data=p1) to test the significance of the variance components I did: fm2 <- aov(fruto~pop+spp+Error(pop:spp), data=p1) Manually, the variance component for the interaction is negative, therefore I turned to lmer() to try to get a better estimate as well as confidence intervals. After invoking the Matrix library, I typed: fm3 <- lmer(fruto~(1|pop) + (1|spp) + (1|pop:spp), data=p1) During calculations I get an error which indicates that the variance components for pop and pop:spp are almost zero. The summary output presents variance components that do not resemble the manually estimated values (eg. sigma_pop = 3650 vs sigma_pop(reml) = 7840). If I conduct the analysis in SAS, with GLM and the random option, I get correct estimates of variance components. After reading a couple of help files, it looks like I need a fixed component, which I don?t know how to code (dummy coding?). My specific questions are: 1. Is my lmer formula correct? If not, how should it be stated? 2. Should I use another formula or command to estimate the interaction component? 3. Do I have to create a fixed factor in order to correctly use lmer()? I know I should have consulted Pinhero?s book, but I?m currently in Costa Rica, and the book is taking a long time to get here. Thanks in advance for all your help. I?m new in the mailing list, and I hope I?ve made myself clear enough. thanks Eric Fuchs Universidad de Costa Rica -- Eric J. Fuchs Biologo http://e.j.fuchs.googlepages.com/ __________________________________________ lex parsimoniae: entia non sunt multiplicanda praeter necessitatem
On Fri, Oct 26, 2007 at 10:02:23AM -0600, Eric Fuchs wrote:> Hello: > > I am using R mainly on windows XP, version 2.5. I?m a biologist, > with a medium level statistics background. I have a problem stating a > two-way factorial design where both factors are random. I?m using the > lmer() function implemented in the Matrix package version 0.99. > > My design is as follows: Two species were randomly selected from a > total of 4 species. This species are present in five different > populations, again selected at random. Five trees per species were > selected randomly in each population and fruit number was estimated. > The main question is to estimate variance components for species, > population and their interaction. Since both species are present in > each population, I figured they are not nested, but are crossed. > There is no fixed factor....> fm3 <- lmer(fruto~(1|pop) + (1|spp) + (1|pop:spp), data=p1)I am not an expert in this area, but I have been studying mixed models off and on for a few months. I think you are misunderstanding the terminology of fixed and random factors. The most likely thing that I would be interested in in your case would be, what is the effect of species overall, and then what are the effects that population has on all species, and what are the effects that population has for each given species... The basic model would be that species is a controllable effect (fixed effect) but that populations are essentially draws from random variables (ie. soil conditions, weather conditions, etc are all random) fruto ~ spp + (1|pop) This says that there is something consistent about a given species across populations, plus there is a random error for each population. To move further along, you could add in a factor which includes the interaction of species and population. there are 10 trees that you looked at in each population so the (1|pop) term is estimated from those 10 trees. You can also split the random component by spp and pop fruto ~ spp + (1|pop) + (1|pop:spp) this says that not only is there an effect that is specific to the average of a population, but there is an effect that is specific to the difference between species in that population. It is sometimes useful to think of causal issues as a way to describe the models you want to fit, so in this case we think of a particular soil and weather and soforth causing a deviation from the trend, and we think of that particular soil and weather also causing a deviation from the between species trend in the last model. As I say, I'm not an expert in this field, so I would be very glad if someone would correct any mistakes I have made here. -- Daniel Lakeland dlakelan at street-artists.org http://www.street-artists.org/~dlakelan
Apparently Analagous Threads
- vector("integer", length) : vector size specified is too large
- Degrees of Freedom Not Allocated to Residuals in Reduced Model
- assign()ing within apply
- Can I index a dataframe with a reference from/to a second dataframe?
- Warning messages in Splancs package :: no non-missing arguments to min; returning Inf