# How to add weights parameter to Generalized Mixed Model

**URL:** <https://discourse.julialang.org/t/how-to-add-weights-parameter-to-generalized-mixed-model/41984>\
**Category:** Statistics\
**Tags:** question\
**Created:** [June 24, 2020, 2:35pm UTC](https://discourse.julialang.org/t/how-to-add-weights-parameter-to-generalized-mixed-model/41984 "2020-06-24T14:35:11Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![laut](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laut/32/15651_2.png) [@laut](https://discourse.julialang.org/u/laut)\
**Post date:** [June 24, 2020, 5:00pm UTC](https://discourse.julialang.org/t/how-to-add-weights-parameter-to-generalized-mixed-model/41984/12 "2020-06-24T17:00:09Z")

</div>

#facepalm

Thanks for your help/patience.

The /beta coefficients line up now.  
Followup: Any idea why the std.error, z-value, and p-values don’t match?

```julia
as.data.frame(Titanic) %>% 
    mutate(Age = relevel(x = Age, ref = "Adult"),
           Sex = relevel(x = Sex, ref = "Female")) %>%
    glmer(formula = Survived ~ 1 + Age * Sex + (1|Class), family = binomial, weights = Freq, nAGQ = 3, data = .) %>% 
    summary()

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/7/f772909860ffbde3269a0ce9daf1b1aa29ebfbfd.png)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-add-weights-parameter-to-generalized-mixed-model/41984)._
