title: Specify mixed model with ezMixed and get predictions and plots with ezPlot2 (ez package)
body: <p>I am a ez package newbie and I have been trying to run a mixed effect anova using ezMixed as my repeated measure data is unbalanced and there is some missing data for some of the repeated observations. My response variable 'count' is an average of count data and does not follow a poisson distirbution. First, I am unsure I specified my model correctly using ezMixed. Using lme(), my model would look like this:</p>
  
  <pre><code>lmefitmix2 = lme(count ~ MPA*timepointID,random=~1|siteID/timepointID ,na.action=na.omit,data = notolabrusMav2,method="ML")
  </code></pre>
  
  <p>My repeated measure (within factor) being timepointID nested in my random factor siteID. I am interested in testing for the main effect of a grouping variable "MPA" (between effect) and for the effect of the repeated measure "timepoint ID" as well as their interaction. I understand that if my design had been balanced, I could have used ezAnova and specify wid=.siteID and within=.timepoint ID, but I am not sure how to translate this in ezMixed. My attempt is the following, but it makes it look like siteID and timepointID are crossed:</p>
  
  <pre><code>er = ezMixed(
      data = notolabrusmav2
      , dv = .(count)
      , random = .(siteID,timepointID)
      , fixed = .(MPA,timepointID)
      , family = 'gaussian'
  )
  print(er$summary)
  </code></pre>
  
  <p>How can I fix this?</p>
  
  <p>Also, the print(er$summary) command gives me the following result:</p>
  
  <pre><code>er$summary
  
             effect errors warnings       bits
  
  1             MPA  FALSE    FALSE   1.710731
  
  2     timepointID  FALSE    FALSE  26.514379
  
  3 MPA:timepointID  FALSE    FALSE -24.895950
  </code></pre>
  
  <p>So i understand the main effect with the most strength of evidence here is 'timepointID', while the interaction of both shows little strength of evidence.</p>
  
  <p>I have tried to generate and plot predictions with ezPredict and ezPlot2 as follows:</p>
  
  <pre><code>myFit = er$models$timepointID$unrestricted
  myPreds = ezPredict(myFit)
  myPlot = ezPlot2(preds=myPreds,x=timepointID)
  print(myPlot$plot)
  </code></pre>
  
  <p>Which gives me the following error message:</p>
  
  <pre><code>Error in order(boots$iteration) : argument 1 is not a vector
   print(myPlot$plot)
  Error in print(myPlot$plot) : 
    error in evaluating the argument 'x' in selecting a method for function 'print': Error: object 'myPlot' not found
  </code></pre>
  
  <p>I have been googling it, but I don't seem able to find a cue to help me fix it...</p>
  
  <p>Thanks if advance for your help ;0</p>