[R-sig-ME] Using broom.mixed library with lme4
Phillip Alday
ph||||p@@|d@y @end|ng |rom mp|@n|
Tue Nov 10 12:30:30 CET 2020
Why do you think ubar is for the random effects? In my very quick skim
of the documentation, I didn't see anything indicating that. Looking at
the structures in `fit`, I see:
> tidy(fit$analyses[[5]])
# A tibble: 4 x 6
effect group term estimate std.error statistic
<chr> <chr> <chr> <dbl> <dbl> <dbl>
1 fixed NA (Intercept) 4.91 0.0855 57.4
2 fixed NA sex 0.853 0.0350 24.4
3 ran_pars school sd__(Intercept) 0.820 NA NA
4 ran_pars Residual sd__Observation 0.767 NA NA
None of the random effects line up with the output of pool(). Moreover,
the pool() documentation notes that it needs the standard error of each
estimate, but lme4 doesn't produce those (for good reason) for random
effects, so pool() won't produce pooled estimates for the random effects.
The pool() documentation mentions the mipo class, so I looked at ?mipo
and found this:
‘estimate’ Pooled complete data estimate
‘ubar’ Within-imputation variance of ‘estimate’
‘b’ Between-imputation variance of ‘estimate’
‘t’ Total variance, of ‘estimate’
‘dfcom’ Degrees of freedom in complete data
‘df’ Degrees of freedom of $t$-statistic
‘riv’ Relative increase in variance
‘lambda’ Proportion attributable to the missingness
‘fmi’ Fraction of missing information
So `ubar` and `b` are perhaps random effects, but not in the sense
you're thinking of, but rather the random effects that go into
imputation procedures (this is a guess on my part). I don't know much
about imputation, but I suspect this is analogous to the parallels
between mixed models and meta-analysis
(http://www.metafor-project.org/doku.php/tips:rma_vs_lm_lme_lmer). But
again, this is rapidly getting out of my area of expertise and into the
expertise of other members of this list (e.g. Wolfgang Viechtbauer for
meta analysis).
Phillip
On 10/11/20 7:17 am, Simon Harmel wrote:
> Dear All,
>
> Belwo, I've used library `broom.mixed` and imputed some data with library
> `mice` to then fit a "random-intercept" `lmer()` model.
>
> BUT I wonder why after I `pool()` my analyses, there is an extra "ubar"
> (random-effect) for slope (`sex`) which is not even in the model?!
>
> library(mice)
> library(lme4)
> library(broom.mixed)
>
> imp <- mice(popmis, m = 5) # `popmis` is a dataset from `mice`
>
> fit <- with(data = imp, exp = lme4::lmer(popular ~ sex + (1|school)))
>
> pool(fit)
>
> ### `ubar` is the random effect for intercept (0.007524509) BUT WHY we see
> a ubar ALSO for `sex` (0.001177781)?
>
> Class: mipo m = 5
> term m estimate ubar b t dfcom
> df
> 1 (Intercept) 5 4.9007789 0.007524509 0.0004845564 0.008105977 1996
> 547.44383
> 2 sex 5 0.8617941 0.001177781 0.0015867795 0.003081916 1996
> 10.33653
> riv lambda fmi
> 1 0.0772765 0.07173321 0.0751060
> 2 1.6167147 0.61784141 0.6751515
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list