# Different syntax for MixedModels? What's the difference?

**URL:** <https://discourse.julialang.org/t/different-syntax-for-mixedmodels-whats-the-difference/19754>\
**Category:** Statistics\
**Created:** [January 17, 2019, 6:32pm UTC](https://discourse.julialang.org/t/different-syntax-for-mixedmodels-whats-the-difference/19754 "2019-01-17T18:32:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [January 17, 2019, 6:32pm UTC](https://discourse.julialang.org/t/different-syntax-for-mixedmodels-whats-the-difference/19754/1 "2019-01-17T18:32:36Z")

</div>

Hello.

I would like to use MixedModels.jl to fit regression models with random effects.  
Looking at the official docs and some examples on the Internet I’ve found different syntaxes.

For example if I want to fit a Logit model (my outcome is binary) I can do it…:

```julia
fit(GeneralizedLinearMixedModel, @formula(y ~ 1 + x + (1 | id)), df, Bernoulli())
fit!(glmm(@formula(y ~ 1 + x + (1 | id)), df, Binomial(), LogitLink()))

```

What’s the difference between both syntaxes?

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [January 19, 2019, 10:34am UTC](https://discourse.julialang.org/t/different-syntax-for-mixedmodels-whats-the-difference/19754/2 "2019-01-19T10:34:01Z")

</div>

There shouldn’t be any difference. The JuliaStats ecosystem is moving towards a common API across packages that allows the user an intuitive and standard way to interact with various packages. StatsModels next release will solidify this change. In other words, the future will likely look as

```julia
model = fit(<:StatisticalModel, ::Formula, data, ...)

```

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [January 19, 2019, 11:07am UTC](https://discourse.julialang.org/t/different-syntax-for-mixedmodels-whats-the-difference/19754/3 "2019-01-19T11:07:22Z")

</div>

I believe the outer `fit!` is superfluous in the example, no?
