I have dataset with both linear and quadratic relationships for my response variable among individuals. My dataset includes individuals sampled from two populations (9 individuals from population A and 8 from population B). For each individual I have measured stable nitrogen-isotopes from 9 sequentially grown wing feathers (time series).
I have two hypotheses:
- their are differences in the mean isotope values across the wing for individuals between the two regions
- their differences in the variation of the isotope values across the wing for individuals between the two regions
I must admit I am a novice to mixed models. Originally I had falsely assumed that my data for each individual were 'linear'. Thanks to Ben Bolker I now know how to test these assumptions and have discover one individual from the 17 has a quadratic relationship. I had built the following GLMMs using the 'nlme' package in 'R' before discovering my error:
model1 <- lme(Delta15N ~ factor(Population), method = "REML", data = Data, random = ~ 1 | Individual, correlation = corAR1(form = ~ 1 | Individual))
model2 <- lme(Delta15N ~ factor(Population)*Feather, method = "REML", data = Data, random = ~ 1 | Individual, correlation = corAR1(form = ~ 1 | Individual))
Can you please suggest a reference or example code that I might use to correctly model my data?