title: How do I match fitted(gamm4.model) values with DF despite NAs?
body: <p>I'm trying to make use of the fitted values from a <a href="http://cran.r-project.org/web/packages/gamm4/gamm4.pdf" rel="nofollow">gamm4</a> model and need them to match up with the right rows in the dataframe I'm working with.<br>
  Here's the model I run:</p>
  
  <pre><code>gam.outcome &lt;- gamm4(formula = outcome ~ male + s(gpa),
                      random = ~ (1|school),
                      data=avr, na.action="na.exclude")
  </code></pre>
  
  <p>With an lmer object the "na.exclude" option leaves NAs in the fitted values so that a fitted(lmer.output) call returns a vector the same length and order as the dataframe.  But in gamm4 I've tried <code>fitted(gam.outcome$gam)</code> and <code>fitted(gam.outcome$mer)</code> but don't know how to deal with the results of either.  The latter omits all NA, despite the "na.exclude" option.  The former includes twice as many NA values as lmer which should be a clue of some kind, but I'm too thick to get it.  All I know is that either way the vector doesn't line up with the original data.  </p>
  
  <p>I imagine there is more than one way to solve my problem.  I greatly appreciate help improving or tagging my question as well as answering it.  Thanks!</p>