Econometrics - marginal effect of x on y at average values I was solving a prep Econometrics exam, with STATA output provided on two different models. 
They asked me to " Estimate the marginal effect of ability (x variable) on wage (y variable) for the models of output A and B for average levels of wage and ability." 
Model A is a log-log model for the given x and model B is log-linear model. The answers they provided are 
Model A: ∂wage/ ∂asvabc = 0.403*(wage/asvabc), at averages we get 0.153.
; Model B: ∂wage/ ∂asvabc = 0.008*wage, at average we get 0.169

Irrespective of the numbers, I don't understand how they know whether to multiply the marginal effect by x or x/y or... Can someone help me with the logic? Or if you know the rule for this?
"They knew" because they have written down the models. Ignoring other variables, the log-log specification is

$$\ln y = \beta\ln x \implies e^{\ln y} = e^{\ln x ^{\beta}}$$

$$\implies y = x^{\beta} \implies \frac {\partial y}{\partial x} = \beta \frac {x^{\beta}}{x} = \beta \frac {y}{x}$$

I guess the OP can work out the other model now.