three_term_model <- gam(y~x0+s(x1)+s(x2)+x3, data=gam_data) three_smooth_model <- gam(y~x0+s(x1)+s(x2)+s(x3), data=gam_data) three_smooth_summary <- summary(three_smooth_model) print(three_smooth_summary$p.table) print(three_smooth_summary$s.table) plot(three_smooth_model,page=1) # edf = 1 therefore term is linear. anova(two_smooth_model,three_term_model,test="Chisq") # term x3 is not significant