I’ve not done this often, but… I substitute equal proportions by weight, but I only sub part of the butter. I think I’ve replaced 1/4 of butter; can’t remember for sure at the moment.
However, because oil is liquid (v. butter as solid) it can weigh down the batter. (Butter has water that turns to steam that makes the cake rise, right? Oil doesn’t do that.) So I increase the leavening to account for it. You’ll have to practice to see what works for you.