Using gret l for Principles of Econometrics, 4th Edition
Big Andy’s Burger Barn
Hansl is used to estimate the model for Big Andy’s. The following two lines are typed into a script file, which is executed by clicking your mouse on the “gear” button of the script window.
1 open "@gretldirdatapoeandy. gdt"
2 ols sales const price advert
3 scalar S_hat = $coeff(const) + $coeff(price)*5.5 + $coeff(advert)*1.2
This assumes that the gretl data set andy. gdt is installed at c:ProgramFiles(x86)gretldata poe. The results, in tabular form, are in Table 5.1 and match those in POE4.
In addition to providing information about how average sales change when price or advertising changes, the estimated equation can be used for prediction. To predict sales revenue for a price of $5.50 and an advertising expenditure of $1,200 we can use genr or scalar to do the computations. From the console,
Generated scalar S_hat (ID 4) = 77.6555
which also matches the result in POE4.
Model 1: OLS, using observations 1-75
Dependent variable: sales
Coefficient |
Std. Error |
t-ratio |
p-value |
|
const |
118.914 |
6.35164 |
18.7217 |
0.0000 |
price |
-7.90785 |
1.09599 |
-7.2152 |
0.0000 |
advert |
1.86258 |
0.683195 |
2.7263 |
0.0080 |
Mean dependent var 77.37467 S. D. dependent var 6.488537
Sum squared resid 1718.943 S. E. of regression 4.886124
R2 0.448258 Adjusted R2 0.432932
F(2,72) 29.24786 P-value(F) 5.04e-10
Log-likelihood -223.8695 Akaike criterion 453.7390
Schwarz criterion 460.6915 Hannan-Quinn 456.5151
Table 5.1: The regression results from Big Andy’s Burger Barn