* * Example from page 182, section 6.6. * Lin-Log model * open data table2-8.prn data(format=prn,org=columns) 1 55 * set logtotal = log(totalexp) linreg foodexp # constant logtotal * scatter(hlabel="Total Expenditures (Rs)",vlabel="Expenditure on Food (Rs)") # totalexp foodexp * * Computing an elasticity. In the lin-log model (or almost any model other than * log-log), the elasticity is different for different values of x. Here, we * compute it at the sample mean of the log(totalexp) variable. * * If y=a + b log x, then dy/dx = dy/d(log X)*d(log X)/dx or b*(1/x). So * (dy/dx)*(x/y)=b*(1/x)*x/y=b/y * compute xmean=%avg(logtotal) disp "Estimated Elasticity at" xmean "is" %beta(2)/(%beta(1)+%beta(2)*xmean)