使用Yags包的R中的GAM-GEE

时间:2018-08-13 16:40:10

标签: r statistics gam

我正在尝试使用Yags软件包在R中使用GAM_GEE,我一直在关注Pirotta的代码,可以在此处找到{http://www.int-res.com/articles/suppl/m436p257_supp/m436p257_supp1-code.r)。

我正在尝试逐步选择模型,但是在删除变量时获得的成功有限,我得到以下错误代码。

Error in as.vector(x) : no method for coercing this S4 class to a vector

这是我的完整模型:

 fit2<-yags(Species ~ bs(Lat,knots=mean(Lat))+bs(Lon,knots=mean(Lon))+bs(Depth,knots=mean(Depth))
       +bs(Slope,knots=mean(Slope))+Aspect+SST+bs(Distance,knots=mean(Distance))+Side,
       family=binomial,corstruct="independence", id=Tow)

我可以成功删除Depth,但没有错误代码,则不能成功删除模型中的任何其他变量。

我尝试将所有变量转换为因子,字符和整数,但均未成功。

这是我第一次使用此分析

0 个答案:

没有答案