作者clansoda (小笨)
看板R_Language
標題Re: [問題] GLM回歸請教
時間Fri Apr 6 11:01:24 2018
idx <- c(1, 3, 5) #假設你要1、3、5這三個variables
my_formula <-
as.formula(paste("Classkd ~ ", paste(colnames(training.data)[idx],
collapse = "+")))
剩下來的就是把你的logistic function裡面的formula改成上面這個就好了
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.165.133.189
※ 文章網址: https://webptt.com/m.aspx?n=bbs/R_Language/M.1522983688.A.D9C.html