Dummy variables are very useful for capturing a variety of qualitative effects. They typically have the value 0 or 1 and so possibly a better name is "binary variable". They can be included as explanatory variables in the regression equation and the estimated coefficients and standard errors can be used in hypothesis testing.
Dummy variables that measure individual attributes may be coded
in the data file and these can be assigned variable names and loaded
into SHAZAM with the
Note: When dummy variables are used as dependent variables then analysis with the probit or logit model is required.
[SHAZAM Guide home]
Modelling structural change
Consider measuring the impact of seat belt legislation on traffic fatalities.
Monthly data is available for 120 observations on traffic fatalities
B = 0 for observations 1 to 79 B = 1 for observations 80 to 120
The following SHAZAM commands create the dummy variable and run the regression.
SAMPLE 1 120 READ (file) D C * Create the dummy variable GENR B=0 SAMPLE 80 120 GENR B=1 * SAMPLE 1 120 * List the data and check that it is set up correctly. PRINT D C B * Get the OLS estimation results OLS D C B STOP
Note that the command
In SHAZAM there is often more than one way of doing things. An equivalent way of creating the dummy variable is illustrated in the next list of commands.
SAMPLE 1 120 READ (file) D C GENR B=DUM(TIME(0)-79) OLS D C B STOP
The dummy variable is created in a single command by using the