R loops+predict()

Hi I am a beginner with R (beginner programmer in general) and the help documents are absolutely killing me. Suppose I have a matrix [a,b,c,d] I complete 2 regression of some kind a~b+c+d. My goal is to do a predict() for the variable "a" in test data set but c is full of NAs. How do I replace the NAs in c using the model I have created? If it helps this is the kind of loop I would do in Octave, for i:length(c) if c(i)=NA c(i)=some_function(b,d);<---- I tried to bold this but it came out wrong end Thanks
You say the help documents are killing you. Have you tried some of the more targeted introductions to R? E.g. cran.r-project.org/doc/manuals/R-intro.pdf Read the chapters on linear models and on data.frames and that should get you started.

以上就是R loops+predict()的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准