Skip to contents

This function allows models to be defined using a flexible formula interface that supports fixed effects, random effects (using lme4 syntax). Note that the returned fixed effects design matrix is sparse and so the index supplied is required to link observations to the appropriate design matrix row.

Usage

enw_formula(formula, data, sparse = TRUE)

Arguments

formula

A model formula that may use standard fixed effects, random effects using lme4 syntax (see re()), and random walks defined using the rw() helper function.

data

A data.frame of observations. It must include all variables used in the supplied formula.

sparse

Logical, defaults to TRUE. Should the fixed effects design matrix be sparely defined.

Value

A list containing the following:

  • formula: The user supplied formula

  • parsed_formula: The formula as parsed by parse_formula()

  • extended_formula: The flattened version of the formula with both user supplied terms and terms added for the user supplied complex model components.

  • fixed: A list containing the fixed effect formula, sparse design matrix, and the index linking the design matrix with observations.

  • random: A list containing the random effect formula, sparse design matrix, and the index linking the design matrix with random effects.

See also

Functions used to help convert formulas into model designs as_string_formula(), construct_re(), construct_rw(), enw_manual_formula(), parse_formula(), remove_rw_terms(), re(), rw_terms(), rw(), split_formula_to_terms()

Examples

# Use meta data for references dates from the Germany COVID-19
# hospitalisation data.
obs <- enw_filter_report_dates(
  germany_covid19_hosp[location == "DE"],
  remove_days = 40
)
obs <- enw_filter_reference_dates(obs, include_days = 40)
pobs <- enw_preprocess_data(
  obs, by = c("age_group", "location"), max_delay = 20
  )
data <- pobs$metareference[[1]]

# Model with fixed effects for age group
enw_formula(~ 1 + age_group, data)
#> $formula
#> [1] "~1 + age_group"
#> 
#> $parsed_formula
#> $parsed_formula$fixed
#> [1] "1"         "age_group"
#> 
#> $parsed_formula$random
#> NULL
#> 
#> $parsed_formula$rw
#> character(0)
#> 
#> 
#> $expanded_formula
#> [1] "~1 + age_group"
#> 
#> $fixed
#> $fixed$formula
#> [1] "~1 + age_group"
#> 
#> $fixed$design
#>     (Intercept) age_group00+ age_group05-14 age_group15-34 age_group35-59
#> 1             1            1              0              0              0
#> 42            1            0              0              0              0
#> 83            1            0              1              0              0
#> 124           1            0              0              1              0
#> 165           1            0              0              0              1
#> 206           1            0              0              0              0
#> 247           1            0              0              0              0
#>     age_group60-79 age_group80+
#> 1                0            0
#> 42               0            0
#> 83               0            0
#> 124              0            0
#> 165              0            0
#> 206              1            0
#> 247              0            1
#> 
#> $fixed$index
#>   [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#>  [38] 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
#>  [75] 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
#> [112] 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
#> [149] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
#> [186] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
#> [223] 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7
#> [260] 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
#> 
#> 
#> $random
#> $random$formula
#> [1] "~1"
#> 
#> $random$design
#>   (Intercept)
#> 1           1
#> 2           1
#> 3           1
#> 4           1
#> 5           1
#> 6           1
#> attr(,"assign")
#> [1] 0
#> 
#> $random$index
#> [1] 1 2 3 4 5 6
#> 
#> 
#> attr(,"class")
#> [1] "enw_formula" "list"       

