SHAZAM Using Trend Variables

Using Trend Variables


Regression equations that use time series data may include a time index or trend variable. This trend variable can serve as a proxy for a variable that affects the dependent variable and is not directly observable -- but is highly correlated with time. For example, in the estimation of production functions a trend variable may be included as a proxy for technological change. For the estimation of consumption functions a trend variable may serve as a proxy for changes in consumer preferences.

In SHAZAM a trend variable that takes the values 1, 2, ... , T can be created by using the TIME function on the GENR command. The command format is:

GENR newvar=TIME(0)

where newvar is the name to assign the trend variable.

Consider variables Y and X with annual observations Yt and Xt for t = 1, 2, ..., T. A regression equation that includes a trend variable is:

      Yt = beta0 + beta1 Xt + beta2 t + et

where et is a random error. The coefficient beta2 measures the annual change in Y holding all other variables (that is, X) constant.

An alternative model specification is:

      ln(Yt) = alpha0 + alpha1 ln(Xt) + alpha2 t + ut

where ut is a random error. When the dependent variable is in log form the coefficient on the trend variable has an interpretation as a growth rate. In this example, given the same level of X,

for alpha2 > 0,   100(alpha2)   is the percentage rate of growth for Y;
for alpha2 < 0,   100(alpha2)   is the percentage rate of decay for Y.

This is an instantaneous growth rate. The compound annual rate of growth for Y, holding all other variables constant, is:

        g = 100 (exp(alpha2) - 1)

An estimate for g can be computed from the OLS estimation results. From statistical theory a general result is that if Z is a normally distributed random variable then:

      E[exp(Z)] = exp{E(Z) + Var(Z)/2}

Suppose a2 is the OLS estimate of alpha2 and V(a2) is the estimate of the variance of a2. The above result can be applied to obtain an estimate of the growth rate as:

      100 (exp{a2 - V(a2)/2} - 1)

Note: The elasticities that are reported in the final column of the SHAZAM OLS estimation output must be interpreted with caution. The elasticities reported for time trend variables likely have no meaningful interpretation.


Example

This example comes from the term paper research done by students in Economics 326 at the University of British Columbia. The term paper assignment was to estimate a demand equation for a selected food item. A demand equation typically considers consumption as a function of price of the good, prices of other goods that may serve as substitutes or complements and income. The Econ326 students observed that the media promotes interest in health issues that can influence changes in the dietary habits of the Canadian consumer. Over the time period 1975 to 1994, the Econ326 term papers discussed some evidence for a trend towards reduction in consumption of food items such as butter, eggs and beef and an increasing popularity for chicken.

This example focuses on the demand for beef. The data set for beef demand in Canada was collected from the CANSIM Statistics Canada data base. Two features of the data set are:

  1. The price variables are in the form of index numbers.
  2. The consumption and income variables are measured in per capita terms. These variables were constructed by dividing the aggregate amount by total population in Canada.

The SHAZAM commands (filename: BEEF.SHA) below estimate a linear demand equation and a log-linear demand equation. A trend variable is included in the demand equations to allow for changes in consumer preferences.


SAMPLE 1 20
READ (BEEF.txt) YEAR BEEF PBEEF PCHKN INCOME PFOOD PDFL
* Convert data to real terms
GENR RPBEEF=100*PBEEF/PFOOD
GENR RPCHKN=100*PCHKN/PFOOD
GENR RINCOME=100*INCOME/PDFL
* Generate a time trend
GENR TREND=TIME(0)
* Estimate a linear demand equation
OLS BEEF RPBEEF RPCHKN RINCOME TREND

* Transform data to logarithms
GENR LBEEF=LOG(BEEF)
GENR LPBEEF=LOG(RPBEEF)
GENR LPCHKN=LOG(RPCHKN)
GENR LINCOME=LOG(RINCOME)
* Estimate a log-linear demand equation
OLS LBEEF LPBEEF LPCHKN LINCOME TREND / LOGLOG 
STOP

In the above commands, the first task is to prepare the data set in a form that is suitable for the regression analysis. It is of interest to express the price and income variables in real terms. To accomplish this the price variables are divided by the consumer price index for food and the income variable is divided by the implicit GDP price index.

From economic theory, we expect that the coefficient for the price of beef (RPBEEF) should be negative. That is, as the price of beef increases the consumption of beef will decline. The coefficient for income (RINCOME) could be positive for a "normal" good or negative for an "inferior" good. An income elasticity less than one suggests that beef is not a luxury item whereas an elasticity greater than one gives evidence that beef is a luxury item. The coefficient for the price of chicken (RPCHKN) measures a cross-price effect and the sign may be:

postive, if chicken and beef are substitutes;
negative, if chicken and beef are complements;
zero, if chicken and beef are unrelated.

The SHAZAM output can be viewed. The estimation results for the linear demand equation are summarized as follows:

Variable name Estimated
Coefficient
t-Statistic Estimated
Elasticity
at Means
RPBEEF (price of beef) -0.325 -6.78 -0.53
RPCHKN (price of chicken) 0.030 0.30 0.05
RINCOME (per capita income) -0.001 -0.50 -0.12
TREND (time trend) -1.468 -5.28 not applicable

Over the sample period 1975 to 1994, average annual Canadian per capita beef consumption was 62.7 pounds. (On the SHAZAM OLS estimation output this number is reported as: MEAN OF DEPENDENT VARIABLE). The estimation results show that the estimated coefficient for the time trend variable is negative and statistically significant. Holding all else constant, the estimated decline in per capita consumption of beef is 1.5 pounds per year.

