Using $predicted values of a randomForest object as predictor in training for another randomForest I'm wondering if there is any problem in using the predicted values (based on OOB observations) of a randomForest object as a predictor in the prediction of another variable. Something like this using R:
rf_interim <- randomForest(z ~ x1 + x2 + x3)
z_pred <- rf_interim$predicted
rf <- randomForest(y ~ x1 + x2 + x3 + z_pred)
rf$predicted

Ulitmately on new data, I want to predict z in a first random Forest and use that prediction to predict y in a second random Forest. Will it for example skew the error prediction or mess with any of the other outputs? Does this approach make sense when z is a strong predictor for y but not initially observable?

Okay, first observed issue with this approach: since leakage is probably an issue when using OOB's twice, we need to assess performance on a test set instead on OOB's. Something like this:
rf_interim <- randomForest(z ~ x1 + x2 + x3, data=train)
z_pred <- rf_interim$predicted
rf <- randomForest(y ~ x1 + x2 + x3 + z_pred, data=train)
predictions <- predict(rf, test)
mse <- sum((predictions - test$y)^2) / length(predictions)

So we don't use the rf$mse (uses OOB's) to assess performance but the MSE of the test set.
