Extract Fixed Effect and Random Effect in Dataframe
<p>I'm using lme4 package to run mixed model. I want to extract fixed effect result and random effect result in seperate dataset, so that we can use it for further analysis. But unfortunately I could not.</p>

<p>E.g. </p>

<pre><code>mixed_result&lt;- lmer(Reaction ~ Days + (1|Subject), data = sleepstudy)
</code></pre>

<p>I tried to extract fixed effect and random effect using the following method:</p>

<pre><code>fixEffect&lt;-fixef(mixed_result)
randEffect&lt;-ranef(mixed_result)

View(fixEffect)
</code></pre>

<p>I tried fixef and ranef for fixed effect and random effect respectively and try to create the dataset using the result of it. But it was giving me the following error:</p>

<blockquote>
  <p>Error in View : cannot coerce class ""ranef.mer"" to a data.frame</p>
</blockquote>

<p>I actually want output as we get in SAS , solutionF and solutionR. But in case if it's not possible to get output like that, the coeffs of fixed and random will do.</p>

<p>I'll be grateful if someone can help me.</p>

<p>Thanks and Regards,</p>