title: glht() and lsmeans() can't find contrast in lmer() model
body: <p>I have the following situation:</p>
  
  <p><a href="https://i.stack.imgur.com/s7buh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s7buh.png" alt="enter image description here"></a></p>
  
  <p>my fixed-effect model find a main effect of Relation_PenultimateLast in the group of participant called 'composers'. I want therefore to find what level of Relation_PenultimateLast differ statistically from the others.</p>
  
  <pre><code>f.e.model.composers = lmer(Score ~ Relation_PenultimateLast + (1|TrajectoryType) + (1|StimulusType) + (1|Relation_FirstLast) + (1|LastPosition), data=datasheet.complete.composers)
  </code></pre>
  
  <p>Summary(f.e.model.composers)</p>
  
  <pre><code>Random effects:
   Groups             Name        Variance Std.Dev.
   TrajectoryType     (Intercept) 0.005457 0.07387 
   LastPosition       (Intercept) 0.036705 0.19159 
   Relation_FirstLast (Intercept) 0.004298 0.06556 
   StimulusType       (Intercept) 0.019197 0.13855 
   Residual                       1.318116 1.14809 
  Number of obs: 2200, groups:  
  TrajectoryType, 25; LastPosition, 8; Relation_FirstLast, 4; StimulusType, 4
  
  Fixed effects:
                           Estimate Std. Error       df t value Pr(&gt;|t|)    
  (Intercept)               2.90933    0.12476 14.84800  23.320 4.15e-13 ***
  Relation_PenultimateLast  0.09987    0.02493 22.43100   4.006 0.000577 ***
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  </code></pre>
  
  <p>I have to make a Tukey comparison of my lmer() model.
  Now, I find two methods for the comparison among Relation_PenultimateLast levels (I have found them in here: <a href="https://stats.stackexchange.com/questions/237512/how-to-perform-post-hoc-test-on-lmer-model">https://stats.stackexchange.com/questions/237512/how-to-perform-post-hoc-test-on-lmer-model</a>):</p>
  
  <pre><code>summary(glht(f.e.model.composers, linfct = mcp(Relation_PenultimateLast = "Tukey")), test = adjusted("holm"))
  </code></pre>
  
  <p>and</p>
  
  <pre><code>lsmeans(f.e.model.composers, list(pairwise ~ Relation_PenultimateLast), adjust = "holm")
  </code></pre>
  
  <p>These do not work.
  The former reports:</p>
  
  <pre><code>Variable(s) ‘Relation_PenultimateLast’ of class ‘integer’ is/are not contained as a factor in ‘model’
  </code></pre>
  
  <p>The latter:</p>
  
  <pre><code>Relation_PenultimateLast   lsmean        SE  df lower.CL upper.CL
                        2.6 3.168989 0.1063552 8.5 2.926218  3.41176
  
  Degrees-of-freedom method: satterthwaite 
  Confidence level used: 0.95 
  
      $` of contrast`
       contrast  estimate SE df z.ratio p.value
       (nothing)   nonEst NA NA      NA      NA
  </code></pre>
  
  <p>Can somebody help me understand why I have this result?</p>