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.