Joanie,

I see that you are looking at the simple effect of herring in the presence of a herring*age interaction. Are the age and herring predictors centered about their means?

Jake


Date: Mon, 30 Sep 2013 09:23:28 -0400
From: Joanie.VanDeWalle@dfo-mpo.gc.ca
To: r-sig-mixed-models@r-project.org
Subject: [R-sig-ME] GLMM doesn't do what it is supposed to (wrong results).

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
 
 
 

_______________________________________________
R-sig-mixed-models@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models 		 	   		  
	[[alternative HTML version deleted]]

