add marginal effect calculation