3
$\begingroup$

I am modelling timeseries of organism traits (7 different traits in total) using GLM(M)s in R. The data was collected at very irregular intervals and from 6 different locations. For every location 5-10 animals were sampled and some locations have been sampled multiple times whereas others just once or twice. I am interested to see if Trait significantly changes with Year.

I decided to use Location as a random variable so that the model is of the form:

glmer(Trait~ Year + Var1 + (1|Location), 
               family=gaussian(link = "log"),
               data = data)

The model diagnostics lock good and don't give any reasons for concerns to me.

I did just for the sake of it model the same traits using multiple linear regression, this time having Location as a fixed term. This required the log transformation of Traits

lm(log(Trait) ~ Year + Var1 + Location, data = data)

Also for these models the diagnostics look good. Both models suggest the same trend in the data.

Now the problem that I am facing is decide what model I should use? In the literature it is commonly mentioned that the simplest possible statistical tool should be favored over more complicated ones which suggests to me I should favor the linear regression but one is also discouraged to transform data to fit the model.

$\endgroup$
  • $\begingroup$ How many locations do you have? $\endgroup$ – Robert Long Oct 14 at 16:49
  • $\begingroup$ 6 different locations $\endgroup$ – Globoquadrina Oct 14 at 16:52
  • 1
    $\begingroup$ Note that there is a difference between a model with a transformed response & with a link function for the mean (see: Why is GLM different than an LM with transformed variable). These can't both be right. $\endgroup$ – gung - Reinstate Monica Oct 14 at 18:32
  • $\begingroup$ @gung-ReinstateMonica is quite right. I have updated my answer. You need to be consistent in what you are modelling. $\endgroup$ – Robert Long Oct 14 at 18:52
6
$\begingroup$

6 is considered to be at or very near the lower limit for fitting random intercepts. In your case I would suggest the linear model with fixed effects for location. If this is for publication / presentation then I would also mention that you have fitted a mixed model with random intercepts for location, and found that the inferences were very similar.

Also, note that, to be consisent, you should fit the models:

glm(Trait ~ Year + Var1 + Location, family = gaussian(link = "log"), data = data)

and

glmer(Trait ~ Year + Var1 + (1|Location),family = gaussian(link = "log"), data = data)

OR,

lm(log(Trait) ~ Year + Var1 + Location, data = data)

and

lmer(log(Trait) ~ Year + Var1 + (1|Location), data = data)
| cite | improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Thank you very much! This answer is great. $\endgroup$ – Globoquadrina Oct 15 at 8:02
  • $\begingroup$ You're welcome. Happy to help ! $\endgroup$ – Robert Long Oct 15 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.