The estimated coefficient for the price of beef is negative and the t-statistic suggests that the coefficient is significantly different from zero. This result agrees with our a priori expectations.

The estimated coefficients for price of chicken and income do not appear to be significantly different from zero. This does not necessarily suggest that price of chicken and income are irrelevant to the analysis of the demand for beef in Canada. The result may reflect that the data does not have sufficient variability to produce precise estimates. In this example, high correlation between the income and the trend variable may erode our ability to get precise coefficient estimates. For reporting purposes, the equation should be presented as above since all the explanatory variables have a role in economic theory. Variables should not be excluded merely because they have large standard errors. Omitting a relevant variable may lead to biased estimators for the remaining coefficients.

The estimation results for the linear demand equation can be compared with the estimation results for the log-linear demand equation. For the log-linear equation, the estimated coefficient on the time trend variable is -0.0276 and its estimated standard error is 0.003686. The interpretation of this result is that, for the sample period 1975 to 1994 and holding all other variables constant, the percentage annual rate of decline in per capita beef consumption is:

         100 (exp{-0.0276 - (0.003686)2/2} - 1) = -2.72 %

Home [SHAZAM Guide home]

SHAZAM output


 |_SAMPLE 1 20
 |_READ (BEEF.txt) YEAR BEEF PBEEF PCHKN INCOME PFOOD PDFL
 
 UNIT 88 IS NOW ASSIGNED TO: BEEF.txt
    7 VARIABLES AND       20 OBSERVATIONS STARTING AT OBS       1
 
 |_* Convert data to real terms
 |_GENR RPBEEF=100*PBEEF/PFOOD
 |_GENR RPCHKN=100*PCHKN/PFOOD
 |_GENR RINCOME=100*INCOME/PDFL
 |_* Generate a time trend
 |_GENR TREND=TIME(0)

 |_* Estimate a linear demand equation
 |_OLS BEEF RPBEEF RPCHKN RINCOME TREND
 
  OLS ESTIMATION
       20 OBSERVATIONS     DEPENDENT VARIABLE = BEEF
 ...NOTE..SAMPLE RANGE SET TO:    1,   20
 
  R-SQUARE =    .9778     R-SQUARE ADJUSTED =    .9718
 VARIANCE OF THE ESTIMATE-SIGMA**2 =   2.7781
 STANDARD ERROR OF THE ESTIMATE-SIGMA =   1.6668
 SUM OF SQUARED ERRORS-SSE=   41.672
 MEAN OF DEPENDENT VARIABLE =   62.740
 LOG OF THE LIKELIHOOD FUNCTION = -35.7197
 
 VARIABLE   ESTIMATED  STANDARD   T-RATIO        PARTIAL STANDARDIZED ELASTICITY
   NAME    COEFFICIENT   ERROR      15 DF   P-VALUE CORR. COEFFICIENT  AT MEANS 
 RPBEEF    -.32517      .4794E-01  -6.783      .000 -.868     -.3167     -.5333
 RPCHKN     .30237E-01  .1004       .3013      .767  .078      .0153      .0501
 RINCOME   -.58792E-03  .1185E-02  -.4962      .627 -.127     -.0786     -.1164
 TREND     -1.4681      .2778      -5.284      .000 -.807     -.8744     -.2457
 CONSTANT   115.78      15.73       7.361      .000  .885      .0000     1.8454

 |_* Transform data to logarithms
 |_GENR LBEEF=LOG(BEEF)
 |_GENR LPBEEF=LOG(RPBEEF)
 |_GENR LPCHKN=LOG(RPCHKN)
 |_GENR LINCOME=LOG(RINCOME)

 |_* Estimate a log-linear demand equation
 |_OLS LBEEF LPBEEF LPCHKN LINCOME TREND / LOGLOG
 
  OLS ESTIMATION
       20 OBSERVATIONS     DEPENDENT VARIABLE = LBEEF
 ...NOTE..SAMPLE RANGE SET TO:    1,   20
 
  R-SQUARE =    .9815     R-SQUARE ADJUSTED =    .9765
 VARIANCE OF THE ESTIMATE-SIGMA**2 =   .54403E-03
 STANDARD ERROR OF THE ESTIMATE-SIGMA =   .23324E-01
 SUM OF SQUARED ERRORS-SSE=   .81604E-02
 MEAN OF DEPENDENT VARIABLE =   4.1277
 LOG OF THE LIKELIHOOD FUNCTION(IF DEPVAR LOG) = -32.8912
 
 VARIABLE   ESTIMATED  STANDARD   T-RATIO        PARTIAL STANDARDIZED ELASTICITY
   NAME    COEFFICIENT   ERROR      15 DF   P-VALUE CORR. COEFFICIENT  AT MEANS 
 LPBEEF    -.48892      .7165E-01  -6.823      .000 -.870     -.2965     -.4889
 LPCHKN    -.47129E-01  .1461      -.3226      .751 -.083     -.0147     -.0471
 LINCOME    .14716      .1936       .7602      .459  .193      .1065      .1472
 TREND     -.27609E-01  .3686E-02  -7.490      .000 -.888    -1.0729     -.0276
 CONSTANT   5.5135      1.799       3.065      .008  .621      .0000     5.5135
 |_STOP

Home [SHAZAM Guide home]