What's it called when I'm trying to remove the effect of a variable on another variable? Am I in the right ballpark using the terms "detrending" or "normalizing" or "controlling for Y on X"? What's the general process for doing this?
The problem I'm working with currently is as follows:
I work at a mine that loads trains that are 160 wagons in length. After the trains are filled, they leave to get unloaded and then later return to the mine. Sometimes the wagons end up in different positions in the train. Our aim is to maximise tonnes in every wagon.
We've noticed two things
- some wagons IDs load consistently low in tonnes
- wagons in poisitions near the start or end of the train load consistently low. i.e. tonnes go down as distance from middle position goes up
I've got a linear model fitted in R like
> lm(df$tonnes ~ df$dist_fr_middle) Coefficients: (Intercept) df$dist_fr_middle 113.92001 -0.03915
How do I go about creating a new column in my dataframe for distance-from-middle-adjusted tonnes?
Thanks for your help!