add average marginal effect calculation
minor changes