[R-sig-ME] non-linear slope in random regression model
Wilson, Alastair
A.Wilson at exeter.ac.uk
Thu Sep 10 11:51:37 CEST 2015
Hi David,
Replying off list as last message has been held for moderation (I suspect uni has changed e-mail aliases or something) and this is not really an e-mail about R anyway!0. Fitting month as a factor makes a lot of sense to me for reasons Thierry gave. To reiterate though your random effect model is something you need to decide. Simplistically, imagine you fixed effects has “taken out” all monthly variation in the mean. The question now is, do you want to model individual reaction norms as constant, a straight line, or something curvy (in which case polynomials are not a bad place to start).
Dingemanse et al have suggested using higher order polynomials to look at behavioural reaction norms – something that has long been done in quant gen for longitudinal data (e.g. growth, milk yields with age etc). In evo ecol there is a long tradition of stickling with straight line reaction norms, but I think this is largely for semantic convenience, not necessarily because they fit people’s data brilliantly. If you centre the X axis then you can interpret the elevation of an individuals reaction norm as its phenotype in an average environment, while the slope can be used as its “plasticity”. If you add a quadratic term people don’t know what to call it! Of course what it really means is that the “plasticity” slope of the reaction norm, itself changes according to where you are on the X axis.
Not sure if that helps. Whatever you decide you should make sure you include covariance between slopes and elevations in your model (and with high order terms if you include them), to do otherwise forces very strong (and unrealistic) assumptions on the reaction norms that can distort things a lot. You should also consider whether it is appropriate to assume a homogeneous residual variance across all your months as violations of this can generate spurious support for IxE (i.e. among-individual variance in reaction norm slopes).
Best
A
From: David Villegas Ríos [mailto:chirleu at gmail.com]
Sent: 10 September 2015 10:33
To: Thierry Onkelinx; Wilson, Alastair
Cc: r-sig-mixed-models
Subject: Re: [R-sig-ME] non-linear slope in random regression model
Thanks Thierry and Alastair.
I do have a lot of IDs (~290) but not so many month per ID (a mean of 10).
So from your comments I conclude that if I run model 2, or as suggested by Thierry this equivalent model, in which month is a factor in the fixed part...
trait~as.factor(month),random=~month|ID
...and I get significant between individual differences in the slope of the random effect, the conclusion is that individuals differ in their non-linear (as described by factor(month) or poly(month,3) in the fixed part) relationship between trait and month. Right?
If this is correct then I would not upgrade to a higher order random slope to keep things simple!
Best,
David
2015-09-10 11:08 GMT+02:00 Thierry Onkelinx <thierry.onkelinx at inbo.be<mailto:thierry.onkelinx at inbo.be>>:
Dear David,
Polynomials are technically still a linear model since they result is in linear combination of variable.
The only straightforward answer to you question is: it depends on the data. If you have plenty data, then I'd go for model 1. If the data doesn't require a second and 3th order polynomial, then their random effect variance will be very small. And the model will be reduced to model 2.
Note than plenty data means a lot of different id AND a lot of months per id. If you have only one year of data then random=~poly(month, 1)|ID is about as complex as you can go.
A 3th order polynomial seems a bit odd to me to model seasonality. I'd rather expect an even order. You might want to consider fitting month as a factor in the fixed effects. Then you model the seasonality without assumptions on the pattern.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
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 data. ~ John Tukey
2015-09-10 10:47 GMT+02:00 David Villegas Ríos <chirleu at gmail.com<mailto:chirleu at gmail.com>>:
Hello,
I'm fitting some random regression models to investigate variation over
time of a response trait.
The time variable is "month", and by fitting a random regression model I
want to investigate variation in plasticity across individuals, i.e.,
differences in the "slope" between trait and time across individuals.
The relationship between the response trait and month is non-linear.
Basically, it describes a seasonal cycle.
I have considered two model candidates:
*Model 1*: fitting a polynomial of month in the fixed effects part to
describe the non-linearity and get the population mean effect of month, and
then a random slope using again the polynomial for month, to ge the
individual differences.
trait~poly(month,3),random=~poly(month,3)|ID
*Model 2*: fitting a polynomial of month in the fixed effect part to
describe the non-linearity, and then the individual-specific deviation from
the fixed-effect means is modelled as a funtion of month (linear), assuming
that the non-linearity is already accounted for with the fixed effect.
trait~poly(month,3),random=~month|ID
*My question is*:
Is it neccesary to include the non-linearity in the random part if it was
already included in the fixed-effects part?
The idea of fitting model 2 comes from the following reference (page 488):
Dingemanse, N. J., Barber, I., Wright, J., & Brommer, J. E. (2012).
Quantitative genetics of behavioural reaction norms: genetic correlations
between personality and behavioural plasticity vary across stickleback
populations.*Journal of evolutionary biology*, *25*(3), 485-496.
Thank you.
David
[[alternative HTML version deleted]]
_______________________________________________
R-sig-mixed-models at r-project.org<mailto:R-sig-mixed-models at r-project.org> mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list