# Dictionary for random effects in MultiLevel.jl model

**URL:** <https://discourse.julialang.org/t/dictionary-for-random-effects-in-multilevel-jl-model/24515>\
**Category:** General Usage\
**Created:** [May 23, 2019, 1:24pm UTC](https://discourse.julialang.org/t/dictionary-for-random-effects-in-multilevel-jl-model/24515 "2019-05-23T13:24:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spinkney](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@spinkney](https://discourse.julialang.org/u/spinkney)\
**Post date:** [May 23, 2019, 1:24pm UTC](https://discourse.julialang.org/t/dictionary-for-random-effects-in-multilevel-jl-model/24515/1 "2019-05-23T13:24:32Z")

</div>

Coming from an R background and lme4. I have 210 market\_no’s and I’m fitting a logistic regression with a varying intercept on market\_no’s. I can’t seem to find the match between the market\_no’s and the fit random effects. Does anyone know if there’s a dictionary in MixedModels.jl or how it orders the random effects column? In R it’s just the ordering of the levels in the factor.

```julia
using MixedModels
propensity = fit(GeneralizedLinearMixedModel, @formula(exposure_flag ~ 1 + hrs + (1 |market_no)), data, Bernoulli())

ran_ef = ranef(propensity)[1]

julia> ran_ef
1×210 Array{Float64,2}:
 0.175225 0.00431493 0.0471093 -0.0464407 -0.50483 0.0908781 0.134034 -0.265099 -0.0321225 0.055499 0.55636 -0.395267 … -0.30837 -0.157295 -0.328563 -0.157659 -0.00782337 -0.0862638 -0.137914 -0.237887 -0.456184 0.00809435 -0.202609

```

---

<div class="post-metadata">

**Author:** ![palday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palday/32/12640_2.png) [@palday](https://discourse.julialang.org/u/palday)\
**Post date:** [June 13, 2023, 2:47pm UTC](https://discourse.julialang.org/t/dictionary-for-random-effects-in-multilevel-jl-model/24515/2 "2023-06-13T14:47:40Z")

</div>

`raneftables` will give things in a nice tabular format, including labels of the levels
