How to calculate p-value from a linear mixed effect model created by lme4::lmer() using broom::tidy()?
<p>I have a built a mixed effect model using the <code>lmer()</code> function from the <code>lme4</code> package. The <code>lme4</code> package does not output the p-value of the coefficients for some good philosophical reason. However, I still need p-values to report in my publication. I know there are multiple ways to calculate p-values using the model created by <code>lmer()</code>, e.g. <a href="https://stats.stackexchange.com/questions/118416/getting-p-value-with-mixed-effect-with-lme4-package">here</a>.</p>

<p>My problem is: I want to extract p-value using the <code>tidy()</code> function from the <code>broom</code> package. Here, I really want to stick with <code>tidy()</code> because I want to maintain the following pipeline:     </p>

<pre><code>data_frame %&gt;% group_by(grouping variables) %&gt;% do(tidy(fitted_model))
</code></pre>

<p>One option would be to create a custom function and append it to the pipeline. However, the man page of the <code>broom</code> package (<a href="http://rpackages.ianhowson.com/cran/broom/man/lme4_tidiers.html" rel="nofollow noreferrer">http://rpackages.ianhowson.com/cran/broom/man/lme4_tidiers.html</a>) says:</p>

<pre><code>"p.value  P-value computed from t-statistic (may be missing/NA)". 
</code></pre>

<p>By this I am assuming a function to calculate p-value from the t-value given by lmer model has already been implemented in broom. So, I am reluctant to reinvent the wheel. </p>

<p>The problem is I don't get the column with name p.value at all. I was expecting a column named p.value with NAs as the worst case scenario.</p>

<p>Code:</p>

<pre><code>library(lme4)
library(broom)
lme &lt;- lmer(Reaction ~ Days + (1 + Days | Subject), sleepstudy)
tidy(lme)
tidy(lme, effects = "fixed")
</code></pre>

<p>Output:</p>

<pre><code>&gt; tidy(lme)
                         term     estimate std.error statistic    group
1                  (Intercept) 251.40510485  6.824557 36.838306    fixed
2                         Days  10.46728596  1.545789  6.771485    fixed
3       sd_(Intercept).Subject  24.74045195        NA        NA  Subject
4              sd_Days.Subject   5.92213312        NA        NA  Subject
5 cor_(Intercept).Days.Subject   0.06555113        NA        NA  Subject
6      sd_Observation.Residual  25.59181564        NA        NA Residual
&gt; tidy(lme, effects = "fixed")
         term  estimate std.error statistic
1 (Intercept) 251.40510  6.824557 36.838306
2        Days  10.46729  1.545789  6.771485
</code></pre>