You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, great work so far!
I know this is a minor issue and I would accept the argument, that it is strictly speaking not the scope of broom.mixed, but tidy(effects = "ran_pars") does not seem to be extracting the residual variance of a glmmTMB object when no random effects are present in the model so that the model is actually not mixed, but rather a simple linear model with fixed effects only:
library(broom.mixed)
library(glmmTMB)
library(tidyverse)
dat<-agridat::mcconway.turnip %>% mutate(unit=1:n() %>% as.factor)
# random block effectmixed.mod<- glmmTMB(formula=yield~gen+ (1|block),
dispformula=~1, # defaultREML=TRUE, data=dat)
# fixed block effectfixed.mod<- glmmTMB(formula=yield~gen+block,
dispformula=~1, # defaultREML=TRUE, data=dat)
# fixed block effect, but error variance forced in G-side as random unit effectpseudomixed.mod<- glmmTMB(formula=yield~gen+block+ (1|unit), # mimic error variancedispformula=~0, # fix original error variance to 0REML=TRUE, data=dat)
mixed.mod %>% tidy(effects="ran_pars", scales="vcov") # block and residual variance#> # A tibble: 2 x 5#> effect component group term estimate#> <chr> <chr> <chr> <chr> <dbl>#> 1 ran_pars cond block var__(Intercept) 1.98#> 2 ran_pars cond Residual var__Observation 22.9fixed.mod %>% tidy(effects="ran_pars", scales="vcov") # empty tibble#> # A tibble: 0 x 0pseudomixed.mod %>% tidy(effects="ran_pars", scales="vcov") # "residual" variance#> # A tibble: 1 x 5#> effect component group term estimate#> <chr> <chr> <chr> <chr> <dbl>#> 1 ran_pars cond unit var__(Intercept) 22.9
Created on 2020-12-08 by the reprex package (v0.3.0.9001)
broom.mixed_0.2.6
glmmTMB_1.0.2.1
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi there, great work so far!
I know this is a minor issue and I would accept the argument, that it is strictly speaking not the scope of
broom.mixed
, buttidy(effects = "ran_pars")
does not seem to be extracting the residual variance of aglmmTMB
object when no random effects are present in the model so that the model is actually not mixed, but rather a simple linear model with fixed effects only:Created on 2020-12-08 by the reprex package (v0.3.0.9001)
broom.mixed_0.2.6
glmmTMB_1.0.2.1
Thanks in advance!
The text was updated successfully, but these errors were encountered: