1
$\begingroup$

I'm doing a linear mixed effects regression model. There are 80 subjects that are being observed over three days (some subjects are just observed on day 1, others on day 1 and 2, and others on day 1, 2 and 3). The total amount of observations is 202

I am rather new to mixed effect modelling but I understand that since observations among the same subject are somehow correlated, it is appropriate to add the Subject as a random intercept in the model. This is called the grouping variable if I am correct?

However, I also see that there is quite a difference on the response variable when making a boxplot for each of the days (subjects that are only examined for 1 day have a lower response variable than those that are examined on 2 or 3 days). It seems to me that this variable which indicates the day should also be included as a random intercept effect. Is it useful to do this, or rather pointless? Moreover, if you'd add the two as random intercepts, which one is seen as "the grouping variable"?

$\endgroup$

1 Answer 1

2
$\begingroup$

In principle you can add day as a random effect, but I would suggest adding it as a fixed effect for several reasons:

  • only 3 levels (i.e. only three separate days on which individuals are measured) might not be enough to reliably estimate an among-day variance;
  • similarly, with only 3 levels you don't gain much in the parsimony of the model (intercept + variance = 2 parameters for the random model vs intercept + (day2-day1) + (day3-day1) = 3 parameters for the fixed model)
  • the 3 days might not be exchangeable, e.g. there might be a trend over time
  • with crossed random effects of Subject and day you'd probably have to switch from nlme::lme to lme4::lmer. (With crossed random effects there are multiple grouping variables, which makes it hard for lme.)

So I'd suggest something like response~...+day, random = ~1|Subject ; if each individual is measured at most once per day, then it's not worth nesting day within Subject - that term will be confounded with the residual variance.

I'm not quite sure I understand your last paragraph. Do you have separate observations for each Subject-day combination, or just the total for each individual and the days on which it was observed? In other words, do your data look like this:

Subject day response
a       1   17
b       1   19
b       2   10
c       2   12
c       3   11

or this?

Subject days total
a       1    17
b       1,2  29
c       2,3  23

... or something else ?

$\endgroup$
2
  • $\begingroup$ Thank you for the response! The data is structured like the first example. Each observation (out of the 202) can be uniquely identified by the subject-day combination. $\endgroup$
    – WBM
    Commented May 29, 2018 at 15:49
  • 1
    $\begingroup$ ... in which case I stand by my answer. $\endgroup$
    – Ben Bolker
    Commented May 29, 2018 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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