# Model with random effects for age group
enw_formula(~ 1 + (1 | age_group), data)
#> $formula
#> [1] "~1 + (1 | age_group)"
#> 
#> $parsed_formula
#> $parsed_formula$fixed
#> [1] "1"
#> 
#> $parsed_formula$random
#> $parsed_formula$random[[1]]
#> 1 | age_group
#> 
#> 
#> $parsed_formula$rw
#> character(0)
#> 
#> 
#> $expanded_formula
#> [1] "~1 + age_group"
#> 
#> $fixed
#> $fixed$formula
#> [1] "~1 + age_group"
#> 
#> $fixed$design
#>     (Intercept) age_group00-04 age_group00+ age_group05-14 age_group15-34
#> 1             1              0            1              0              0
#> 42            1              1            0              0              0
#> 83            1              0            0              1              0
#> 124           1              0            0              0              1
#> 165           1              0            0              0              0
#> 206           1              0            0              0              0
#> 247           1              0            0              0              0
#>     age_group35-59 age_group60-79 age_group80+
#> 1                0              0            0
#> 42               0              0            0
#> 83               0              0            0
#> 124              0              0            0
#> 165              1              0            0
#> 206              0              1            0
#> 247              0              0            1
#> 
#> $fixed$index
#>   [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#>  [38] 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
#>  [75] 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
#> [112] 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
#> [149] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
#> [186] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
#> [223] 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7
#> [260] 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
#> 
#> 
#> $random
#> $random$formula
#> [1] "~0 + fixed + age_group"
#> 
#> $random$design
#>   fixed age_group
#> 1     0         1
#> 2     0         1
#> 3     0         1
#> 4     0         1
#> 5     0         1
#> 6     0         1
#> 7     0         1
#> attr(,"assign")
#> [1] 1 2
#> 
#> $random$index
#> [1] 1 2 3 4 5 6 7
#> 
#> 
#> attr(,"class")
#> [1] "enw_formula" "list"       

