Data fit using glmer from lme4 with family poisson to fit the dataset with the given formula.
Value
The model fit of the data with additional attributes offset, response and fit_fix. Offset and response are the same as in the input and fit_fix is the linear model of the fix effects.
For more details see the help vignette:
vignette("intro", package="attrib")
Examples
response <- "deaths_n"
fixef <- "ili_isoweekmean7_13_pr100 +
sin(2 * pi * (isoweek - 1) / 52) +
cos(2 * pi * (isoweek - 1) / 52)"
ranef <- " (ili_isoweekmean7_13_pr100| season)"
offset <- "log(pop_jan1_n)"
data <- attrib::data_fake_attrib_nation
fit_attrib(data = data, response = response, fixef = fixef, ranef = ranef, offset = offset)
#> boundary (singular) fit: see help('isSingular')
#> Generalized linear mixed model fit by maximum likelihood (Laplace
#> Approximation) [glmerMod]
#> Family: poisson ( log )
#> Formula: deaths_n ~ ili_isoweekmean7_13_pr100 + sin(2 * pi * (isoweek -
#> 1)/52) + cos(2 * pi * (isoweek - 1)/52) + offset(log(pop_jan1_n)) +
#> (ili_isoweekmean7_13_pr100 | season)
#> Data: data
#> AIC BIC logLik -2*log(L) df.resid
#> 5584.788 5615.256 -2785.394 5570.788 567
#> Random effects:
#> Groups Name Std.Dev. Corr
#> season (Intercept) 0.000000
#> ili_isoweekmean7_13_pr100 0.003655 NaN
#> Number of obs: 574, groups: season, 11
#> Fixed Effects:
#> (Intercept) ili_isoweekmean7_13_pr100
#> -8.800873 0.062265
#> sin(2 * pi * (isoweek - 1)/52) cos(2 * pi * (isoweek - 1)/52)
#> -0.005386 0.033551
#> optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings