Hi, I am running a mixed-effect model with a nested-random effect. I am interested in gut parasites in moose. I has three different type of treatment that I applied to moose which are from different "families". My response variable is gut parasites and the factors are moose families which is nested within treatment. My data is balanced. To answer this question, I used the lme function like this : model=lme(parasite~drug,random=~1|drug/family) But doing a summary on this model gives me warning message : In pt(-abs(tTable[, "t-value"]), tTable[, "DF"]) : NaNs produced I don't understand why ?! I noticed that the p-values are not computed and have NAs values for drug2 and drug3 (from the summary of this model) Moreover, in the summary, I noticed that in the random effects line I have standard deviation for Formula: ~1 | drug and for Formula: ~1 | family %in% drug. Does R consider drug as a random factor as well ? And last question, how can I know if my random factor has a significant effect on the gut parasites ? Thank for your help, -- View this message in context: http://r.789695.n4.nabble.com/nested-random-factor-using-lme-produces-errors-tp4658837.html Sent from the R help mailing list archive at Nabble.com.
melswed <amelie.truchy <at> slu.se> writes:> > Hi, > > I am running a mixed-effect model with a nested-random effect. I am > interested in gut parasites in moose. I has three different type of > treatment that I applied to moose which are from different "families". My > response variable is gut parasites and the factors are moose families which > is nested within treatment. My data is balanced. > > To answer this question, I used the lme function like this : > model=lme(parasite~drug,random=~1|drug/family) > > But doing a summary on this model gives me warning message : > In pt(-abs(tTable[, "t-value"]), tTable[, "DF"]) : NaNs produced > > I don't understand why ?! I noticed that the p-values are not computed and > have NAs values for drug2 and drug3 (from the summary of this model) > > Moreover, in the summary, I noticed that in the random effects line I have > standard deviation for Formula: ~1 | drug and for Formula: ~1 | family %in% > drug. Does R consider drug as a random factor as well ? > > And last question, how can I know if my random factor has a significant > effect on the gut parasites ? >This belongs on r-sig-mixed-models at r-project.org. Hint: it very rarely makes sense to include a categorical predictor such as drug as both a random and a fixed effect ... this model is overspecified. For computational and philosophical reasons, it seems unwise and odd (respectively) to treat drug as a random effect. I might have more to say but will say it (perhaps) if you repost on r-sig-mixed-models .
I understand. I want to specify that drug is only a fixed factor and family should be the only random factor. So maybe, my R code is wrong.... If I specify random=~1|drug/family it is only because I wanted to specify that family is nested within drug. -- View this message in context: http://r.789695.n4.nabble.com/nested-random-factor-using-lme-produces-errors-tp4658837p4658878.html Sent from the R help mailing list archive at Nabble.com.