JuliaStats / MixedModels.jl

A Julia package for fitting (statistical) mixed-effects models
http://juliastats.org/MixedModels.jl/stable
MIT License
405 stars 48 forks source link

Need to adjust parametricbootstrap display for GLMMs w/o scale parameter #741

Closed dmbates closed 6 months ago

dmbates commented 8 months ago

A Bernoulli/binomial/Poisson GLMM does not have a scale parameter and parametricbootstrap produces a result in which the σ values are a vector of missing. The display or storage should be modified to take this into account.

Reproduce with

using MixedModels, TypedTables
contra = MixedModels.dataset(:contra)
contra = Table(contra, ch = contra.livch .≠ "0")
gm1 = let f = @formula use ~ 1 + age * ch + age^2 + urban + (1| dist & urban)
         fit(MixedModel, f, contra, Bernoulli(); nAGQ = 9)
       end
gm1samp = parametricbootstrap(2_000, gm1);
julia> typeof(gm1.σ)
Missing

julia> typeof(gm1samp.σ)
Vector{Missing} (alias for Array{Missing, 1})

Pretty much anything you try to do with gm1samp will throw an error.

palday commented 8 months ago

It might be technically breaking to not store the sigma parameter, but we can definitely improve display and handling of it.

dmbates commented 8 months ago

Agreed. Do you want me to look at it or are you willing to do so? Assign it to me if you don't have time.

palday commented 8 months ago

If it can wait a few days, I can do it. If you have big plans for it this week, then you should do it. :smile: