討論串[問題][R]關於參數輸入的格式
共 4 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者sandows (仙道群)時間18年前 (2008/04/07 17:01), 編輯資訊
0
0
0
內容預覽:
可以直接用. D[,which(names(D)=="x5")]. 假設你每次找出來最好的變數暫存在 temp2 裡. temp1 <- numeric(20). temp2 <- [x1,x3,x7....]. for (i in 1:20){. temp1[i] <- which(names(D

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者horby (horby)時間18年前 (2008/04/07 15:37), 編輯資訊
0
0
0
內容預覽:
你好! 我一開始也是這樣想的想法,不過不行耶. 會出現. Error in model.frame.default(formula = y ~ x1 + b, data = D,. drop.unused.levels = TRUE) : variable lengths differ (found

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者ablazekandyh (ablazekandyh)時間18年前 (2008/04/07 03:26), 編輯資訊
0
0
0
內容預覽:
e.g.. List = c("x1", "x1" "x3", "x1" "x3" "x7"). for(i in List){. b = get(i). update(a, ~ . + b). }. --. 發信站: 批踢踢實業坊(ptt.cc). ◆ From: 220.132.13.85.

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者horby (horby)時間18年前 (2008/04/07 02:59), 編輯資訊
0
0
0
內容預覽:
我最主要要問的問題是,當我在原有的回歸模型中要加入一個新的解釋變數. 比如:D是一個data.frame, 其中 names(D)= "y" "x1" "x2" "x3" ... "x20". a=lm(y~x1,data=D). 則我們要加入一個新的解釋變數 x5 的話,以 update 來說可以
(還有272個字)
首頁
上一頁
1
下一頁
尾頁