Using gret l for Principles of Econometrics, 4th Edition
Log-Linear Model
In this example the simple regression first considered in chapter 4 is modified to include more variables and an interaction. The model adds experience to the model
ln(wage) = ві + e2educ + вз exper + e (5.19)
In this model suppose that the marginal effect of another year of schooling depends on how much experience the worker has. This requires adding an interaction
ln(wage) = в1 + e2educ + e3exper + e4(educ x exper) + e (5.20)
The marginal effect of another year of experience is
In percentage terms the marginal effect of another year of experience is 100(в3 + e4educ). The model can be estimated and the marginal effect computed easily with hansl
1 open "@gretldirdatapoecps4_small. gdt"
2 logs wage
3 series ed_exp=educ*exper
4 ols l_wage const educ exper ed_exp
5 scalar me8 = $coeff(exper)+8*$coeff(ed_exp)
6 scalar me16 = $coeff(exper)+16*$coeff(ed_exp)
7 printf "nThe marginal effect of exper for one
8 with 8 years of schooling is %.3f%%n",100*me8
9 printf "nThe marginal effect of exper for one io with 16 years of schooling is %.3f%%.n",100*me16
The result is
The marginal effect of exper for one with 8 years of schooling is 0.604%. The marginal effect of exper for one with 16 years of schooling is 0.575%.