title: problems with mice in R: cannot coerce class '"mids"' into a data.frame
body: <p>I have a dataset with about 11,500 rows and 15 factors.  I only need to impute values for 3 of the factors, with only 2 of the factors having any significant number of missing values.  I have been trying to use mice to create imputed datasets, and I am using the following code:</p>
  
  <pre><code>dataset&lt;-read.csv("filename.csv",header=TRUE)
  
  model&lt;-success~1+course+medium+ethnicity+gender+age+enrollment+HSGPA+GPA+Pell+ethnicity*medium
  
  library(mice)
  
  vempty&lt;-c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
  v12&lt;-c(0,0,0,0,0,0,0,1,1,1,1,0,1,1,1)
  v13&lt;-c(0,0,0,0,0,0,0,1,1,1,1,1,0,1,1)
  v14&lt;-c(0,0,0,0,0,0,0,1,1,1,1,1,1,0,1)
  list&lt;-list(vempty,vempty,vempty,vempty,vempty,vempty,vempty,vempty,vempty,vempty,vempty,v12,v13,v14,vempty)
  predmatrix&lt;-do.call(rbind,list)
  
  
  MIdataset&lt;-mice(dataset,m=2,predictorMatrix=predmatrix)
  MIoutput&lt;- pool(glm(model, data=MIdataset, family=binomial))
  </code></pre>
  
  <p>After this code, I get the error message:</p>
  
  <p>Error in as.data.frame.default(data) : 
    cannot coerce class '"mids"' into a data.frame</p>
  
  <p>I'm totally at a loss as to what this means.  I had no trouble doing this same analysis just deleting the missing data and using regular glm.  I'd also like to do a multilvel logistic model on imputed datasets using lmer (that's the next step after I get this to work with glm), so if there is anything I am doing wrong that will also impact that next step, that would be good to know, too.  I've tried to search this error on the internet, and I'm not getting anywhere.  I'm just really learning R, so I'm also not that familiar with the environment yet.  </p>
  
  <p>Thanks for your time!</p>