# Model with a random effect for age group and a random walk
enw_formula(~ 1 + (1 | age_group) + rw(week), data)
#> $formula
#> [1] "~1 + (1 | age_group) + rw(week)"
#> 
#> $parsed_formula
#> $parsed_formula$fixed
#> [1] "1"
#> 
#> $parsed_formula$random
#> $parsed_formula$random[[1]]
#> 1 | age_group
#> 
#> 
#> $parsed_formula$rw
#> [1] "rw(week)"
#> 
#> 
#> $expanded_formula
#> [1] "~1 + age_group + cweek1 + cweek2 + cweek3 + cweek4 + cweek5"
#> 
#> $fixed
#> $fixed$formula
#> [1] "~1 + age_group + cweek1 + cweek2 + cweek3 + cweek4 + cweek5"
#> 
#> $fixed$design
#>     (Intercept) age_group00-04 age_group00+ age_group05-14 age_group15-34
#> 1             1              0            1              0              0
#> 8             1              0            1              0              0
#> 15            1              0            1              0              0
#> 22            1              0            1              0              0
#> 29            1              0            1              0              0
#> 36            1              0            1              0              0
#> 42            1              1            0              0              0
#> 49            1              1            0              0              0
#> 56            1              1            0              0              0
#> 63            1              1            0              0              0
#> 70            1              1            0              0              0
#> 77            1              1            0              0              0
#> 83            1              0            0              1              0
#> 90            1              0            0              1              0
#> 97            1              0            0              1              0
#> 104           1              0            0              1              0
#> 111           1              0            0              1              0
#> 118           1              0            0              1              0
#> 124           1              0            0              0              1
#> 131           1              0            0              0              1
#> 138           1              0            0              0              1
#> 145           1              0            0              0              1
#> 152           1              0            0              0              1
#> 159           1              0            0              0              1
#> 165           1              0            0              0              0
#> 172           1              0            0              0              0
#> 179           1              0            0              0              0
#> 186           1              0            0              0              0
#> 193           1              0            0              0              0
#> 200           1              0            0              0              0
#> 206           1              0            0              0              0
#> 213           1              0            0              0              0
#> 220           1              0            0              0              0
#> 227           1              0            0              0              0
#> 234           1              0            0              0              0
#> 241           1              0            0              0              0
#> 247           1              0            0              0              0
#> 254           1              0            0              0              0
#> 261           1              0            0              0              0
#> 268           1              0            0              0              0
#> 275           1              0            0              0              0
#> 282           1              0            0              0              0
#>     age_group35-59 age_group60-79 age_group80+ cweek1 cweek2 cweek3 cweek4
#> 1                0              0            0      0      0      0      0
#> 8                0              0            0      1      0      0      0
#> 15               0              0            0      1      1      0      0
#> 22               0              0            0      1      1      1      0
#> 29               0              0            0      1      1      1      1
#> 36               0              0            0      1      1      1      1
#> 42               0              0            0      0      0      0      0
#> 49               0              0            0      1      0      0      0
#> 56               0              0            0      1      1      0      0
#> 63               0              0            0      1      1      1      0
#> 70               0              0            0      1      1      1      1
#> 77               0              0            0      1      1      1      1
#> 83               0              0            0      0      0      0      0
#> 90               0              0            0      1      0      0      0
#> 97               0              0            0      1      1      0      0
#> 104              0              0            0      1      1      1      0
#> 111              0              0            0      1      1      1      1
#> 118              0              0            0      1      1      1      1
#> 124              0              0            0      0      0      0      0
#> 131              0              0            0      1      0      0      0
#> 138              0              0            0      1      1      0      0
#> 145              0              0            0      1      1      1      0
#> 152              0              0            0      1      1      1      1
#> 159              0              0            0      1      1      1      1
#> 165              1              0            0      0      0      0      0
#> 172              1              0            0      1      0      0      0
#> 179              1              0            0      1      1      0      0
#> 186              1              0            0      1      1      1      0
#> 193              1              0            0      1      1      1      1
#> 200              1              0            0      1      1      1      1
#> 206              0              1            0      0      0      0      0
#> 213              0              1            0      1      0      0      0
#> 220              0              1            0      1      1      0      0
#> 227              0              1            0      1      1      1      0
#> 234              0              1            0      1      1      1      1
#> 241              0              1            0      1      1      1      1
#> 247              0              0            1      0      0      0      0
#> 254              0              0            1      1      0      0      0
#> 261              0              0            1      1      1      0      0
#> 268              0              0            1      1      1      1      0
#> 275              0              0            1      1      1      1      1
#> 282              0              0            1      1      1      1      1
#>     cweek5
#> 1        0
#> 8        0
#> 15       0
#> 22       0
#> 29       0
#> 36       1
#> 42       0
#> 49       0
#> 56       0
#> 63       0
#> 70       0
#> 77       1
#> 83       0
#> 90       0
#> 97       0
#> 104      0
#> 111      0
#> 118      1
#> 124      0
#> 131      0
#> 138      0
#> 145      0
#> 152      0
#> 159      1
#> 165      0
#> 172      0
#> 179      0
#> 186      0
#> 193      0
#> 200      1
#> 206      0
#> 213      0
#> 220      0
#> 227      0
#> 234      0
#> 241      1
#> 247      0
#> 254      0
#> 261      0
#> 268      0
#> 275      0
#> 282      1
#> 
#> $fixed$index
#>   [1]  1  1  1  1  1  1  1  2  2  2  2  2  2  2  3  3  3  3  3  3  3  4  4  4  4
#>  [26]  4  4  4  5  5  5  5  5  5  5  6  6  6  6  6  6  7  7  7  7  7  7  7  8  8
#>  [51]  8  8  8  8  8  9  9  9  9  9  9  9 10 10 10 10 10 10 10 11 11 11 11 11 11
#>  [76] 11 12 12 12 12 12 12 13 13 13 13 13 13 13 14 14 14 14 14 14 14 15 15 15 15
#> [101] 15 15 15 16 16 16 16 16 16 16 17 17 17 17 17 17 17 18 18 18 18 18 18 19 19
#> [126] 19 19 19 19 19 20 20 20 20 20 20 20 21 21 21 21 21 21 21 22 22 22 22 22 22
#> [151] 22 23 23 23 23 23 23 23 24 24 24 24 24 24 25 25 25 25 25 25 25 26 26 26 26
#> [176] 26 26 26 27 27 27 27 27 27 27 28 28 28 28 28 28 28 29 29 29 29 29 29 29 30
#> [201] 30 30 30 30 30 31 31 31 31 31 31 31 32 32 32 32 32 32 32 33 33 33 33 33 33
#> [226] 33 34 34 34 34 34 34 34 35 35 35 35 35 35 35 36 36 36 36 36 36 37 37 37 37
#> [251] 37 37 37 38 38 38 38 38 38 38 39 39 39 39 39 39 39 40 40 40 40 40 40 40 41
#> [276] 41 41 41 41 41 41 42 42 42 42 42 42
#> 
#> 
#> $random
#> $random$formula
#> [1] "~0 + fixed + age_group + rw__week"
#> 
#> $random$design
#>    fixed age_group rw__week
#> 1      0         1        0
#> 2      0         1        0
#> 3      0         1        0
#> 4      0         1        0
#> 5      0         1        0
#> 6      0         1        0
#> 7      0         1        0
#> 8      0         0        1
#> 9      0         0        1
#> 10     0         0        1
#> 11     0         0        1
#> 12     0         0        1
#> attr(,"assign")
#> [1] 1 2 3
#> 
#> $random$index
#>  [1]  1  2  3  4  5  6  7  8  9 10 11 12
#> 
#> 
#> attr(,"class")
#> [1] "enw_formula" "list"       

