View source: R/model_setup_helpers.R
term_by_factor | R Documentation |
Achieves "by" keyword functionality available in mgcv to enable by-factor smooths (Wood, 2017)!
term_by_factor(term, fact)
term |
A slope, splike_matrix, or intercept. |
fact |
A factor variable. |
See: Wood, S. N. (2017). Generalized Additive Models: An Introduction with R, Second Edition (2nd ed.). Chapman and Hall/CRC. See 'by' at: https://www.rdocumentation.org/packages/mgcv/versions/1.8-38/topics/s Code is based on: https://stats.stackexchange.com/questions/110472/how-exactly-is-the-sum-or-mean-centering-constraint-for-splines-also-w-r-t-g
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.