## Formula for a model with 2 fixed effects (x1 and x2) and a random
## intercept.
formula <- y ~ fe(x1 + x2) + re(1|id)
## Formula for a model with 1 fixed effect and a varying coefficient term
## with 2 moderators and 2 varying coefficient predictors. 'tvcm' will
## fit one common partition for the two moderated predictors 'x2' and
## 'x3'.
formula <- y ~ x1 + vc(z1, z1, by = x2 + x3, intercept = TRUE)
## Similar formula as above, but the predictors 'x2' and 'x3' have
## separate 'vc' terms. 'tvcm' will fit a separate partition for each
## 'vc' term
formula <- y ~ x1 + vc(z1, z1, by = x2 + x3, intercept = TRUE)
Run the code above in your browser using DataLab