title: Call anova on lme4.lmer output via RPy
body: <p>I am trying to analyze the deviance of a set of linear models generated with lme4.lmer() via RPy. <a href="http://nbviewer.ipython.org/urls/gist.github.com/TheChymera/7396334/raw/20c7878456fea4c05e1889d566ab1e5b20bc90bb/nlme-aov" rel="nofollow">This notebook here</a> shows a full example with me importing my deps, loading my files, running my lme4.lmer() and failing to get anova to run on them. </p>
  
  <p>For your convenience here is again a paste of the line that is failing and which I would like to see work.</p>
  
  <pre><code>compare = stats.anova(res[0], res[1], res[2])
      Error in Ops.data.frame(data, data[[1]]) : 
        list of length 3 not meaningful
      In addition: Warning message:
      In anova.merMod(&lt;S4 object of class "lmerMod"&gt;, &lt;S4 object of class "lmerMod"&gt;,  :
        failed to find unique model names, assigning generic names
  
      ---------------------------------------------------------------------------
      RRuntimeError                             Traceback (most recent call last)
      &lt;ipython-input-47-fe0ffa3b55de&gt; in &lt;module&gt;()
      ----&gt; 1 compare = stats.anova(res[0], res[1], res[2])
  
      /usr/lib64/python2.7/site-packages/rpy2/robjects/functions.pyc in __call__(self, args, **kwargs)
           84                 v = kwargs.pop(k)
           85                 kwargs[r_k] = v
      ---&gt; 86         return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
  
      /usr/lib64/python2.7/site-packages/rpy2/robjects/functions.pyc in __call__(self, *args, **kwargs)
           33         for k, v in kwargs.iteritems():
           34             new_kwargs[k] = conversion.py2ri(v)
      ---&gt; 35         res = super(Function, self).__call__(*new_args, **new_kwargs)
           36         res = conversion.ri2py(res)
           37         return res
  
      RRuntimeError: Error in Ops.data.frame(data, data[[1]]) : 
        list of length 3 not meaningful
  </code></pre>
  
  <p>This code runs perfectly in R as:</p>
  
  <pre><code>&gt; mydata = read.csv("http://chymera.eu/data/test/r_data.csv")
  &gt; library(lme4)
  Loading required package: lattice
  Loading required package: Matrix
  &gt; lme1 = lme4.lmer(formula='RT~cat2 + (1|ID)', data=mydata, REML=FALSE)
  Error: could not find function "lme4.lmer"
  &gt; lme1 = lmer(formula='RT~cat1 + (1|ID)', data=mydata, REML=FALSE)
  &gt; lme2 = lmer(formula='RT~cat2 + (1|ID)', data=mydata, REML=FALSE)
  &gt; anova(lme1,lme2)
  &gt; lme3 = lmer(formula='RT~cat2*cat1 + (1|ID)', data=mydata, REML=FALSE)
  &gt; stats::anova(lme1, lme2, lme3)
  Data: mydata
  Models:
  lme1: RT ~ cat1 + (1 | ID)
  lme2: RT ~ cat2 + (1 | ID)
  lme3: RT ~ cat2 * cat1 + (1 | ID)
       Df    AIC    BIC  logLik deviance  Chisq Chi Df Pr(&gt;Chisq)    
  lme1  4 116.68 122.29 -54.342   108.68                             
  lme2  4 149.59 155.19 -70.793   141.59  0.000      0          1    
  lme3  6 117.19 125.59 -52.594   105.19 36.398      2  1.248e-08 ***
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  </code></pre>
  
  <p>Can you help me make it run in RPy as well?</p>