# Model defined without a sparse fixed effects design matrix
enw_formula(~1, data[1:20, ])
#> $formula
#> [1] "~1"
#> 
#> $parsed_formula
#> $parsed_formula$fixed
#> [1] "1"
#> 
#> $parsed_formula$random
#> NULL
#> 
#> $parsed_formula$rw
#> character(0)
#> 
#> 
#> $expanded_formula
#> [1] "~1"
#> 
#> $fixed
#> $fixed$formula
#> [1] "~1"
#> 
#> $fixed$design
#>   (Intercept)
#> 1           1
#> 
#> $fixed$index
#>  [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> 
#> 
#> $random
#> $random$formula
#> [1] "~1"
#> 
#> $random$design
#>      (Intercept)
#> attr(,"assign")
#> [1] 0
#> 
#> $random$index
#> integer(0)
#> 
#> 
#> attr(,"class")
#> [1] "enw_formula" "list"       

# Model using an interaction in the right hand side of a random effect
# to specify an independent random effect per strata.
enw_formula(~ (1 + day | week:month), data = data)
#> $formula
#> [1] "~(1 + day | week:month)"
#> 
#> $parsed_formula
#> $parsed_formula$fixed
#> [1] "1"
#> 
#> $parsed_formula$random
#> $parsed_formula$random[[1]]
#> 1 + day | week:month
#> 
#> 
#> $parsed_formula$rw
#> character(0)
#> 
#> 
#> $expanded_formula
#> [1] "~1 + week:month + day:week:month"
#> 
#> $fixed
#> $fixed$formula
#> [1] "~1 + week:month + day:week:month"
#> 
#> $fixed$design
#>    (Intercept) week0:month0 week1:month0 week2:month0 week3:month0 week4:month0
#> 1            1            1            0            0            0            0
#> 2            1            1            0            0            0            0
#> 3            1            1            0            0            0            0
#> 4            1            1            0            0            0            0
#> 5            1            1            0            0            0            0
#> 6            1            1            0            0            0            0
#> 7            1            1            0            0            0            0
#> 8            1            0            1            0            0            0
#> 9            1            0            1            0            0            0
#> 10           1            0            1            0            0            0
#> 11           1            0            1            0            0            0
#> 12           1            0            1            0            0            0
#> 13           1            0            1            0            0            0
#> 14           1            0            1            0            0            0
#> 15           1            0            0            1            0            0
#> 16           1            0            0            1            0            0
#> 17           1            0            0            1            0            0
#> 18           1            0            0            1            0            0
#> 19           1            0            0            1            0            0
#> 20           1            0            0            1            0            0
#> 21           1            0            0            1            0            0
#> 22           1            0            0            0            1            0
#> 23           1            0            0            0            1            0
#> 24           1            0            0            0            1            0
#> 25           1            0            0            0            1            0
#> 26           1            0            0            0            1            0
#> 27           1            0            0            0            1            0
#> 28           1            0            0            0            1            0
#> 29           1            0            0            0            0            1
#> 30           1            0            0            0            0            1
#> 31           1            0            0            0            0            1
#> 32           1            0            0            0            0            0
#> 33           1            0            0            0            0            0
#> 34           1            0            0            0            0            0
#> 35           1            0            0            0            0            0
#> 36           1            0            0            0            0            0
#> 37           1            0            0            0            0            0
#> 38           1            0            0            0            0            0
#> 39           1            0            0            0            0            0
#> 40           1            0            0            0            0            0
#> 41           1            0            0            0            0            0
#>    week5:month0 week0:month1 week1:month1 week2:month1 week3:month1
#> 1             0            0            0            0            0
#> 2             0            0            0            0            0
#> 3             0            0            0            0            0
#> 4             0            0            0            0            0
#> 5             0            0            0            0            0
#> 6             0            0            0            0            0
#> 7             0            0            0            0            0
#> 8             0            0            0            0            0
#> 9             0            0            0            0            0
#> 10            0            0            0            0            0
#> 11            0            0            0            0            0
#> 12            0            0            0            0            0
#> 13            0            0            0            0            0
#> 14            0            0            0            0            0
#> 15            0            0            0            0            0
#> 16            0            0            0            0            0
#> 17            0            0            0            0            0
#> 18            0            0            0            0            0
#> 19            0            0            0            0            0
#> 20            0            0            0            0            0
#> 21            0            0            0            0            0
#> 22            0            0            0            0            0
#> 23            0            0            0            0            0
#> 24            0            0            0            0            0
#> 25            0            0            0            0            0
#> 26            0            0            0            0            0
#> 27            0            0            0            0            0
#> 28            0            0            0            0            0
#> 29            0            0            0            0            0
#> 30            0            0            0            0            0
#> 31            0            0            0            0            0
#> 32            0            0            0            0            0
#> 33            0            0            0            0            0
#> 34            0            0            0            0            0
#> 35            0            0            0            0            0
#> 36            0            0            0            0            0
#> 37            0            0            0            0            0
#> 38            0            0            0            0            0
#> 39            0            0            0            0            0
#> 40            0            0            0            0            0
#> 41            0            0            0            0            0
#>    week4:month1 week5:month1 week0:month0:day week1:month0:day week2:month0:day
#> 1             0            0                0                0                0
#> 2             0            0                1                0                0
#> 3             0            0                2                0                0
#> 4             0            0                3                0                0
#> 5             0            0                4                0                0
#> 6             0            0                5                0                0
#> 7             0            0                6                0                0
#> 8             0            0                0                7                0
#> 9             0            0                0                8                0
#> 10            0            0                0                9                0
#> 11            0            0                0               10                0
#> 12            0            0                0               11                0
#> 13            0            0                0               12                0
#> 14            0            0                0               13                0
#> 15            0            0                0                0               14
#> 16            0            0                0                0               15
#> 17            0            0                0                0               16
#> 18            0            0                0                0               17
#> 19            0            0                0                0               18
#> 20            0            0                0                0               19
#> 21            0            0                0                0               20
#> 22            0            0                0                0                0
#> 23            0            0                0                0                0
#> 24            0            0                0                0                0
#> 25            0            0                0                0                0
#> 26            0            0                0                0                0
#> 27            0            0                0                0                0
#> 28            0            0                0                0                0
#> 29            0            0                0                0                0
#> 30            0            0                0                0                0
#> 31            0            0                0                0                0
#> 32            1            0                0                0                0
#> 33            1            0                0                0                0
#> 34            1            0                0                0                0
#> 35            1            0                0                0                0
#> 36            0            1                0                0                0
#> 37            0            1                0                0                0
#> 38            0            1                0                0                0
#> 39            0            1                0                0                0
#> 40            0            1                0                0                0
#> 41            0            1                0                0                0
#>    week3:month0:day week4:month0:day week5:month0:day week0:month1:day
#> 1                 0                0                0                0
#> 2                 0                0                0                0
#> 3                 0                0                0                0
#> 4                 0                0                0                0
#> 5                 0                0                0                0
#> 6                 0                0                0                0
#> 7                 0                0                0                0
#> 8                 0                0                0                0
#> 9                 0                0                0                0
#> 10                0                0                0                0
#> 11                0                0                0                0
#> 12                0                0                0                0
#> 13                0                0                0                0
#> 14                0                0                0                0
#> 15                0                0                0                0
#> 16                0                0                0                0
#> 17                0                0                0                0
#> 18                0                0                0                0
#> 19                0                0                0                0
#> 20                0                0                0                0
#> 21                0                0                0                0
#> 22               21                0                0                0
#> 23               22                0                0                0
#> 24               23                0                0                0
#> 25               24                0                0                0
#> 26               25                0                0                0
#> 27               26                0                0                0
#> 28               27                0                0                0
#> 29                0               28                0                0
#> 30                0               29                0                0
#> 31                0               30                0                0
#> 32                0                0                0                0
#> 33                0                0                0                0
#> 34                0                0                0                0
#> 35                0                0                0                0
#> 36                0                0                0                0
#> 37                0                0                0                0
#> 38                0                0                0                0
#> 39                0                0                0                0
#> 40                0                0                0                0
#> 41                0                0                0                0
#>    week1:month1:day week2:month1:day week3:month1:day week4:month1:day
#> 1                 0                0                0                0
#> 2                 0                0                0                0
#> 3                 0                0                0                0
#> 4                 0                0                0                0
#> 5                 0                0                0                0
#> 6                 0                0                0                0
#> 7                 0                0                0                0
#> 8                 0                0                0                0
#> 9                 0                0                0                0
#> 10                0                0                0                0
#> 11                0                0                0                0
#> 12                0                0                0                0
#> 13                0                0                0                0
#> 14                0                0                0                0
#> 15                0                0                0                0
#> 16                0                0                0                0
#> 17                0                0                0                0
#> 18                0                0                0                0
#> 19                0                0                0                0
#> 20                0                0                0                0
#> 21                0                0                0                0
#> 22                0                0                0                0
#> 23                0                0                0                0
#> 24                0                0                0                0
#> 25                0                0                0                0
#> 26                0                0                0                0
#> 27                0                0                0                0
#> 28                0                0                0                0
#> 29                0                0                0                0
#> 30                0                0                0                0
#> 31                0                0                0                0
#> 32                0                0                0               31
#> 33                0                0                0               32
#> 34                0                0                0               33
#> 35                0                0                0               34
#> 36                0                0                0                0
#> 37                0                0                0                0
#> 38                0                0                0                0
#> 39                0                0                0                0
#> 40                0                0                0                0
#> 41                0                0                0                0
#>    week5:month1:day
#> 1                 0
#> 2                 0
#> 3                 0
#> 4                 0
#> 5                 0
#> 6                 0
#> 7                 0
#> 8                 0
#> 9                 0
#> 10                0
#> 11                0
#> 12                0
#> 13                0
#> 14                0
#> 15                0
#> 16                0
#> 17                0
#> 18                0
#> 19                0
#> 20                0
#> 21                0
#> 22                0
#> 23                0
#> 24                0
#> 25                0
#> 26                0
#> 27                0
#> 28                0
#> 29                0
#> 30                0
#> 31                0
#> 32                0
#> 33                0
#> 34                0
#> 35                0
#> 36               35
#> 37               36
#> 38               37
#> 39               38
#> 40               39
#> 41               40
#> 
#> $fixed$index
#>   [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#>  [26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41  1  2  3  4  5  6  7  8  9
#>  [51] 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#>  [76] 35 36 37 38 39 40 41  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18
#> [101] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41  1  2
#> [126]  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#> [151] 28 29 30 31 32 33 34 35 36 37 38 39 40 41  1  2  3  4  5  6  7  8  9 10 11
#> [176] 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#> [201] 37 38 39 40 41  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
#> [226] 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41  1  2  3  4
#> [251]  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#> [276] 30 31 32 33 34 35 36 37 38 39 40 41
#> 
#> 
#> $random
#> $random$formula
#> [1] "~0 + fixed + week__month0 + week__month1 + day__week__month0 + day__week__month1"
#> 
#> $random$design
#>    fixed week__month0 week__month1 day__week__month0 day__week__month1
#> 1      0            1            0                 0                 0
#> 2      0            1            0                 0                 0
#> 3      0            1            0                 0                 0
#> 4      0            1            0                 0                 0
#> 5      0            1            0                 0                 0
#> 6      0            1            0                 0                 0
#> 7      0            0            1                 0                 0
#> 8      0            0            1                 0                 0
#> 9      0            0            1                 0                 0
#> 10     0            0            1                 0                 0
#> 11     0            0            1                 0                 0
#> 12     0            0            1                 0                 0
#> 13     0            0            0                 1                 0
#> 14     0            0            0                 1                 0
#> 15     0            0            0                 1                 0
#> 16     0            0            0                 1                 0
#> 17     0            0            0                 1                 0
#> 18     0            0            0                 1                 0
#> 19     0            0            0                 0                 1
#> 20     0            0            0                 0                 1
#> 21     0            0            0                 0                 1
#> 22     0            0            0                 0                 1
#> 23     0            0            0                 0                 1
#> 24     0            0            0                 0                 1
#> attr(,"assign")
#> [1] 1 2 3 4 5
#> 
#> $random$index
#>  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#> 
#> 
#> attr(,"class")
#> [1] "enw_formula" "list"