I have a dataset with multiple response variables that share the same predictor set (in particular, semantic differential scales in an attitudes task). I want to find the predictors that best explain each response variable. In a situation like this, is it valid to run random forests on each response and compare the ranks (not the magnitudes) of predictors' variable importance scores? I mention ranks because the magnitudes aren't comparable across models.
Here's an example implementation in R using party::cforest()
suppressPackageStartupMessages(library(party))
data("mammoexp", package = "TH.data")
f1 <- cforest(HIST ~ SYMPT + PB + ME + DECT, mammoexp,
control=cforest_unbiased(ntree=50, mtry=2))
f2 <- cforest(BSE ~ SYMPT + PB + ME + DECT, mammoexp,
control=cforest_unbiased(ntree=50, mtry=2))
imp1 <- varimp(f1, conditional=TRUE)
imp2 <- varimp(f2, conditional=TRUE)
names(sort(imp1, decreasing=TRUE))
#> [1] "SYMPT" "PB" "ME" "DECT"
names(sort(imp2, decreasing=TRUE))
#> [1] "DECT" "PB" "ME" "SYMPT"
Created on 2022-05-09 by the reprex package (v2.0.1)