1
$\begingroup$

I have a question on how to extract slopes of single subjects from a moxed model using lmer (see title). So, I have 2 groups, control and treatment (0 and 1), and I am modelling their performance (p) over time. I expected the 1- group to get better faster. Now, if I plot the data and if I set up the model I find that there is actually no significant difference over time between the groups. This is the model I set up:

Performance ~ group * time + age + gender + (time | subject)

Now, in a second step, I would like to extract the slopes of the single subjects and see if there is a correlation between performance slope and another variable X. If I use coef(model)$subject I get a table that has these headers: Intercept, time, group1, gender1, age, time:group1

As I am interested in the slope, the "time" column is interesting for me. That should be the "learning slope" of the single subjects, right? Now, for the 0-group, I should just be able to look up the slope of the single subjects in the column for "time". But for the 1-group I am not quite sure how to get the real slope. If do the same as for the 0-group and then compare the means of the 2 groups, the means are exactly the same (which cannot be true. Even though the groups do not differ significantly, the slopes can't be exactly the same.)

Now my question: Do I somehow have to use the time*group column in order to gain the slope of the single subjects of group 1?

$\endgroup$

1 Answer 1

1
$\begingroup$

The model you are fitting can be written as:

$$\begin{array}{lcl} \texttt{Performance}_{ij} & = &\beta_0 + \beta_1 \texttt{Group}_i + \beta_2 \texttt{Time}_{ij} + \beta_3 \texttt{Age}_i + \beta_4 \texttt{Gender}_i \\ && + \; \beta_5 \{\texttt{Group}_i \times \texttt{Time}_{ij}\} + b_{i0} + b_{i1} \texttt{Time}_{ij} + \varepsilon_{ij} \end{array}$$

Hence, the slope for a subject in the 1-group will be $$\beta_2 + \beta_5 + b_{i1}$$

$\endgroup$
1
  • $\begingroup$ thank you very much! $\endgroup$
    – Lathy
    Apr 14, 2020 at 7:59

Your Answer

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

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