# T-Test__Stat

The Gretldata file Gasdata.gdtcontains 52 yearly observations (1953-2004) on U.S. gasoline

consumption and the variables in the file are listed as follows.

• Year = Year, 1953-2004,

• PerCap = Per household gas consumption

• Gp = Price index for gasoline,

• Inc = Per capita disposable income in $,

• Pnc = Price index for new cars,

• Ps= Aggregate price index for consumer services

T= Time trend (1, 2, …, 52).

Note: Your answers to the questions regarding hypothesis testing should include all the followingsteps: The null and alternative hypotheses, test statistic, the distribution of the test statistic underthe null including the degrees of freedom, critical value(s), decision rule and your conclusion.

Part 1-Model 1(Linear model)

whereetis the random error term, which follows a normal distribution with zero mean and a

constant variance.

- Estimate model 1 and summarise your results. What sign would you expect for the

coefficients for Inc, Gp, and Pnc? Do the estimated signs of these coefficients agree with yourexpectations? Explain your answers.

(Note: a summary regression report should contain the estimated regression equation followedby standard errors and/or, t ratios, sample size, goodness of fit statistic and the F value).

Obtain a scatter plot of per household gas consumption (PerCap) against per capita disposableincome (Inc) and comment on your plot. Copy and paste your graph.

(To obtain a scatter plot in Gretl, → View → graph specified vars→ XY Scatter → X-axisvariables (Inc) →Y-axis variable (PerCap) and ok).

c. Using the critical value method, test for the individual significance of the coefficient for eachof the variables Inc, and Gp at the 5% significance level.

d. Calculate the gas price elasticity of per household gas consumption and income elasticity ofper household gas consumption at the sample mean values and interpret them.

e. At 5% significance level, using the t-test and critical value method, test the hypothesis thatchanges in the gas price and the aggregate price index for consumer services have same effecton the per household gas consumption.

**Part 2- Model 2 (Log-Log model)**

** **

wherew*t*is the random error term, and it follows a normal distribution with zero mean and a

constant variance.

Note: The variables *PerCap*, *Inc*and *Gp*are in logs. To transform the variables into logs in

*Gretl*, click on the variable then click on Add → Log of selected variables.

Estimate model 2 and answer the following questions.

- Interpret the coefficients a2 and a3.

b. Construct a 99% confidence interval for the coefficient of ln(Gp). Interpret this interval. Do

NOT use Gretl’s built-in function to calculate the confidence interval.

c. Test the overall significance of the model at 5% significance level and comment.

d. Construct a 95% confidence interval for the predicted per household gas consumption

(PerCap) for 2005 assuming that, in 2005, the per capita disposable income (Inc) is equal to $

28000, the gas price index (Gp) is equal to 135, the price index for new cars (Pnc) is equal to

130, the aggregate price index for consumer services (Ps) is equal to 230 and T=53 and

interpret your results.

e. Critically evaluate and compare the two models. Which model do you prefer and why?

**Solution**** **

**Part 1-Model 1**

Model 1: OLS, using observations 1953-2004 (T = 52)

Dependent variable: PerCap

HAC standard errors, bandwidth 2 (Bartlett kernel )

Coefficient |
Std. Error |
t-ratio |
p-value |
||

const | 1181.58 | 455.860 | 2.592 | 0.0127 | ** |

Inc | 0.218651 | 0.0471651 | 4.636 | <0.0001 | *** |

Gp | -7.87342 | 1.52853 | -5.151 | <0.0001 | *** |

Pnc | 1.26823 | 2.74264 | 0.4624 | 0.6460 | |

Ps | -18.0738 | 1.95098 | -9.264 | <0.0001 | *** |

T | 75.2980 | 15.6616 | 4.808 | <0.0001 | *** |

Mean dependent var | 4935.619 | S.D. dependent var | 1059.105 |

Sum squared resid | 569458.3 | S.E. of regression | 111.2633 |

R-squared | 0.990046 | Adjusted R-squared | 0.988964 |

F(5, 46) | 1145.732 | P-value(F) | 4.75e-47 |

Log-likelihood | -315.6159 | Akaike criterion | 643.2319 |

Schwarz criterion | 654.9393 | Hannan-Quinn | 647.7202 |

Rho | 0.692419 | Durbin-Watson | 0.615673 |

- As disposable income increases, one would expect that that the PerCap might increase.

So the coefficient for Inc would probably be positive. On the other hand, as gasoline

price index increases, the amount of fuel one would get for a fixed amount of dollars

will decrease. Similarly price index of cars will have an negative impact on PerCap. So

signs of coefficients of Gp and Pnc would be negative. Gp and Inc coefficients agree with

