# [R-sig-ME] non-linear slope in random regression model

Wilson, Alastair A.Wilson at exeter.ac.uk
Thu Sep 10 11:05:03 CEST 2015

```Hi David,

It is not necessary - it may or may not be useful/interesting depending on your questions and structure of your data. In this sort of random regression model you are using your fixed effect structure to account for the relationship between your X variable (here time) and the response mean. If a 3rd order polynomial does a good job then great! In the random effect structure you are modelling the individual level effects (i.e. deviations from the fixed effect mean attributable to individual identity). These could be constant (0 order), a linear (1st order) function of X or something else (e.g. a quadratic, or indeed some other type of function of X).

There is no necessary connection between the functional form you use in the fixed effects and that in the random effects. For plasticity studies a linear regression is common in the random effect but higher orders could be used (and may prove better fits).

For more on these sorts of models (they have some issues as well as some strength!) I would suggest looking in the animal breeding/quant gen literature, for instance work by Karin Meyer and Mark Kirkpatrick here

http://rstb.royalsocietypublishing.org/content/360/1459/1443

Alastair Wilson

-----Original Message-----
From: R-sig-mixed-models [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of David Villegas Ríos
Sent: 10 September 2015 09:47
To: r-sig-mixed-models
Subject: [R-sig-ME] non-linear slope in random regression model

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 mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

```