* Chapter 6 - The Classical Multiple Linear Regression Model
* W.H. Greene, Econometric Analysis, Fourth Edition, 2000.
SAMPLE 1 36
READ (gasoline.shd) / NAMES
* Example 6.3, p. 215 and Example 6.15, p. 251
GENR GPOP=100*G/POP
GENR LG=LOG(GPOP)
GENR LINC=LOG(Y)
GENR LPGAS=LOG(PG)
GENR LPNEW=LOG(PNC)
GENR LPOLD=LOG(PUC)
OLS LG LINC LPGAS LPNEW LPOLD / LOGLOG
* Confidence interval for the income elasticity
CONFID LINC
* Test the null hypothesis of income elasticity equal to one.
* The TEST command reports a p-value for a two-sided test.
TEST LINC=1
* Example 9.2 - Estimating an elasticity for a linear model.
* Calculate variable means.
STAT GPOP Y / MEANS=MU
GEN1 MGPOP=MU:1
GEN1 MY=MU:2
* Estimation results on p. 360.
OLS GPOP Y PG PNC PUC
* Note that the final column of the OLS estimation output reports
* elasticities evaluated at sample means (see the formula given at
* the beginning of Example 9.2, p. 359).
* The TEST command can be used to get the standard error of the elasticity
* evaluated at sample means.
* On the TEST command, variable names represent coefficients from the
* previous estimation.
TEST Y*MY/MGPOP
STOP