[R-sig-ME] Difficulty with mixed models in R

Michael Beaulieu michael.beaulieu at c-strasbourg.fr
Tue Oct 21 16:20:55 CEST 2008


Dear R users,

I would like two compare the diving behaviour of two groups of penguins 
(7 penguin in each group). Each penguin performed several dives within 
several foraging trips. As a result, I got a huge data set of dives 
(nearly 100000).
To compare the diving behaviour (in the script PDD) of the two groups, I 
used a mixed model with:
-the penguin as a random factor,
-the number of dives nested in the foraging trip as a repeated factor,
-the group, the foraging trip and maximal depth (MD) as fixed factors.
Covariance structure was auto-regressive.

Here is the script I used:

library(nlme)
penguin = read.table(file = "C://Documents and 
Settings//Administrateur//Bureau//mk9ter.txt", header = T, sep = "\t", 
dec = ".", na.strings="NA")
penguin$Penguin =  as.factor(penguin$Penguin)
penguin$Ndive =  as.factor(penguin$Ndive)
penguin$Ntrip =  as.factor(penguin$Ntrip)
penguin = penguin[!is.na(penguin$Penguin),]
Penguin = groupedData(formula = PDD ~ Ntrip | Penguin, data = penguin)
rm(penguin)
model = lme(PDD ~ Ntrip + Status + MD + Ntrip/Ndive,
             data=Penguin,
             random= ~ Status | Penguin,
         correlation=corAR1() )

And here is the result I get:
Reached the total allocation of 1022 Mb: see help (memory.size)

Moreover I should add interactions between fixed effects.

Before I feel totally depressed, is there anybody who could help me ?

Thank you in advance

MiKL




More information about the R-sig-mixed-models mailing list