The help page for randomForest shows na.action=na.fail as a parameter, and does not describe other possibilities for na.action. I have a regression problem, with about 1000 rows in my data frame, and with an NA in occasional predictor variables, in about 5% of rows. I would like to have all rows included in the analysis, to the extent possible. (That seems to be possible in rpart, for example.) Is it possible to specify that rows with a few NA's should be included in the randomForest analysis? If so, how? Thanks. Dave Parkhurst
David Parkhurst wrote:> The help page for randomForest shows na.action=na.fail as a parameter, and > does not describe other possibilities for na.action. > > I have a regression problem, with about 1000 rows in my data frame, and with > an NA in occasional predictor variables, in about 5% of rows. I would like > to have all rows included in the analysis, to the extent possible. (That > seems to be possible in rpart, for example.) Is it possible to specify that > rows with a few NA's should be included in the randomForest analysis? If > so, how?I don't know the design of randomForest, but if the authors have implemented na.action as in other functions, you can specify your own function here (typical one uses na.fail or na.omit). Uwe Ligges
On Sun, 3 Aug 2003, David Parkhurst wrote:> The help page for randomForest shows na.action=na.fail as a parameter, and > does not describe other possibilities for na.action. > > I have a regression problem, with about 1000 rows in my data frame, and with > an NA in occasional predictor variables, in about 5% of rows. I would like > to have all rows included in the analysis, to the extent possible. (That > seems to be possible in rpart, for example.) Is it possible to specify that > rows with a few NA's should be included in the randomForest analysis? If > so, how?What do you want the tree procedure to do with NAs? Hint: rpart and tree have two different approaches. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595