title: Permutation test error for likelihood ratio test of mixed model in R: permlmer, lmer, lme4, predictmeans
body: <p>I would like to test the main effect of a categorical variable using a permutation test on a likelihood ratio test. I have a continuous outcome and a dichotomous grouping predictor and a categorical time predictor (Day, 5 levels).</p>
  
  <p>Data is temporarily available in rda format via <a href="https://drive.google.com/open?id=1A9xSdsBsMMgt-iRgxFOYnw95gNcvK7iL" rel="nofollow noreferrer">this Drive link</a>.</p>
  
  <pre><code>library(lme4)
  lmer1 &lt;- lmer(outcome ~ Group*Day + (1 | ID), data = data, REML = F, na.action=na.exclude)
  lmer2 &lt;- lmer(outcome ~ Group + (1 | ID), data = data, REML = F, na.action=na.exclude)
  
  library(predictmeans)
  permlmer(lmer2,lmer1)
  </code></pre>
  
  <p>However, this code gives me the following error:</p>
  
  <p><em>Error in density.default(c(lrtest1, lrtest), kernel = "epanechnikov") : 
    need at least 2 points to select a bandwidth automatically</em></p>
  
  <p>The following code does work, but does not exactly give me the outcome of a permutated LR-test I believe:</p>
  
  <pre><code>library(nlme)
  lme1 &lt;- lme(outcome ~ Genotype*Day,
                    random = ~1 | ID,
                    data = data,
                    na.action = na.exclude)
  
  library(pgirmess)
  PermTest(lme1)
  </code></pre>
  
  <p><strong>Can anyone point out why I get the "epanechnikov" error when using the <code>permlmer</code> function?</strong></p>
  
  <p>Thank you!</p>