# Aggregated Binary Data in MixedModels

**URL:** https://discourse.julialang.org/t/aggregated-binary-data-in-mixedmodels/34919
**Category:** Statistics
**Tags:** question, package
**Created:** [February 20, 2020, 5:12pm UTC](https://discourse.julialang.org/t/aggregated-binary-data-in-mixedmodels/34919 "2020-02-20T17:12:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![talat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/talat/32/12970_2.png) [@talat](https://discourse.julialang.org/u/talat)
#### Post date: [February 20, 2020, 5:12pm UTC](https://discourse.julialang.org/t/aggregated-binary-data-in-mixedmodels/34919/1 "2020-02-20T17:12:20Z")

</div>

Hello all,

I’m trying to fit a generalized linear mixed model using the MixedModels package. It works fine as long as I use “normal” binary data i.e. response vector is simply 0/1 and each observartion is one row. I would like to use binary data in “aggregated” form as shown in this stackoverflow R post: [https://stackoverflow.com/a/18793811](https://stackoverflow.com/a/18793811) (mod2 and mod3 specification). In that case, it’s not a mixed model, but the usage is the same in R for lme4::glmer, afaik.

Is that possible in MixedModels? How?

Thanks

---

<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: [February 21, 2020, 9:03am UTC](https://discourse.julialang.org/t/aggregated-binary-data-in-mixedmodels/34919/2 "2020-02-21T09:03:29Z")

</div>

[https://juliastats.org/MixedModels.jl/stable/constructors/#MixedModels.GeneralizedLinearMixedModel](https://juliastats.org/MixedModels.jl/stable/constructors/#MixedModels.GeneralizedLinearMixedModel)

> The `Binomial` distribution is only used when the response is the fraction of trials returning a positive, in which case the number of trials must be specified as the case weights.
