* Log OLS Model for Demand for Gasoline * * Keywords: * regression, ols, log, income, elasticity, demand, gasoline, confidence, interval * t-test * * Description: * We illustrate how to estimate a log-log Multiple OLS model for the * Demand for Gasoline using generated variables, how to output the * confidence interval for Income Elasticity of Demand for Gasoline and * how to test a hypothesis using a t-test * * Author(s): * Noel Roy * Skif Pankov * * Source: * William H. Greene, Econometric Analysis - 7th Edition * Pearson International Edition, Chapter 4, Example 4.8 (page 117) * * Setting the first time period to be equal to year 1953 with periodicity of * one year time 1953.0 1 sample 1953.0 2004.0 * Reading the datafile and naming the variables, specifying to ignore the * first line of the file read (TableF2-2.shd) year gasexp pop gasp income pnc puc ppt pd pn ps / skiplines=1 * Generating logs of variables genr lngpop = log(gasexp/pop/gasp) genr lnincome = log(income) genr lnpg = log(gasp) genr lnpnc = log(pnc) genr lnpuc = log(puc) * Running an OLS regression of lngpop on lnpg, lnincome, lnpnc and lnpuc, * specifying that it's a log-log model ols lngpop lnpg lnincome lnpnc lnpuc / loglog * Generating a lower and upper bound of confidence around a point estimate of * a parameter from the preceding regression confid lnincome * Testing the hypothesis that the income elasticity of demand for gasoline * (coefficent on lnincome) is equal to 1 using a t-test test lnincome=1 stop