[问题] gam 跑出错误讯息

楼主: tai34 (tai)   2013-12-26 00:19:28
[软件熟悉度]:
新手(没写过程式,R 是我的第一次)
[问题叙述]:
我想利用 gam 跑我的资料并建立 model,我的资料有7个变量,gam内的选项皆用默认值。
但是出现以下错误:
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
Error in predict(model.bm, Data[, expl_var_names, drop = FALSE], on_0_1000 =
TRUE) :
error in evaluating the argument 'object' in selecting a method for
function 'predict': Error: object 'model.bm' not found
还有
Error in checkAtAssignment("BIOMOD.stored.array", "val", "NULL") :
assignment of an object of class “NULL” is not valid for @‘val’ in an
object of class “BIOMOD.stored.array”; is(value, "array") is not TRUE
请问是出现了什么错误? 我该如何修正我的资料?
谢谢各位 <(_ _)>
作者: ccwang002 (亮)   2013-02-26 02:45:00
他说有些变量找不到,所以能不能提供比较完整的程式码?
作者: diplazium (diplazium)   2013-02-26 10:52:00
你应该有些变量的unique值少于10-1=9个(默认参数k=10)第二个问题我就不知道了
作者: xiaoing (xiaoing)   2013-02-26 14:27:00
是否要考虑s()函数里面的k值?
楼主: tai34 (tai)   2013-02-26 17:16:00
我发现我的其中一个变量值只有9项,改了该变量的 k 值就可以用了! 谢谢 c大、d大、以及 x 大! 然后要继续处理下一个错误了....请问怎么决定 k 值是多少啊? 是自由度吗?
作者: xiaoing (xiaoing)   2013-02-27 17:29:00
我也跟楼上有相同的困惑,恳求高手解答!!!

Links booklink

Contact Us: admin [ a t ] ucptt.com