title: Interpreting random effects in lme4 package
body: <p>I was dealing with the lme4 package in R and was a bit confused with how to interpret the random effects in a following example:</p>
  
  <pre><code>library(dplyr)
  library(ggplot2)
  library(tidyr)
  library(lmerTest)
  setwd("F:/5_1 Analize/Article_2 - LMM/")
  
  dat &lt;- data.frame(
    ID = rep(1:20, each = 60),
    Task = rep(1:60, each = 20),
    Group = rep(c("A","B","C"), each = 20),
    Accuracy = sample(c(0,1), size = 1200, replace = T),
    RT = sample(200:3000, size = 1200, replace = T)
  )
  
  mod &lt;- glmer(Accuracy~RT*Group + (1+RT|Task) + (1+RT|ID), data = dat, family = "binomial")
  </code></pre>
  
  <p>Basically every participant goes through 3 conditions (Group). In each conditions there are 20 trials (Task). We measure Accuracy and reaction time. In the modeling we want to predict Accuracy from RT, controlling for random effects in between subjects and tasks, both for intercepts and slopes. We also control for the fixed effect of the group.</p>
  
  <p>The formula of the example can be described as:
  <code>Accuracy ~ (beta0 + b0ID + b0Task + betaGroup0) + (beta1 + b1ID + b1Task + betaGroup1)*RT</code> (b-random effects, beta - fixed effects)</p>
  
  <p>My question is following:</p>
  
  <p>1) When i run <code>coef(mod)$ID</code> and look at the Intercept column - what do I see? Do I see random intercepts for each person across all three conditions, or do I see random intercepts for each person for Group A? My idea is the second one. If that is true, how can I get an average random person intercept for all three groups?</p>
  
  <p>2) When I run <code>coef(mod)$Task</code> and also look at Intercept column - do I see intercepts for each item independantly of Group variable or not?</p>
  
  <p>Thanks!</p>