term_by_factor: Expand term by factor

View source: R/model_setup_helpers.R

term_by_factorR Documentation

Expand term by factor

Description

Achieves "by" keyword functionality available in mgcv to enable by-factor smooths (Wood, 2017)!

Usage

term_by_factor(term, fact)

Arguments

term

A slope, splike_matrix, or intercept.

fact

A factor variable.

Details

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


JoKra1/papss documentation built on June 15, 2022, 8:57 a.m.