1
$\begingroup$

I have finished a trial where we measured continously measurements like blood pressure

   id time measurement behA
21  2   y1    24.86951    0
22  3   y1    22.06246    0
23  5   y1    23.63033    0
24  6   y1    23.14541    0
25  7   y1    22.79180    0
26  8   y1    24.33016    0
27  9   y1    21.00754    0
28 10   y1    25.25475    0
29 11   y1    17.90951    0
30 12   y1    16.81754    0
31 13   y1    20.11344    0
41  2   y2    69.00000    0
42  3   y2    69.80213    0
43  5   y2    61.71574    0
44  6   y2    50.56885    0
45  7   y2    53.44689    0
46  8   y2    62.66082    0
47  9   y2    44.55164    0
48 10   y2    55.81049    0
49 11   y2    40.25721    0
50 12   y2    34.86508    0
51 13   y2    31.43689    0
61  2   y3    49.72607    0
62  3   y3    81.03049    1
63  5   y3    65.83426    0
64  6   y3    43.96574    0
65  7   y3    57.74918    1
66  8   y3    60.69951    0
67  9   y3    60.07885    1
68 10   y3    73.77607    1
69 11   y3    60.37918    0
70 12   y3    36.42082    1
71 13   y3    42.45131    1

The pigs were measured during a timeperiod (y1-y3), and the treatment was initialized in some of the pigs at time y3. This is indicated as behA

As this being a biological trial the random effect should be each individual and then time and behA should be fixed effects. Like this:

lme(fixed=measurement~time+behA, random= ~1|id, na.action=na.exclude, method="REML", data = long_all)

Would you need an interaction between time and behA? Or does this seem sufficient?

$\endgroup$
8
  • $\begingroup$ Use of linear mixed effects models is not prescriptive in the sense you say "random effect should be each individual". The purpose of random effects could be due to the fact you want to view pigs as a random sample, or it could be you wish to use the covariance structure the random effects induces in the marginal model. Typically the latter is the primary aim and can be achieved without random effects. I personally like to treat both subjects (pigs for you) and time as random, treating time as continous. I then have time and treatment as fixed effects, typically time as a factor variable. $\endgroup$
    – dandar
    Commented Jun 8, 2019 at 15:58
  • $\begingroup$ What might be surprising for some people is variables can enter both the subject model (the random effects model) and the global or fixed model. I like the combination of time as continous and linear in the subject model and a global factor effect to pick up any arbitrary shape not expected at trial design time. $\endgroup$
    – dandar
    Commented Jun 8, 2019 at 16:00
  • $\begingroup$ So you conclusion is that you usually set the fixed as time+BehA and the random as time and id? $\endgroup$
    – LilleOel
    Commented Jun 8, 2019 at 18:47
  • $\begingroup$ Typically but not always. The nice thing about fixed effects = treatment + time (as factor) and random effects = subject + time (as linear) is that subject level variation in slopes over time is accounted for but the fixed factor levels of time give insurance against non-linear time trends. Furthermore keeping the linear time effect as random, not only is this intuitively appealing to me, but the random effects covariance matrix is only 2x2 in size and induces a marginal response covariance matrix that is "rich" in that it changes with time, but not too rich in being "un-structured". $\endgroup$
    – dandar
    Commented Jun 8, 2019 at 19:23
  • $\begingroup$ The time is set times, where delta time is the same for Each measurement. Does this Change the idea? $\endgroup$
    – LilleOel
    Commented Jun 8, 2019 at 19:29

1 Answer 1

2
$\begingroup$

A couple of points:

  • The reason to use random effects is to account for the correlations in the measurements within in group. In your case, the repeated measurements within pigs. The use of random intercepts translates to constant correlations over time. That is, the correlation of blood pressure measurements of a pig between y1 and y2 is equal to the correlation between y1 and y3, and between y2 and y3.
  • The interpretation of the fixed effects coefficients here is similar as to other regression models. For example, in your model the coefficient for behA will denote the difference in the average blood pressure between behA = 1 and behA=0 at the same time.
  • Hence, the additive model postulates that the difference between behA = 1 and behA=0 is the same for all time points. If you would like to assess whether this difference changes over time, you could indeed do that by including the interaction term.
$\endgroup$

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.