my expectations, while Pnc doesn’t.

b. The PerCapvsInc scatterplot is on the next page.

The scatterplot shows a fairly increasing PerCap as Inc increases as one would nominally

expect. However, there’s a sudden drop in PerCap when Inc is close to 16000. That

remains unexplained.

As Inc approaches 24000, PerCap plateaus around 6000.That probably indicates the

maximum amount of gasoline used per house. So as Inc increases beyond 26000, one

would expect from this graph that PerCap wouldn’t exceed 6000.

c. Coefficient of Inc = 0.218651; t(46): area to the right of 4.636 = 1.47426e-005

(two-tailed value = 2.94851e-005; Therefore Inc variable is of high significance

Coefficient of Gp -7.87342; t(46): area to the right of -5.151 = 0.999997

(to the left: 2.64342e-006; two-tailed value = 5.28684e-006; complement = 0.999995)

Hence Gp is also of high significance.

- Elasticity of Gp = (coefficient of Gp)*(Mean of Gp)/(Mean of predicted PerCap)

Mean Median S.D. Min Max

Gp 51.34 47.50 30.83 16.67 123.9

Inc 16805 16693 5552 8685 27113

Summary statistics, using the observations 1953 – 2004 for the predicted PerCap(52

valid observations)

Mean 4935.6

Minimum 2777.1

Maximum 6378.8

Standard deviation 1053.8

Missing obs. 0

Elasticity of Gp =(-7.87342)*(51.34)/(4935.6) = -0.081899

Elasticity of Inc= (0.218651)*(16805)/(4935.6) = 0.7444

This indicates that for 1% increase in PerCap, there’s a 0.08% decrease in Gp and 0.744%

increase in disposable income

e. Null Ho: Elasticity of gas price and aggregate price index are same

Alternative H: Elasticity of gas price and aggregate price index are same

Degrees of freedom = 46

Mean of Ps = 89.777

Elasticity of Ps= (-18.07)*(89.777)/(4935.6)

= -0.3286

Elasticity of Gp = -0.0818899

T ratio of Ps =-9.24

T ratio of Gp =-5.5

After calculation, p value =1.3 e-20

Therefore, null hypothesis is rejected.

**Part 2-****Model 2**

Model 2: OLS, using observations 1953-2004 (T = 52)

Dependent variable: l_PerCap

HAC standard errors, bandwidth 2 (Bartlett kernel)

Coefficient |
Std. Error |
t-ratio |
p-value |
||

const | 3.12430 | 1.21617 | 2.569 | 0.0135 | ** |

Pnc | -0.00016451 | 0.000232120 | -0.7088 | 0.4821 | |

Ps | -0.00364812 | 0.000266298 | -13.70 | <0.0001 | *** |

T | 0.0212205 | 0.00402537 | 5.272 | <0.0001 | *** |

l_Inc | 0.563582 | 0.134053 | 4.204 | 0.0001 | *** |

l_Gp | -0.0851467 | 0.0157511 | -5.406 | <0.0001 | *** |

Mean dependent var | 8.478230 | S.D. dependent var | 0.238811 |

Sum squared resid | 0.022347 | S.E. of regression | 0.022041 |

R-squared | 0.992317 | Adjusted R-squared | 0.991482 |

F(5, 46) | 894.1497 | P-value(F) | 1.35e-44 |

Log-likelihood | 127.7756 | Akaike criterion | -243.5511 |

Schwarz criterion | -231.8437 | Hannan-Quinn | -239.0628 |

rho | 0.745304 | Durbin-Watson | 0.492542 |

- Log(Inc) is positive, keeping with our expectation that greater amounts of disposable income

would probably lead to greater household spending on gasoline. Log(Gp) is negative as increase

in gasoline prices would reduce spending.

b. T(46,0.005)=5.27

Std. Error of ln(Gp) = 0.01575

Confidence Interval bound= coefficient(ln(Gp)) + (or) – (5.27)*(0.01575)

CI= -.0851467 + (or) – (0.0423233)

CI= -0.127470 to -0.0428232

c. Mean of fitted values =8.478; SE of regression = 0.022041

P-value of regression = 1.35e-44. This indicates very high level of significance

d. For the given values, ln(PerCap)=8.74437, T=2.013

CI= 8.744 + (or)- (2.013)*(0.02204) = 8.7 to 8.78874

PerCap = e^8.7 to e^8.78874 = 2980.94195 to 6559.92263

The confidence interval is rather large which indicates that the model cannot give a more

narrower interval. - Among the 2 models, the second model has lesser standard error, greater adjusted R-squared

which is indicative of the goodness of fit. For these reasons, I prefer the second model.

** **