1

Hello I have a question regarding gam.check() I understand that small p-values in the output of gam.check() indicate that residuals are not randomly distributed. This often means there are not enough basis functions. However, If I try to increase the basis functions I get the following error : 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

From reading on this error the solution is to reduce the k value. So my question is: Is it ok to leave the k number as high as it can be so I can run the model without getting the error above, even if the gam.check() function suggest I have to increase the number.

  • 1
    You seem to be misreading the error message: it is telling you that you requested too many knots, not too few. – whuber Sep 27 '19 at 17:54
  • 1
    Thanks for replying. The error is telling me I requested too many, I agree. What I am unsure of is the small p value on the output of the gam.check() According to function documentation: Basis dimension (k) checking results. Low p-value (k-index<1) may indicate that k is too low, especially if edf is close to k'. Thank you for your time! – Anastasia Sep 27 '19 at 18:04

0 Answers0