Running ‘test_a_utils.R’
  Running ‘test_anova.R’ [15s/19s]
  Running ‘test_compare_sas.R’ [9s/14s]
  Running ‘test_contest1D.R’ [9s/14s]
  Running ‘test_contestMD.R’ [10s/14s]
  Running ‘test_drop1.R’ [9s/10s]
  Running ‘test_lmer.R’ [9s/10s]
  Running ‘test_lmerTest_paper.R’ [40s/44s]
  Running ‘test_ls_means.R’
  Running ‘test_ranova_step.R’ [49s/50s]
  Running ‘test_summary.R’
  Running ‘test_zerovar.R’
  Running ‘zlmerTest_zeroDenom.R’
Running the tests in ‘tests/test_ls_means.R’ failed.
Complete output:
  > # test_lsmeans.R
  > 
  > library(lmerTest)
  Loading required package: lme4
  Loading required package: Matrix
  
  Attaching package: 'lmerTest'
  
  The following object is masked from 'package:lme4':
  
      lmer
  
  The following object is masked from 'package:stats':
  
      step
  
  > 
  > ########### Basic model structures:
  > 
  > # Factor * covariate:
  > data("cake", package="lme4")
  > model <- lmer(angle ~ recipe * temp + (1|recipe:replicate), cake)
  > (lsm <- ls_means(model))
  Least Squares Means table:
  
          Estimate Std. Error df t value   lower   upper  Pr(>|t|)    
  recipeA  33.1222     1.7368 42  19.070 29.6172 36.6273 < 2.2e-16 ***
  recipeB  31.6444     1.7368 42  18.220 28.1394 35.1495 < 2.2e-16 ***
  recipeC  31.6000     1.7368 42  18.194 28.0949 35.1051 < 2.2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
    Confidence level: 95%
    Degrees of freedom method: Satterthwaite 
  > stopifnot(
  +   nrow(lsm) == 3L,
  +   ncol(lsm) == 7L,
  +   # Balanced, so LS-means equal raw means:
  +   isTRUE(all.equal(c(with(cake, tapply(angle, recipe, mean))), lsm[, "Estimate"],
  +                    check.attributes=FALSE))
  + )
  > 
  > # Pairwise differences of LS-means:
  > plsm <- ls_means(model, pairwise = TRUE)
  > plsm2 <- difflsmeans(model)
  > C <- as.matrix(lmerTest:::get_pairs(rownames(lsm)))
  > stopifnot(
  +   isTRUE(all.equal(plsm, plsm2)),
  +   isTRUE(all.equal(plsm[, "Estimate"], c(lsm[, "Estimate"] %*% C),
  +                    check.attributes=FALSE))
  + )
  > 
  > # Contrasts vectors:
  > show_tests(lsm)
  $recipe
          (Intercept) recipeB recipeC temp recipeB:temp recipeC:temp
  recipeA           1       0       0  200            0            0
  recipeB           1       1       0  200          200            0
  recipeC           1       0       1  200            0          200
  
  > show_tests(plsm)
  $recipe
                    (Intercept) recipeB recipeC temp recipeB:temp recipeC:temp
  recipeA - recipeB           0      -1       0    0         -200            0
  recipeA - recipeC           0       0      -1    0            0         -200
  recipeB - recipeC           0       1      -1    0          200         -200
  
  > 
  > # Factor * Ordered:
  > model <- lmer(angle ~ recipe * temperature + (1|recipe:replicate), cake)
  > (lsm2 <- ls_means(model))
  Least Squares Means table:
  
                         Estimate Std. Error   df t value   lower   upper
  recipeA                 33.1222     1.7368 42.0  19.070 29.6172 36.6273
  recipeB                 31.6444     1.7368 42.0  18.220 28.1394 35.1495
  recipeC                 31.6000     1.7368 42.0  18.194 28.0949 35.1051
  temperature175          27.9778     1.1767 77.4  23.776 25.6349 30.3207
  temperature185          29.9556     1.1767 77.4  25.457 27.6127 32.2985
  temperature195          31.4222     1.1767 77.4  26.704 29.0793 33.7651
  temperature205          32.1778     1.1767 77.4  27.346 29.8349 34.5207
  temperature215          35.8444     1.1767 77.4  30.462 33.5015 38.1873
  temperature225          35.3556     1.1767 77.4  30.046 33.0127 37.6985
  recipeA:temperature175  29.1333     2.0381 77.4  14.294 25.0753 33.1913
  recipeB:temperature175  26.8667     2.0381 77.4  13.182 22.8087 30.9247
  recipeC:temperature175  27.9333     2.0381 77.4  13.706 23.8753 31.9913
  recipeA:temperature185  31.5333     2.0381 77.4  15.472 27.4753 35.5913
  recipeB:temperature185  29.4000     2.0381 77.4  14.425 25.3420 33.4580
  recipeC:temperature185  28.9333     2.0381 77.4  14.196 24.8753 32.9913
  recipeA:temperature195  30.8000     2.0381 77.4  15.112 26.7420 34.8580
  recipeB:temperature195  31.7333     2.0381 77.4  15.570 27.6753 35.7913
  recipeC:temperature195  31.7333     2.0381 77.4  15.570 27.6753 35.7913
  recipeA:temperature205  33.5333     2.0381 77.4  16.453 29.4753 37.5913
  recipeB:temperature205  32.1333     2.0381 77.4  15.766 28.0753 36.1913
  recipeC:temperature205  30.8667     2.0381 77.4  15.145 26.8087 34.9247
  recipeA:temperature215  38.6667     2.0381 77.4  18.972 34.6087 42.7247
  recipeB:temperature215  34.4667     2.0381 77.4  16.911 30.4087 38.5247
  recipeC:temperature215  34.4000     2.0381 77.4  16.878 30.3420 38.4580
  recipeA:temperature225  35.0667     2.0381 77.4  17.206 31.0087 39.1247
  recipeB:temperature225  35.2667     2.0381 77.4  17.304 31.2087 39.3247
  recipeC:temperature225  35.7333     2.0381 77.4  17.533 31.6753 39.7913
                          Pr(>|t|)    
  recipeA                < 2.2e-16 ***
  recipeB                < 2.2e-16 ***
  recipeC                < 2.2e-16 ***
  temperature175         < 2.2e-16 ***
  temperature185         < 2.2e-16 ***
  temperature195         < 2.2e-16 ***
  temperature205         < 2.2e-16 ***
  temperature215         < 2.2e-16 ***
  temperature225         < 2.2e-16 ***
  recipeA:temperature175 < 2.2e-16 ***
  recipeB:temperature175 < 2.2e-16 ***
  recipeC:temperature175 < 2.2e-16 ***
  recipeA:temperature185 < 2.2e-16 ***
  recipeB:temperature185 < 2.2e-16 ***
  recipeC:temperature185 < 2.2e-16 ***
  recipeA:temperature195 < 2.2e-16 ***
  recipeB:temperature195 < 2.2e-16 ***
  recipeC:temperature195 < 2.2e-16 ***
  recipeA:temperature205 < 2.2e-16 ***
  recipeB:temperature205 < 2.2e-16 ***
  recipeC:temperature205 < 2.2e-16 ***
  recipeA:temperature215 < 2.2e-16 ***
  recipeB:temperature215 < 2.2e-16 ***
  recipeC:temperature215 < 2.2e-16 ***
  recipeA:temperature225 < 2.2e-16 ***
  recipeB:temperature225 < 2.2e-16 ***
  recipeC:temperature225 < 2.2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
    Confidence level: 95%
    Degrees of freedom method: Satterthwaite 
  > stopifnot(
  +   nrow(lsm2) == 3 + 6 + 3*6,
  +   ncol(lsm) == 7L,
  +   # Balanced, so LS-means equal raw means:
  +   isTRUE(all.equal(lsm[1:3, ], lsm2[1:3, ],
  +                    check.attributes=FALSE))
  + )
  > 
  > 
  > # Factor * Factor:
  > cake2 <- cake
  > cake2$temperature <- factor(cake2$temperature, ordered = FALSE)
  > model <- lmer(angle ~ recipe * temperature + (1|recipe:replicate), cake2)
  > (lsm3 <- ls_means(model))
  Least Squares Means table:
  
                         Estimate Std. Error   df t value   lower   upper
  recipeA                 33.1222     1.7368 42.0  19.070 29.6172 36.6273
  recipeB                 31.6444     1.7368 42.0  18.220 28.1394 35.1495
  recipeC                 31.6000     1.7368 42.0  18.194 28.0949 35.1051
  temperature175          27.9778     1.1767 77.4  23.776 25.6349 30.3207
  temperature185          29.9556     1.1767 77.4  25.457 27.6127 32.2985
  temperature195          31.4222     1.1767 77.4  26.704 29.0793 33.7651
  temperature205          32.1778     1.1767 77.4  27.346 29.8349 34.5207
  temperature215          35.8444     1.1767 77.4  30.462 33.5015 38.1873
  temperature225          35.3556     1.1767 77.4  30.046 33.0127 37.6985
  recipeA:temperature175  29.1333     2.0381 77.4  14.294 25.0753 33.1913
  recipeB:temperature175  26.8667     2.0381 77.4  13.182 22.8087 30.9247
  recipeC:temperature175  27.9333     2.0381 77.4  13.706 23.8753 31.9913
  recipeA:temperature185  31.5333     2.0381 77.4  15.472 27.4753 35.5913
  recipeB:temperature185  29.4000     2.0381 77.4  14.425 25.3420 33.4580
  recipeC:temperature185  28.9333     2.0381 77.4  14.196 24.8753 32.9913
  recipeA:temperature195  30.8000     2.0381 77.4  15.112 26.7420 34.8580
  recipeB:temperature195  31.7333     2.0381 77.4  15.570 27.6753 35.7913
  recipeC:temperature195  31.7333     2.0381 77.4  15.570 27.6753 35.7913
  recipeA:temperature205  33.5333     2.0381 77.4  16.453 29.4753 37.5913
  recipeB:temperature205  32.1333     2.0381 77.4  15.766 28.0753 36.1913
  recipeC:temperature205  30.8667     2.0381 77.4  15.145 26.8087 34.9247
  recipeA:temperature215  38.6667     2.0381 77.4  18.972 34.6087 42.7247
  recipeB:temperature215  34.4667     2.0381 77.4  16.911 30.4087 38.5247
  recipeC:temperature215  34.4000     2.0381 77.4  16.878 30.3420 38.4580
  recipeA:temperature225  35.0667     2.0381 77.4  17.206 31.0087 39.1247
  recipeB:temperature225  35.2667     2.0381 77.4  17.304 31.2087 39.3247
  recipeC:temperature225  35.7333     2.0381 77.4  17.533 31.6753 39.7913
                          Pr(>|t|)    
  recipeA                < 2.2e-16 ***
  recipeB                < 2.2e-16 ***
  recipeC                < 2.2e-16 ***
  temperature175         < 2.2e-16 ***
  temperature185         < 2.2e-16 ***
  temperature195         < 2.2e-16 ***
  temperature205         < 2.2e-16 ***
  temperature215         < 2.2e-16 ***
  temperature225         < 2.2e-16 ***
  recipeA:temperature175 < 2.2e-16 ***
  recipeB:temperature175 < 2.2e-16 ***
  recipeC:temperature175 < 2.2e-16 ***
  recipeA:temperature185 < 2.2e-16 ***
  recipeB:temperature185 < 2.2e-16 ***
  recipeC:temperature185 < 2.2e-16 ***
  recipeA:temperature195 < 2.2e-16 ***
  recipeB:temperature195 < 2.2e-16 ***
  recipeC:temperature195 < 2.2e-16 ***
  recipeA:temperature205 < 2.2e-16 ***
  recipeB:temperature205 < 2.2e-16 ***
  recipeC:temperature205 < 2.2e-16 ***
  recipeA:temperature215 < 2.2e-16 ***
  recipeB:temperature215 < 2.2e-16 ***
  recipeC:temperature215 < 2.2e-16 ***
  recipeA:temperature225 < 2.2e-16 ***
  recipeB:temperature225 < 2.2e-16 ***
  recipeC:temperature225 < 2.2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
    Confidence level: 95%
    Degrees of freedom method: Satterthwaite 
  > stopifnot(
  +   isTRUE(all.equal(lsm2, lsm3, check.attributes=FALSE))
  + )
  > 
  > # Covariate (only):
  > data("sleepstudy", package="lme4")
  > m <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
  > (lsm <- ls_means(m))
  Least Squares Means table:
  
       Estimate Std. Error df t value lower upper Pr(>|t|)
  
    Confidence level: 95%
    Degrees of freedom method: Satterthwaite 
  > stopifnot(
  +   nrow(lsm) == 0L,
  +   ncol(lsm) == 7L
  + )
  > 
  > # No fixef:
  > m <- lmer(Reaction ~ 0 + (Days | Subject), sleepstudy)
  > (lsm <- ls_means(m))
  Least Squares Means table:
  
       Estimate Std. Error df t value lower upper Pr(>|t|)
  
    Confidence level: 95%
    Degrees of freedom method: Satterthwaite 
  > stopifnot(
  +   nrow(lsm) == 0L,
  +   ncol(lsm) == 7L
  + )
  > 
  > ########### Arguments and options:
  > 
  > # which
  > model <- lmer(angle ~ recipe * temperature + (1|recipe:replicate), cake2)
  > (lsm4 <- ls_means(model, which = "recipe"))
  Least Squares Means table:
  
          Estimate Std. Error df t value   lower   upper  Pr(>|t|)    
  recipeA  33.1222     1.7368 42  19.070 29.6172 36.6273 < 2.2e-16 ***
  recipeB  31.6444     1.7368 42  18.220 28.1394 35.1495 < 2.2e-16 ***
  recipeC  31.6000     1.7368 42  18.194 28.0949 35.1051 < 2.2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
    Confidence level: 95%
    Degrees of freedom method: Satterthwaite 
  > stopifnot(
  +   nrow(lsm4) == 3L,
  +   ncol(lsm4) == 7L,
  +   isTRUE(all.equal(lsm3[1:3, ], lsm4, check.attributes=FALSE))
  + )
  > 
  > # KR:
  > (lsm5 <- ls_means(model, which = "recipe", ddf = "Kenward-Roger"))
  Least Squares Means table:
  
          Estimate Std. Error df t value   lower   upper  Pr(>|t|)    
  recipeA  33.1222     1.7368 42  19.070 29.6172 36.6273 < 2.2e-16 ***
  recipeB  31.6444     1.7368 42  18.220 28.1394 35.1495 < 2.2e-16 ***
  recipeC  31.6000     1.7368 42  18.194 28.0949 35.1051 < 2.2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
    Confidence level: 95%
    Degrees of freedom method: Kenward-Roger 
  > 
  > # level:
  > (lsm6 <- ls_means(model, which = "recipe", level=0.99))
  Least Squares Means table:
  
          Estimate Std. Error df t value   lower   upper  Pr(>|t|)    
  recipeA  33.1222     1.7368 42  19.070 28.4361 37.8083 < 2.2e-16 ***
  recipeB  31.6444     1.7368 42  18.220 26.9584 36.3305 < 2.2e-16 ***
  recipeC  31.6000     1.7368 42  18.194 26.9139 36.2861 < 2.2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
    Confidence level: 99%
    Degrees of freedom method: Satterthwaite 
  > 
  > stopifnot(
  +   all(lsm6[, "lower"] < lsm4[, "lower"]),
  +   all(lsm6[, "upper"] > lsm4[, "upper"])
  + )
  > 
  > 
  > 
  > ########### Missing cels -> unestimable contrasts:
  > 
  > # Missing cell:
  > cake3 <- cake
  > cake3$temperature <- factor(cake3$temperature, ordered=FALSE)
  > cake3 <- droplevels(subset(cake3, temperature %in% levels(cake3$temperature)[1:3]))
  > cake3 <- droplevels(subset(cake3, !(recipe == "C" & temperature == "195") ))
  > str(cake3)
  'data.frame':	120 obs. of  5 variables:
   $ replicate  : Factor w/ 15 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 2 2 ...
   $ recipe     : Factor w/ 3 levels "A","B","C": 1 1 1 2 2 2 3 3 1 1 ...
   $ temperature: Factor w/ 3 levels "175","185","195": 1 2 3 1 2 3 1 2 1 2 ...
   $ angle      : int  42 46 47 39 46 51 46 44 47 29 ...
   $ temp       : num  175 185 195 175 185 195 175 185 175 185 ...
  > with(cake3, table(recipe, temperature))
        temperature
  recipe 175 185 195
       A  15  15  15
       B  15  15  15
       C  15  15   0
  > model <- lmer(angle ~ recipe * temperature + (1|recipe:replicate), cake3)
  fixed-effect model matrix is rank deficient so dropping 1 column / coefficient
  > (lsm7 <- ls_means(model))
  Least Squares Means table:
  
                         Estimate Std. Error   df t value   lower   upper
  recipeA                 30.4889     1.7407 40.3  17.515 26.9716 34.0062
  recipeB                 29.3333     1.7407 40.3  16.851 25.8160 32.8506
  recipeC                      NA         NA   NA      NA      NA      NA
  temperature175          27.9778     1.1016 57.2  25.398 25.7720 30.1835
  temperature185          29.9556     1.1016 57.2  27.193 27.7498 32.1613
  temperature195               NA         NA   NA      NA      NA      NA
  recipeA:temperature175  29.1333     1.9080 57.2  15.269 25.3129 32.9538
  recipeB:temperature175  26.8667     1.9080 57.2  14.081 23.0462 30.6871
  recipeC:temperature175  27.9333     1.9080 57.2  14.640 24.1129 31.7538
  recipeA:temperature185  31.5333     1.9080 57.2  16.527 27.7129 35.3538
  recipeB:temperature185  29.4000     1.9080 57.2  15.409 25.5795 33.2205
  recipeC:temperature185  28.9333     1.9080 57.2  15.164 25.1129 32.7538
  recipeA:temperature195  30.8000     1.9080 57.2  16.143 26.9795 34.6205
  recipeB:temperature195  31.7333     1.9080 57.2  16.632 27.9129 35.5538
  recipeC:temperature195       NA         NA   NA      NA      NA      NA
                          Pr(>|t|)    
  recipeA                < 2.2e-16 ***
  recipeB                < 2.2e-16 ***
  recipeC                       NA    
  temperature175         < 2.2e-16 ***
  temperature185         < 2.2e-16 ***
  temperature195                NA    
  recipeA:temperature175 < 2.2e-16 ***
  recipeB:temperature175 < 2.2e-16 ***
  recipeC:temperature175 < 2.2e-16 ***
  recipeA:temperature185 < 2.2e-16 ***
  recipeB:temperature185 < 2.2e-16 ***
  recipeC:temperature185 < 2.2e-16 ***
  recipeA:temperature195 < 2.2e-16 ***
  recipeB:temperature195 < 2.2e-16 ***
  recipeC:temperature195        NA    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
    Confidence level: 95%
    Degrees of freedom method: Satterthwaite 
  > 
  > # Using show_tests with options:
  > show_tests(lsm7, fractions = TRUE)
  $recipe
          (Intercept) recipeB recipeC temperature185 temperature195
  recipeA   1           0       0     1/3            1/3           
  recipeB   1           1       0     1/3            1/3           
  recipeC   1           0       1     1/3            1/3           
          recipeB:temperature185 recipeC:temperature185 recipeB:temperature195
  recipeA   0                      0                      0                   
  recipeB 1/3                      0                    1/3                   
  recipeC   0                    1/3                      0                   
          recipeC:temperature195
  recipeA   0                   
  recipeB   0                   
  recipeC 1/3                   
  
  $temperature
                 (Intercept) recipeB recipeC temperature185 temperature195
  temperature175   1         1/3     1/3       0              0           
  temperature185   1         1/3     1/3       1              0           
  temperature195   1         1/3     1/3       0              1           
                 recipeB:temperature185 recipeC:temperature185
  temperature175   0                      0                   
  temperature185 1/3                    1/3                   
  temperature195   0                      0                   
                 recipeB:temperature195 recipeC:temperature195
  temperature175   0                      0                   
  temperature185   0                      0                   
  temperature195 1/3                    1/3                   
  
  $`recipe:temperature`
                         (Intercept) recipeB recipeC temperature185
  recipeA:temperature175 1           0       0       0             
  recipeB:temperature175 1           1       0       0             
  recipeC:temperature175 1           0       1       0             
  recipeA:temperature185 1           0       0       1             
  recipeB:temperature185 1           1       0       1             
  recipeC:temperature185 1           0       1       1             
  recipeA:temperature195 1           0       0       0             
  recipeB:temperature195 1           1       0       0             
  recipeC:temperature195 1           0       1       0             
                         temperature195 recipeB:temperature185
  recipeA:temperature175 0              0                     
  recipeB:temperature175 0              0                     
  recipeC:temperature175 0              0                     
  recipeA:temperature185 0              0                     
  recipeB:temperature185 0              1                     
  recipeC:temperature185 0              0                     
  recipeA:temperature195 1              0                     
  recipeB:temperature195 1              0                     
  recipeC:temperature195 1              0                     
                         recipeC:temperature185 recipeB:temperature195
  recipeA:temperature175 0                      0                     
  recipeB:temperature175 0                      0                     
  recipeC:temperature175 0                      0                     
  recipeA:temperature185 0                      0                     
  recipeB:temperature185 0                      0                     
  recipeC:temperature185 1                      0                     
  recipeA:temperature195 0                      0                     
  recipeB:temperature195 0                      1                     
  recipeC:temperature195 0                      0                     
                         recipeC:temperature195
  recipeA:temperature175 0                     
  recipeB:temperature175 0                     
  recipeC:temperature175 0                     
  recipeA:temperature185 0                     
  recipeB:temperature185 0                     
  recipeC:temperature185 0                     
  recipeA:temperature195 0                     
  recipeB:temperature195 0                     
  recipeC:temperature195 1                     
  
  > show_tests(lsm7, fractions = TRUE, names = FALSE)
  $recipe
       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
  [1,]   1    0    0  1/3  1/3    0    0    0    0 
  [2,]   1    1    0  1/3  1/3  1/3    0  1/3    0 
  [3,]   1    0    1  1/3  1/3    0  1/3    0  1/3 
  
  $temperature
       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
  [1,]   1  1/3  1/3    0    0    0    0    0    0 
  [2,]   1  1/3  1/3    1    0  1/3  1/3    0    0 
  [3,]   1  1/3  1/3    0    1    0    0  1/3  1/3 
  
  $`recipe:temperature`
        [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
   [1,] 1    0    0    0    0    0    0    0    0   
   [2,] 1    1    0    0    0    0    0    0    0   
   [3,] 1    0    1    0    0    0    0    0    0   
   [4,] 1    0    0    1    0    0    0    0    0   
   [5,] 1    1    0    1    0    1    0    0    0   
   [6,] 1    0    1    1    0    0    1    0    0   
   [7,] 1    0    0    0    1    0    0    0    0   
   [8,] 1    1    0    0    1    0    0    1    0   
   [9,] 1    0    1    0    1    0    0    0    1   
  
  > 
  > # Missing diagonal:
  > cake4 <- cake
  > cake4$temperature <- factor(cake4$temperature, ordered=FALSE)
  > cake4 <- droplevels(subset(cake4, temperature %in% levels(cake4$temperature)[1:3]))
  > cake4 <- droplevels(subset(cake4, !((recipe == "A" & temperature == "175") |
  +                                       (recipe == "B" & temperature == "185") |
  +                                       (recipe == "C" & temperature == "195") )))
  > # str(cake4)
  > with(cake4, table(recipe, temperature))
        temperature
  recipe 175 185 195
       A   0  15  15
       B  15   0  15
       C  15  15   0
  > model <- lmer(angle ~ recipe * temperature + (1|recipe:replicate), cake4)
  fixed-effect model matrix is rank deficient so dropping 3 columns / coefficients
  > ls_means(model)
  Least Squares Means table:
  
                         Estimate Std. Error   df t value   lower   upper
  recipeA                      NA         NA   NA      NA      NA      NA
  recipeB                      NA         NA   NA      NA      NA      NA
  recipeC                      NA         NA   NA      NA      NA      NA
  temperature175               NA         NA   NA      NA      NA      NA
  temperature185               NA         NA   NA      NA      NA      NA
  temperature195               NA         NA   NA      NA      NA      NA
  recipeA:temperature175       NA         NA   NA      NA      NA      NA
  recipeB:temperature175  26.8667     1.8908 53.5  14.209 23.0750 30.6584
  recipeC:temperature175  27.9333     1.8908 53.5  14.773 24.1416 31.7250
  recipeA:temperature185  31.5333     1.8908 53.5  16.677 27.7416 35.3250
  recipeB:temperature185       NA         NA   NA      NA      NA      NA
  recipeC:temperature185  28.9333     1.8908 53.5  15.302 25.1416 32.7250
  recipeA:temperature195  30.8000     1.8908 53.5  16.289 27.0083 34.5917
  recipeB:temperature195  31.7333     1.8908 53.5  16.783 27.9416 35.5250
  recipeC:temperature195       NA         NA   NA      NA      NA      NA
                          Pr(>|t|)    
  recipeA                       NA    
  recipeB                       NA    
  recipeC                       NA    
  temperature175                NA    
  temperature185                NA    
  temperature195                NA    
  recipeA:temperature175        NA    
  recipeB:temperature175 < 2.2e-16 ***
  recipeC:temperature175 < 2.2e-16 ***
  recipeA:temperature185 < 2.2e-16 ***
  recipeB:temperature185        NA    
  recipeC:temperature185 < 2.2e-16 ***
  recipeA:temperature195 < 2.2e-16 ***
  recipeB:temperature195 < 2.2e-16 ***
  recipeC:temperature195        NA    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
    Confidence level: 95%
    Degrees of freedom method: Satterthwaite 
  > 
  > 
  > ########### Various contrasts codings:
  > 
  > model <- lmer(angle ~ recipe * temperature + (1|recipe:replicate), cake3,
  +               contrasts = list(recipe="contr.sum", temperature="contr.helmert"))
  fixed-effect model matrix is rank deficient so dropping 1 column / coefficient
  > (lsm8 <- ls_means(model))
  Least Squares Means table:
  
                         Estimate Std. Error   df t value   lower   upper
  recipeA                 30.4889     1.7407 40.3  17.515 26.9716 34.0062
  recipeB                 29.3333     1.7407 40.3  16.851 25.8160 32.8506
  recipeC                      NA         NA   NA      NA      NA      NA
  temperature175          27.9778     1.1016 57.2  25.398 25.7720 30.1835
  temperature185          29.9556     1.1016 57.2  27.193 27.7498 32.1613
  temperature195               NA         NA   NA      NA      NA      NA
  recipeA:temperature175  29.1333     1.9080 57.2  15.269 25.3129 32.9538
  recipeB:temperature175  26.8667     1.9080 57.2  14.081 23.0462 30.6871
  recipeC:temperature175  27.9333     1.9080 57.2  14.640 24.1129 31.7538
  recipeA:temperature185  31.5333     1.9080 57.2  16.527 27.7129 35.3538
  recipeB:temperature185  29.4000     1.9080 57.2  15.409 25.5795 33.2205
  recipeC:temperature185  28.9333     1.9080 57.2  15.164 25.1129 32.7538
  recipeA:temperature195  30.8000     1.9080 57.2  16.143 26.9795 34.6205
  recipeB:temperature195  31.7333     1.9080 57.2  16.632 27.9129 35.5538
  recipeC:temperature195       NA         NA   NA      NA      NA      NA
                          Pr(>|t|)    
  recipeA                < 2.2e-16 ***
  recipeB                < 2.2e-16 ***
  recipeC                       NA    
  temperature175         < 2.2e-16 ***
  temperature185         < 2.2e-16 ***
  temperature195                NA    
  recipeA:temperature175 < 2.2e-16 ***
  recipeB:temperature175 < 2.2e-16 ***
  recipeC:temperature175 < 2.2e-16 ***
  recipeA:temperature185 < 2.2e-16 ***
  recipeB:temperature185 < 2.2e-16 ***
  recipeC:temperature185 < 2.2e-16 ***
  recipeA:temperature195 < 2.2e-16 ***
  recipeB:temperature195 < 2.2e-16 ***
  recipeC:temperature195        NA    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
    Confidence level: 95%
    Degrees of freedom method: Satterthwaite 
  > # show_tests(lsm7)
  > # show_tests(lsm8)
  > stopifnot(
  +   isTRUE(all.equal(lsm7, lsm8, check.attributes=FALSE))
  + )
  Error: isTRUE(all.equal(lsm7, lsm8, check.attributes = FALSE)) is not TRUE
  Execution halted