I have a panel data of students from 2000 to 2005. I want to predict the exam grades (continuous variable) of the students with random forest algorithm. I want to use past years' exam grades as an input variable. However, past years' exam grades are missing if (1) the student was transferred from another school, (2) the student didn't agree to share the exam results, (3) the student didn't take the exam.
I impute these missings with 0 but I also create a categorical variable that includes these 3 situations above to indicate the reason for missing values.
I'm not sure if this solution for the missing variables makes sense in random forest setting and if the algorithm can capture this interaction.