作者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)
推 ccwang002:他說有些變數找不到,所以能不能提供比較完整的程式碼? 12/26 02:45
→ diplazium:你應該有些變數的unique值少於10-1=9個(預設參數k=10) 12/26 10:52
→ diplazium:第二個問題我就不知道了 12/26 10:53
推 xiaoing:是否要考慮s()函數裡面的k值? 12/26 14:27
→ tai34:我發現我的其中一個變數值只有9項,改了該變數的 k 值就可以 12/26 17:16
→ tai34:用了! 謝謝 c大、d大、以及 x 大! 然後要繼續處理下一個錯誤 12/26 17:17
→ tai34:了.... 12/26 17:18
→ tai34:請問怎麼決定 k 值是多少啊? 是自由度嗎? 12/27 16:17
推 xiaoing:我也跟樓上有相同的困惑,懇求高手解答!!! 12/27 17:29