作者tai34 (tai)
看板R_Language
标题[问题] gam 跑出错误讯息
时间Thu Dec 26 00:19:28 2013
[软体熟悉度]:
新手(没写过程式,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
请问是出现了甚麽错误? 我该如何修正我的资料?
谢谢各位 <(_ _)>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 1.175.124.134
※ 编辑: tai34 来自: 1.175.124.134 (12/26 01:08)
1F:推 ccwang002:他说有些变数找不到,所以能不能提供比较完整的程式码? 12/26 02:45
2F:→ diplazium:你应该有些变数的unique值少於10-1=9个(预设参数k=10) 12/26 10:52
3F:→ diplazium:第二个问题我就不知道了 12/26 10:53
4F:推 xiaoing:是否要考虑s()函数里面的k值? 12/26 14:27
5F:→ tai34:我发现我的其中一个变数值只有9项,改了该变数的 k 值就可以 12/26 17:16
6F:→ tai34:用了! 谢谢 c大、d大、以及 x 大! 然後要继续处理下一个错误 12/26 17:17
7F:→ tai34:了.... 12/26 17:18
8F:→ tai34:请问怎麽决定 k 值是多少啊? 是自由度吗? 12/27 16:17
9F:推 xiaoing:我也跟楼上有相同的困惑,恳求高手解答!!! 12/27 17:29