Falco tinnunculus
2008-Jan-30 14:52 UTC
[R] How to run interaction between to categoric variables in lme()?
En innebygd og tegnsett-uspesifisert tekst ble skilt ut... Navn: ikke tilgjengelig Nettadresse: https://stat.ethz.ch/pipermail/r-help/attachments/20080130/78d2a14c/attachment.pl
Dieter Menne
2008-Jan-30 15:13 UTC
[R] How to run interaction between to categoric variables in lme()?
Falco tinnunculus <kestrel78 <at> gmail.com> writes:> How do I run interaction between to categoric variables in lme()? > > I tried this: > > > lmefit1<- lme(Handling ~Mass+factor(Prey)+factor (Decap)+ > factor(Prey)*factor(Decap), random = ~ 1 |Place, data=nestling1) > > Error in MEEM(object, conLin, control$niterEM) : > Singularity in backsolve at level 0, block 1First, I would suggest that you make Prey, Decap factors in your data frame. Makes for a much easier reading, and fewer errors if you test nestling1$Prey = as.factor(nestling1$Prey) nestling1$Decap = as.factor(nestling1$Decap) lmefit1<- lme(Handling ~Mass+Decap*Prey, random = ~ 1 |Place, data=nestling1) You should not write Prey+Decap+Prey*Decap. I you want to do it explicitly, used the colon instead Prey+Decap+Prey:Decap or, let lme do the dirty (i.e. in most cases correct) work: Prey*Decap which will expand to what you need. If you still get the error message, it's your data: you want to much from them. Check if you have enough degrees of freedom left, or if the data set is degenerate by not including a sufficient number of pairing. Dieter
Maybe Matching Threads
- Is it possible with two random effects in lme()?
- How to make reference to R in the method section in a scientific article?
- How to calculate normality of the residuals from a test in R?
- Checking for linearity by ploting residuals against predicted values (lme)?
- How to set working directory to a fixed map?