Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sz basis smooths can have n factors and the terms for the smooth can be in any order #208

Closed
2 tasks done
gavinsimpson opened this issue Feb 10, 2023 · 0 comments
Closed
2 tasks done
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@gavinsimpson
Copy link
Owner

gavinsimpson commented Feb 10, 2023

Because of a misreading of the {mgcv} help for the sz basis, {gratia}'s current handling of sz basis smooths assumes:

  1. that there is a single factor, and
  2. that the factor is the first term

(Actually I knew about 1. being wrong but I wanted to get the simplest option implemented first.)

Putting the factor first is simply annoying when fitting or comparing other models with group-level smooths as they all want the continuous covariate(s) first (think fs smooths, but also this is how factor-by smooths work too). And {mgcv} doesn't actually require the factor to be first.

Fix problem 2. and, while doing so, allow for gratia to handle 1. also.

  • allow the first covariate mentioned in the smooth to be the continuous term
  • allow for more than one factor
@gavinsimpson gavinsimpson added bug Something isn't working enhancement New feature or request labels Feb 10, 2023
@gavinsimpson gavinsimpson added this to the 0.9 milestone Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant