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

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Tue Oct 21 17:23:53 CEST 2008

Dear Michael,

I think you want 

model <- lme(PDD ~ Status + MD,
             data = Penguin,
             random = ~ Status | Penguin/Ntrip/Ndive,
             correlation = corAR1()) 

And make shure that Ndive is unique for each dive. You'll get into
trouble if each Ntrip has Ndive = 1.

If you don't have multiple observations per dive than you don't need to
add Ndive.
model <- lme(PDD ~ Status + MD,
             data = Penguin,
             random= ~ Status | Penguin/Ntrip,
             correlation = corAR1()) 



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be 

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-sig-mixed-models-bounces at r-project.org
[mailto:r-sig-mixed-models-bounces at r-project.org] Namens Michael
Verzonden: dinsdag 21 oktober 2008 16:21
Aan: r-sig-mixed-models at r-project.org
Onderwerp: [R-sig-ME] Difficulty with mixed models in R

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:

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)
model = lme(PDD ~ Ntrip + Status + MD + Ntrip/Ndive,
             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


R-sig-mixed-models at r-project.org mailing list

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.

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