[R-sig-ME] How to generate the equation of a GLMM?

Marina Pastor m@r|n@p@@tor @end|ng |rom |cm@c@|c@e@
Thu Dec 10 13:13:53 CET 2020


Thank you for the answer!
Apparently, the package “equatiomatic” does not accept mixed models. I  
did it with a glm, and applied the same structure for the glmer.bn  
with the coefficients of glmer.nb.
Then the result of the second example is:
Ephyra = -2.32 - 0.24(LightNight) + 1.47(Depth25m) + 1.07(LightNight x  
Depth25m) + offset(LogFilteredVolume) + ai
ai  ~ N(0, 1.372)
Could you tell me if is any information lacking to write the equation?
Yes, I am using the Log of the filtered volume as offset, thank you  
for your suggestion.
Cheers and thanks again,
Marina

Ben Bolker <bbolker using gmail.com> escribió:

> On 12/8/20 9:43 AM, Marina Pastor wrote:
>> Dear all,
>> I have to obtain the equation of a GLMM. I hoped to do it using the  
>> equatiomatic package, but it does not generate the equations for  
>> GLMM. Any other package to generate it?
>> I have two different GLMMs:
>> - For the first one (glmer.nb(Zooplankton ~ offset(filtered volume)  
>> + Temp + Sal + (1|stationNumber), data)) I think I managed to  
>> generate the equation manually (the coefficients are below), but  
>> what I should add as offset?
>> The equation: Y = 20.57 + 1.17 Temp -2.12 Sal +ai
>> ai ~ N(0, 1.32^2)
>> The coefficients:
>> Random effects:
>>  Groups        Name        Variance Std.Dev.
>>  stationNumber (Intercept) 1.702    1.324
>> Number of obs: 72, groups:  stationNumber, 72
>>
>> Fixed effects:
>>             Estimate Std. Error z value Pr(>|z|)
>> (Intercept)  20.5694    12.6924   2.182  0.00146 **
>> Temp          1.1716     0.2222   3.823 2.41e-05 ***
>> Sal          -2.1222     0.3710  -6.450 4.04e-05 ***
>> ---
>> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
>   (1) You could always run the same model with lmer() and run the  
> results through equatiomatic: that would tell you the equation of  
> the *linear predictor*. You could combine that with the results of  
> running equatiomatic on the model _without_ the random effect in  
> MASS::glm.nb and running that through equatiomatic as well.
>
>   (2) the offset is simply added to the RHS of the equation
>   (3) You almost certainly want to be using log(filtered volume)  
> rather than filtered volume itself as your offset.
>
>   Suggestion 1 should work for your other equation as well ...
>>
>>
>> - For the other GLMM (glmer.nb(Zooplankton ~ offset(filtered  
>> volume) + Light * Depth + (1|stationNumber), data)), how can I  
>> generate the equation? What to put as offset?
>> The coefficients are:
>> Random effects:
>>  Groups  Name        Variance Std.Dev.
>>  Station (Intercept) 1.865    1.365
>> Number of obs: 102, groups:  Station, 51
>>
>> Fixed effects:
>>                             Estimate Std. Error  z value Pr(>|z|)
>> (Intercept)                 -2.31986    0.53036 -32.290  < 2e-7 ***
>> Light_2N                    -0.24249    0.03018   -2.852 0.000117 ***
>> FIni_Depth_Net_m25           1.46617    0.35821    0.301 0.193128
>> Light_2N:FIni_Depth_Net_m25  1.07005    0.66873    1.095 0.001965 **
>> ---
>> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>>
>>
>> Many thanks in advance for your time and help,
>> All the best!
>> Marina Pastor
>>
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


-- 
Marina Pastor
PhD Student
Marine biology and oceanography department
Institut de Ciències del Mar (ICM-CSIC)
Spanish National Research Council
Passeig Marítim de la Barceloneta 37-49, E-08003 Barcelona, Catalonia, Spain
Phone: +34 932309500 (ext. 1113)
E-mail: marinapastor using icm.csic.es



More information about the R-sig-mixed-models mailing list