[R-sig-ME] GLMM doesn't do what it is supposed to (wrong results).
Van De Walle, Joanie
Joanie.VanDeWalle at dfo-mpo.gc.ca
Mon Sep 30 15:23:28 CEST 2013
Hi,
My problem is that the outcome of a GLMM I built doesn't make sense.
Since I always visually analyse my dataset prior applying any
statistical analysis, I know that the outcome is wrong.
Basically, I want to test the effect of the food availability on young
seals mass gain. I captured pups each season since 10 years. For each
capture, I noted pup weight and age. Individual seals (identified with
their flipper tag or "fliptag") were captured from 1 to 8 times
throughout their lactation period, so "individual" was put as a random
factor. I also put the intercept and the slope as random since I expect
them to vary from one individual to the other. I also have data on the
average availability of prey for each season (1 numeric value once a
year). Attached is my dataframe.
database <- read.table("DataGLMMquestion.txt", header=T)
data1 <- subset(database, database$numberofcaptures>=2) # Only pups
captured twice or more
datalac <- subset(data1, data1$age<30) # I'm only interested in captured
made before age 30 days
data <- subset(datalac, datalac$growthrate>0) # Keep only the
individuals with positive growth rate
My model:
library(nlme)
mod1 <- lme(weight ~ age + herring + age*herring ,
random=~1+age|fliptag, data=data, method="REML")
anova(mod1, type="marginal")
So, the output of my model says that herring abundance has a huge effect
on individual mass.
However, if I look at the average of the average individual mass each
year and I plot it against the abundance of herring, there is no pattern
at all .
What am I doing wrong?
Thanks in advance,
Joanie Van de Walle
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: DataGLMMquestion.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20130930/2aea8878/attachment-0001.txt>
More information about the R-sig-mixed-models
mailing list