title: How to plot a multilevel model treatment effect in R
body: <p>I want to plot the Group-Time-Interaction of my multilevel model. I only managed to plot it without the multilevel structure. How can I include the nesting? Each patient was measured 3 times (before the treatment, mid, and after) on the same instrument. The patients were randomized to 2 groups (waitlist and treatment). 
  This is my model:</p>
  
  <pre><code>m8 &lt;- lmer(score ~ 1 + +time*Group +(1| subject), data = df2) 
  </code></pre>
  
  <p>This is what I did: </p>
  
  <pre><code>score &lt;- data %&gt;%
    filter(!is.na(score)) %&gt;%  
    group_by(ti, Gruppe, ar, ID) %&gt;%
    summarise(Max_Height = max(score)) %&gt;%  # Calculating max score
    ungroup() %&gt;%  # Need to ungroup so that the pipe doesn't get confused
    group_by(ti, Gruppe, ar) %&gt;%
    summarise(score = mean(Max_Height)) 
  (basic_mm_scatter &lt;- ggplot(score, aes(ti, score, colour = Gruppe)) +
      geom_point() +
      theme_bw() +stat_smooth(method = "lm",))
  </code></pre>
  
  <p>I would also love to include error bars. No idea how to though. Help is ver appreciated!!! Thanks so much!</p>