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

Error in smooth.construct.tp.smooth.spec when analyzing RNASEQ with covariate #1

Open
pamonlan opened this issue Jan 23, 2023 · 1 comment

Comments

@pamonlan
Copy link

I am trying to analyze an RNASEQ dataset using the NBAMSeq package in R, but I am encountering an error when trying to include a covariate with 5 different points. The error message I am receiving is: "Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) : A term has fewer unique covariate combinations than specified maximum degrees of freedom."

I am unsure of how to proceed and would appreciate any assistance in resolving this issue.

@hhp94
Copy link

hhp94 commented Jun 12, 2024

Hi @pamonlan, this is because the default basis function for {mgcv} (smooth.construct.tp.smooth.spec) sets k at 9 or something and your covariate only has 5 unique values. You can fix this by running design = ~ s(x, k = 4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants