| 下面是用户共享的文件列表,安装eMule后,您可以点击这些文件名进行下载 | |
| <script language="javascript">$('ed2k_8AI').innerHTML=htmlspecialchars(unescape(decodeURIComponent('SHAZAM.10.rar')))+' (89.44 MB)';</script>">SHAZAM.10.rar | 89.4MB |
| eMule主页 下载eMule 使用指南 如何发布 | |
The manuals for running SHAZAM are
Undated
http://shazam.econ.ubc.ca/examples/fiml.sha
SHAZAM Terms
Variables
File
Data file
Commands SAMPLE, READ, GENR and more
Comment statement
Program (command file)
Output file
Memory PAR
Error messages
Rounding errors
Getting Started
How to Run SHAZAM
Using SHAZAM as a Calculator
Statistics
Mean, Variance, Median, Quartiles
Covariance and Correlation
Computing Probabilities for Normal Random Variables
Simulation Experiments
More Data Analysis
Ordinary Least Squares
Ordinary Least Squares Regression
Comparing linear vs. log-linear models
Hypothesis Testing
Confidence Intervals
Estimation with restrictions
Special Topics
Working with lagged variables
Using trend variables
Dummy Variables - Modelling structural change, seasonality and more
Diagnostic Testing
Testing for Heteroskedasticity
Testing for Autocorrelation
Testing for Structural Stability - the Chow Test
Generalized Least Squares
Estimation of models with Heteroskedastic errors
Estimation of models with Autoregressive errors
Pooling Time-Series Cross-Section Data
Sets of Linear Equations
Maximum Likelihood Estimation
ARCH and GARCH models
Time Series Analysis
Index Numbers
Moving Averages and Exponential Smoothing
Financial Time Series
| Revision date: September 2000 Copyright © 1995 - 2000 All Rights Reserved. Diana Whistler diana@shazam.econ.ubc.ca |
A Quick Guide to SHAZAM
by Walter Sosa
1. Very basic SHAZAM (getting help and quitting)
To start SHAZAM for Windows double click in the corresponding icon (ask the local system administrator if you have questions about where Shazam is installed). Once the program is loaded you will see the Shazam prompt (:).
To obtain help, just type :
HELP command
where command is any valid Shazam command. For example, help ols shows available help on the ols command use to perform ordinary least squares. Type help alone to see a list of available commands. To exit SHAZAM, simply type:
QUIT
2. Reading data
We assume your data is in an ASCII (text) file called mydata.txt. The first four lines of mydata.txt should look like this:
YEAR CONSUME INCOME PRICE
1923 99.2 96.7 101.0
1924 99.0 98.4 100.1
1925 100.0 100.0 100.0
1926 111.6 104.9 90.6
First we need to set the sample size. In our example we will have 17 observations, so we do:
SAMPLE 1 17
where 1 and 17 refer to the first and last observation respectively. Now we are ready to read the data from the mydata.txt file. This is done with:
READ(mydata.txt) year consume income price /skiplines=1
This command assumes that mydata.txt is located in the same subdirectory as the Shazam program, if not you should provide a full path to the file. The command follows with a list of the names of the variables being read. The option /skiplines=1 indicates that the file contains variables names in the first row. You should ignore this option if this is not the case or change the number in skiplines if variable names are contained in more than one row. If you want to list the data, you can do it with:
PRINT year consume income price
this will show a list with the variables above.
3. Basic statistics and regressions
Basic descriptive statistics can be produced with the following line:
STAT consume income price
This shows a table with some descriptive statistics for each of the variables. To run an ordinary least squares regression, the command is:
OLS consume income price
This will produce ols estimates of a regression of consume on income and price. The first variable in the list is always taken to be the dependent variable and the rest are treated as explanatory variables. By default, a constant is always included in the model.
4. Producing output files and reading commands from external files.
It will be useful to store results in a text file that could be later printed or edited with a wordprocessor. At the Shazam prompt type:
FILE SCREEN filename
and Shazam will send output to the file filename and the screen simultaneously. This command must be typed before any other command whose output you want to send to filename. Sometimes it is useful to collect a sequence of Shazam commands in a text file and run them all at once. To do this you have to create a text file containing valid Shazam commands, as if you were typing them in Shazam, one at each line. After you have saved the file (in a file named command.txt, say), at the Shazam prompt type:
FILE INPUT command.txt
and the program will execut the commands contained in the command.txt file.
As an example, we reproduce a full session
FILE SCREEN shout.out
SAMPLE 1 17
READ(shazdat.txt) year consume income price /skiplines=1
PRINT year consume income price
STAT consume income price
OLS consume income price
Note that any output will be sent to the file shout.out and the screen simultaneously.
5. Where to find more information
http://www.econ.uiuc.edu/~sosa/eclab.html
A Quick Guide to SHAZAM (II)
by Walter Sosa
This quick guide presents various tests and alternative estimation methods. We will use the consumption example in the Shazam manual. As a starting point, we read the data from the file shazdat.txt and estimate a basic model. See the Quick Guide I for basic Shazam commands.
|_SAMPLE 1 17
|_READ(c:\sa\shazdat.txt) year consume income price /skiplines=1
|_PRINT year consume income price
|_STAT consume income price
|_OLS consume income price
These are some basic results of the OLS estimation:
R-SQUARE = 0.9516 R-SQUARE ADJUSTED = 0.9447
VARIANCE OF THE ESTIMATE-SIGMA**2 = 30.716
STANDARD ERROR OF THE ESTIMATE-SIGMA = 5.5422
SUM OF SQUARED ERRORS-SSE= 430.03
MEAN OF DEPENDENT VARIABLE = 134.49
LOG OF THE LIKELIHOOD FUNCTION = -51.5823
VARIABLE ESTIMATED STANDARD T-RATIO PARTIAL STANDARDIZED ELAST.
NAME COEFFICIENT ERROR 14 DF P-VALUE CORR. COEFFICIENT AT MEANS
INCOME 1.0648 0.2668 3.991 0.999 0.730 0.2388 0.8155
PRICE -1.3846 0.8358E-01 -16.57 0.000-0.975 -0.9909 -0.7856
CONSTANT 130.48 27.07 4.819 1.000 0.790 0.0000 0.9701
1. Testing hypothesis on regression coefficients
We start by testing the simple hypothesis that the coefficient associated with income is equal to 1. The TEST command is used:
|_TEST income = 1
And some relevant output is:
TEST VALUE = 0.64824E-01 STD. ERROR OF TEST VALUE 0.26678
T STATISTIC = 0.24298353 WITH 14 D.F. P-VALUE= 0.40577
F STATISTIC = 0.59040995E-01 WITH 1 AND 14 D.F. P-VALUE= 0.81154
WALD CHI-SQUARE STATISTIC = 0.59040997E-01 WITH 1 D.F. P-VALUE= 0.80802
UPPER BOUND ON P-VALUE BY CHEBYCHEV INEQUALITY = 1.00000
Test value is simply income-1. The t-statistic is the usual t-ratio. The command also performs an F-statistic and an asymptotic wald statistic . Now test the hypothesis that the price coefficient is equal to -1:
|_TEST price = -1
Suppose we want to test the non-linear hypothesis that the product of the income and price coefficients is one. This is performed with:
|_TEST income*price=1
and the output is:
TEST VALUE = -2.4743 STD. ERROR OF TEST VALUE 0.39558
T STATISTIC = -6.2548234 WITH 14 D.F. P-VALUE= 0.00001
F STATISTIC = 39.122816 WITH 1 AND 14 D.F. P-VALUE= 0.00002
WALD CHI-SQUARE STATISTIC = 39.122814 WITH 1 D.F. P-VALUE= 0.00000
UPPER BOUND ON P-VALUE BY CHEBYCHEV INEQUALITY = 0.02556
Again, the test value is income*price -1. The standard error is obtained from the "delta-method". The "t-statistic" does not have the t-distribution but the standard normal. Note that the t-statistic is the square root of the Wald statistic, which in our case has Chi-Square distribution with one degree of freedom. The previous were single hypothesis. To test the joint hypothesis that the coefficients of income and price are 1 and -1 jointly we use:
|_TEST
|_TEST income =1
|_TEST price=-1
|_END
obtaining:
F STATISTIC = 10.773871 WITH 2 AND 14 D.F. P-VALUE= 0.00147
WALD CHI-SQUARE STATISTIC = 21.547743 WITH 2 D.F. P-VALUE= 0.00002
The command performs an F-statistic and a Wald test of the joint hypothesis.
2. Residual analysis. Testing for normality
If you include the options RSTAT , GF and LM, the OLS command willl produce an analysis of the residuals and a goodness of fit test for normality of the residuals. GS produces a goodness of fit test and LM produces Jarque and Bera's test of normality
OLS consume income price / RSTAT GF LM
and some relevant output is:
DURBIN-WATSON = 2.0291 VON NEUMANN RATIO = 2.1560 RHO = -0.19231 RESIDUAL SUM = 0.66791E-12 RESIDUAL VARIANCE = 30.716 SUM OF ABSOLUTE ERRORS= 72.335 R-SQUARE BETWEEN OBSERVED AND PREDICTED = 0.9516 RUNS TEST: 7 RUNS, 9 POSITIVE, 8 NEGATIVE, NORMAL STATISTIC = -1.2423 COEFFICIENT OF SKEWNESS = -0.0273 WITH STANDARD DEVIATION OF 0.5497 COEFFICIENT OF EXCESS KURTOSIS = -0.8459 WITH STANDARD DEVIATION OF 1.0632
GOODNESS OF FIT TEST FOR NORMALITY OF RESIDUALS - 6 GROUPS OBSERVED 0.0 2.0 6.0 6.0 3.0 0.0 EXPECTED 0.4 2.3 5.8 5.8 2.3 0.4 CHI-SQUARE = 1.0363 WITH 1 DEGREES OF FREEDOM
JARQUE-BERA ASYMPTOTIC LM NORMALITY TEST CHI-SQUARE = 0.6412 WITH 2 DEGREES OF FREEDOM TYPE COMMAND
3. Testing for autocorrelation and heteroskedasticity
The command DIAGNOS performs several specification tests on the last estimated model. To test for the presence of serial correlation in the residuals we use the ACF option (ACF stands for Autocorrelation Function):
|_DIAGNOS /ACF
Some relevant output is:
RESIDUAL CORRELOGRAM
LM-TEST FOR HJ:RHO(J)=0, STATISTIC IS STANDARD NORMAL
LAG RHO STD ERR T-STAT LM-STAT DW-TEST BOX-PIERCE-LJUNG
1 -0.1531 0.2425 -0.6311 0.7385 2.0291 0.4729
2 -0.2221 0.2425 -0.9158 1.2245 2.0313 1.5352
3 0.1923 0.2425 0.7928 1.0255 1.1821 2.3883
4 -0.2940 0.2425 -1.2123 1.7086 1.9974 4.5364
LM CHI-SQUARE STATISTIC WITH 4 D.F. IS 3.335
By default this command produces estimates of the autocorrelation function for 4 lags. The RHO coefficients are total autocorrelations of the residuals with respect to its lags. The command also produces a Breusch-Pagan LM test for serial correlation of order 4.
To test for the presence of heteroskedastic residuals we use the HET option:
|_DIAGNOS /HET
HETEROSKEDASTICITY TESTS
E**2 ON YHAT: CHI-SQUARE = 2.458 WITH 1 D.F.
E**2 ON YHAT**2: CHI-SQUARE = 2.626 WITH 1 D.F.
E**2 ON LOG(YHAT**2): CHI-SQUARE = 2.263 WITH 1 D.F.
E**2 ON X (B-P-G) TEST: CHI-SQUARE = 4.934 WITH 2 D.F.
E**2 ON LAG(E**2) ARCH TEST: CHI-SQUARE = 1.576 WITH 1 D.F.
LOG(E**2) ON X (HARVEY) TEST: CHI-SQUARE = 3.533 WITH 2 D.F.
ABS(E) ON X (GLEJSER) TEST: CHI-SQUARE = 4.308 WITH 2 D.F.
This command computes several heteroskedasticity tests including Breush-Godfrey and ARCH tests
4. Robust regression
Robust alternatives to OLS are easily produced in Shazam. The following command produces estimates based on the Least Absolute Errors (LAE) criterion. The RSTAT option prints summary statistics of the residuals of the estimation:
|_ROBUST consume income price /LAE RSTAT
LEAST ABSOLUTE ERRORS REGRESSION
OBJECTIVE FUNCTION = 35.039
NUMBER OF SIMPLEX ITERATIONS = 6.0000
EMPIRICAL QUANTILE FUNCTION AT MEANS = 136.26
SUM OF ABSOLUTE ERRORS = 70.078
USING DIFF= 2 FOR COVARIANCE CALCULATIONS
VARIANCE OF THE ESTIMATE-SIGMA**2 = 68.326
STANDARD ERROR OF THE ESTIMATE-SIGMA = 8.2659
SUM OF SQUARED ERRORS-SSE= 569.00
MEAN OF DEPENDENT VARIABLE = 134.49
VARIABLE ESTIMATED STANDARD T-RATIO PARTIAL STANDARDIZED ELASTICITY
NAME COEFFICIENT ERROR 14 DF P-VALUE CORR. COEFFICIENT AT MEANS
INCOME 0.69851 0.3979 1.756 0.949 0.425 0.1566 0.5349
PRICE -1.4421 0.1247 -11.57 0.000-0.951 -1.0321 -0.8183
CONSTANT 174.36 40.38 4.318 1.000 0.756 0.0000 1.2964
DURBIN-WATSON = 1.5357 VON NEUMANN RATIO = 1.6317 RHO = 0.19828
RESIDUAL SUM = -29.972 RESIDUAL VARIANCE = 40.643
SUM OF ABSOLUTE ERRORS= 70.078
R-SQUARE BETWEEN OBSERVED AND PREDICTED = 0.9438
RUNS TEST: 7 RUNS, 10 POSITIVE, 7 NEGATIVE, NORMAL STATISTIC = -1.1583
5. Autocorrelation models
The following command estimates the original model using the Cochrane-Orcutt iterative procedure for errors with first-order serial correlation. Again, the RSTAT option generates summary statistics on the residuals:
|_AUTO consume income price /RSTAT
LOG L.F. = -51.3037 AT RHO = -0.20585
ASYMPTOTIC ASYMPTOTIC ASYMPTOTIC
ESTIMATE VARIANCE ST.ERROR T-RATIO
RHO -0.20585 0.05633 0.23734 -0.86730
R-SQUARE = 0.9533 R-SQUARE ADJUSTED = 0.9466
VARIANCE OF THE ESTIMATE-SIGMA**2 = 29.650
STANDARD ERROR OF THE ESTIMATE-SIGMA = 5.4452
SUM OF SQUARED ERRORS-SSE= 415.10
MEAN OF DEPENDENT VARIABLE = 134.49
LOG OF THE LIKELIHOOD FUNCTION = -51.3037
VARIABLE ESTIMATED STANDARD T-RATIO PARTIAL STANDARDIZED ELASTICITY
NAME COEFFICIENT ERROR 14 DF P-VALUE CORR. COEFFICIENT AT MEANS
INCOME 1.0691 0.2264 4.723 1.000 0.784 0.2397 0.8187
PRICE -1.3766 0.7022E-01 -19.60 0.000-0.982 -0.9852 -0.7811
CONSTANT 129.28 22.83 5.663 1.000 0.834 0.0000 0.9612
DURBIN-WATSON = 1.8606 VON NEUMANN RATIO = 1.9768 RHO = -0.05771
RESIDUAL SUM = 1.1487 RESIDUAL VARIANCE = 29.744
SUM OF ABSOLUTE ERRORS= 72.685
R-SQUARE BETWEEN OBSERVED AND PREDICTED = 0.9532
RUNS TEST: 7 RUNS, 9 POSITIVE, 8 NEGATIVE, NORMAL STATISTIC = -1.2423
DURBIN H STATISTIC (ASYMPTOTIC NORMAL) = -1.1559
The GS option uses a "grid search" method to estimate the autocorrelation coefficient:
|_AUTO consume income price /gs RSTAT
and the ML option produces maximum-likelihood estimates
|_AUTO consume income price /ml RSTAT
6. Where to find more information
Back to the Econometrics Lab page.
The manuals for running SHAZAM are
这些书国内很难见到啊
| 下面是用户共享的文件列表,安装eMule后,您可以点击这些文件名进行下载 | |
| <script language="javascript">$('ed2k_8AI').innerHTML=htmlspecialchars(unescape(decodeURIComponent('SHAZAM.10.rar')))+' (89.44 MB)';</script>">SHAZAM.10.rar | 89.4MB |
| eMule主页 下载eMule 使用指南 如何发布 | |
扫码加好友,拉您进群



收藏
