rdghy_2009 拟合广义可加模型,解释变量中有分类变量,R结果显示Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) : A term has fewer unique covariate combinations than specified maximum degrees ,什么意思啊? 期待指点
Cloud2016 rdghy_2009 是论坛的老人了,咋不按新手须知给点背景介绍呢?关于数据、模型、代码都没有,只有一个错误消息,你准备让大家怎么破?我虽然对 GAM 模型和 mgcv 包略有了解,但看到这个问题,也犹豫一会,要不要回你。
rdghy_2009 呵呵,谢谢提醒,因变量为五水平的定序变量,自变量为年龄和性别, y<-o2$Q9 x1<-factor(x1) w3=gam_model <- gam(ys(x1)+s(x2),k=3, data =o2,method="REML") 结果显示: Error in data[[txt]] : 下标出界 期待指点