title: warning messages using glmer function from lme4 package R
body: <p>I am trying to fit a logistic random intercept model using glmer function from package lme4. Unfortunately I am getting the following warning messages and clearly wrong results (for the coefficients).</p>
  
  <pre><code>Warning messages:
  1: In vcov.merMod(object, use.hessian = use.hessian) :
    variance-covariance matrix computed from finite-difference Hessian is
  not positive definite: falling back to var-cov estimated from RX
  2: In vcov.merMod(object, correlation = correlation, sigm = sig) :
    variance-covariance matrix computed from finite-difference Hessian is
  not positive definite: falling back to var-cov estimated from RX
  </code></pre>
  
  <p>Doing some research, I found that glmer produces merMod objects. Relying on this :
  <a href="http://jaredknowles.com/journal/2014/5/17/mixed-effects-tutorial-2-fun-with-mermod-objects" rel="nofollow">http://jaredknowles.com/journal/2014/5/17/mixed-effects-tutorial-2-fun-with-mermod-objects</a>
  and reproducing the "Exploring the Internals of a merMod Object" section I had the following results as far as my model is concerned:</p>
  
  <pre><code>### [1] "standardGeneric"
  ###attr(,"package")
  ###[1] "methods"
  </code></pre>
  
  <p>which is clearly different from </p>
  
  <pre><code>### [1] "lmerMod"
  ### attr(,"package")
  ### [1] "lme4"
  </code></pre>
  
  <p>as indicated on the tutorial.</p>
  
  <p>My question why my object is not of merMod class? Are the above warnings related to this and how could I fix them?</p>
  
  <p>This is the code I used to create the data frame and run the model</p>
  
  <pre><code>diagn00&lt;- rep(0,240)
  
  drug00&lt;- rep(0,240)
  
  time00&lt;- c(rep(0,80),rep(1,80),rep(2,80))
  
  response00&lt;- c(rep(0,39),rep(1,41),rep(0,33),rep(1,47),rep(0,26),rep(1,54))
  
  patients00&lt;- rep(1:80,3)
  
  test&lt;- data.frame(patients00,diagn00,drug00,time00,response00)
  
  diagn01&lt;- rep(0,210)
  
  drug01&lt;- rep(1,210)
  
  time01&lt;- c(rep(0,70),rep(1,70),rep(2,70))
  
  response01&lt;- c(rep(0,33),rep(1,37),rep(0,15),rep(1,55),rep(0,2),rep(1,68))
  
  patients01&lt;- rep(81:150,3)
  
  diagn10&lt;- rep(1,300)
  
  drug10&lt;- rep(0,300)
  
  time10&lt;- c(rep(0,100),rep(1,100),rep(2,100))
  
  response10&lt;- c(rep(0,79),rep(1,21),rep(0,72),rep(1,28),rep(0,54),rep(1,46))
  
  patients10&lt;- rep(151:250,3)
  
  diagn11&lt;- rep(1,270)
  
  drug11&lt;- rep(1,270)
  
  time11&lt;- c(rep(0,90),rep(1,90),rep(2,90))
  
  response11&lt;-  c(rep(0,74),rep(1,16),rep(0,45),rep(1,45),rep(0,15),rep(1,75))
  
  patients11&lt;- rep(251:340,3)
  
  diagnosis&lt;- c(diagn00,diagn01,diagn10,diagn11)
  diagnosis&lt;- as.factor(diagnosis)
  
  id&lt;- c(patients00,patients01,patients10,patients11)
  id&lt;- as.factor(id)
  
  drug&lt;- c(drug00,drug01,drug10,drug11)
  drug&lt;- as.factor(drug)
  time&lt;- c(time00,time01,time10,time11)
  
  response&lt;- c(response00,response01,response10,response11)
  
  id&lt;- c(patients00,patients01,patients10,patients11)
  
  data&lt;- data.frame(id, response, diagnosis, drug, time)
  e&lt;- order(data$id)
  d&lt;- data[e,]
  
  library(lme4)
  
  d2&lt;- data.frame(d)
  d2$response&lt;- as.factor(d2$response)
  d2$time&lt;- as.factor(d2$time)
  d2$id&lt;- as.factor(d2$id)
  
  t&lt;- glmer(response ~ diagnosis + drug + time + time:drug +
  (1 | id), family=binomial, data=d2)
  </code></pre>
  
  <p>session info</p>
  
  <p>e:
  [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252<br>
  [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C<br>
  [5] LC_TIME=English_United States.1252    </p>
  
  <p>attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     </p>
  
  <p>other attached packages:
  [1] glmmML_1.0    nlme_3.1-111  MASS_7.3-29   lme4_1.1-6    Rcpp_0.11.1   Matrix_1.1-3  MuMIn_1.10.0 
  [8] gee_4.13-18   geepack_1.1-6</p>
  
  <p>loaded via a namespace (and not attached):
  [1] grid_3.0.2          lattice_0.20-29     minqa_1.2.3         RcppEigen_0.3.2.1.1 splines_3.0.2<br>
  [6] tools_3.0.2      </p>
  
  <p>package info</p>
  
  <pre><code>packageVersion("lme4")
  [1] ‘1.1.6’
  </code></pre>