SHAZAM Examples

Examples to accompany the SHAZAM User's Reference Manual
Version 10

  3.   Data Input and Output
rdataSHA.txt Reading character data with the FORMAT command.
readcharSHA.txt Reading character data with the CHARVARS= option.
  4.   Descriptive Statistics
anovaSHA.txt A two-way ANOVA table.
teststatSHA.txt t-test statistic for differences in population mean and an F-test statistic for different population variances.
    Data file : urate.txt
stemleafSHA.txt Stem-and-Leaf Display
  5.   Plots and Graphs
graphSHA.txt Graph of monthly time series data with dates on the x-axis.
    Data file : urate.txt
  6.   Generating Variables
log10SHA.txt Working with logarithms to the base 10.
wreplaceSHA.txt Sampling Without Replacement.
  7.   Ordinary Least Squares
homeownSHA.txt Weighted Least Squares - Analysis of Proportions Data
  8.   Hypothesis Testing and Confidence Intervals
hyptestSHA.txt Linear and non-linear hypothesis tests.
confidSHA.txt Interval estimation for a population mean.
confid2SHA.txt Confidence ellipse for 2 regression coefficients from 2SLS estimation. Also see systemSHA.txt.
    Data file : klein.txt
  9.   Inequality Restrictions
bayesSHA.txt Linear regression with inequality restrictions.
sureqSHA.txt SURE with inequality restrictions.
  10.   ARIMA Models
pacfSHA.txt Calculation of the partial autocorrelation function.
arimaSHA.txt ARIMA estimation - an example from Enders.
arseasSHA.txt Seasonal ARIMA models - examples with the Box and Jenkins airline passenger data set and the Enders Spanish tourism data set.
  11.   Autocorrelation Models
ar1SHA.txt Estimation and forecasting for a model with AR(1) errors. The commands show how to replicate the estimation results of the AUTO command by using OLS on transformed observations.
  13.   Cointegration and Unit Root Tests
unitrootSHA.txt Tests for unit roots using the Perron test applied to the Nelson-Plosser data set.
    Data file : nelplos.txt
johansen Johansen trace test procedure for cointegration .
    Command file : johanSHA.txt
    Data file : macro.txt
  14.   Diagnostic Tests
diagnosSHA.txt Examples of programming test statistics in SHAZAM by illustrating some of the computations implemented by the DIAGNOS command. Calculations for tests for autocorrelation and tests for heteroskedasticity are shown.
recurSHA.txt More examples of programming test statistics. Calculations for recursive coefficient estimates and the Hansen test of model stability are shown.
resetSHA.txt More examples of programming test statistics. Calculations for RESET tests are shown.
  15.   Distributed-Lag Models
dlagSHA.txt Estimation of distributed lag models including Almon lags.
gcauseSHA.txt Testing for Granger causality.
    Data file : judge18.txt
  16.   Forecasting
poolfcSHA.txt Forecasting with time-series cross-section data.
  17.   Fuzzy Set Models
fuzzySHA.txt Measuring the underground economy using the methodology of Giles and Draeseke.
  18.   Generalized Entropy
gmeSHA.txt Example of generalized entropy estimation.
  19.   Generalized Least Squares
glsar1SHA.txt Example of generalized least squares estimation for the model with AR(1) errors.
  20.   Heteroskedastic Models
hetregSHA.txt Multiplicative Heteroskedasticity
    Data file : credit.txt
  21.   Maximum Likelihood Estimation of Non-Normal Models
poissonSHA.txt Poisson regression.
mlebetaSHA.txt Models with Beta-Distributed Dependent Variables
    Data file : soss.txt
  22.   Nonlinear Regression
nlcesSHA.txt Estimation of a CES production function and testing for autocorrelated errors.
maxfuncSHA.txt Maximizing a function of a single variable.
nlsureSHA.txt Nonlinear seemingly unrelated regression applied to the estimation of a linear expenditure system.
sysnlSHA.txt N2SLS, N3SLS and GMM estimation applied to Klein's Model I. Also see systemSHA.txt.
    Data file : klein.txt
        Examples of the LOGDEN option
mhetSHA.txt Estimation of the multiplicative heteroskedastic error model.
boxhetSHA.txt Maximum likelihood estimation of Box-Cox models with heteroskedasticity.
poisnlSHA.txt Poisson regression. Note that Poisson regression is implemented with the MLE command as shown in the command file poissonSHA.txt.
tobithetSHA.txt Tobit model with heteroskedasticity.
    Data file : mroz.txt
homeownSHA.txt Analysis of Proportions Data
  23.   Nonparametric Methods
nonparSHA.txt Nonparametric regression of a nonlinear function.
semiparSHA.txt Robinson's semiparametric regression.
  24.   Pooled Cross-Section Time-Series
poolSHA.txt Estimation methods available with the POOL command.
poolfcSHA.txt Forecasting with time-series cross-section data.
poolecSHA.txt Pooling with error components - an example of programming in SHAZAM.
  25.   Probit and Logit Regression
logitSHA.txt Logit model estimation - comparisons with the probit model are also shown.
    Data file : school.txt
probitSHA.txt Probit model estimation and Heckit procedure.
    Data file : mroz.txt
logitwSHA.txt Weighted Logit estimation
  26.   Robust Estimation
ladSHA.txt Least Absolute Error estimation. Calculation of bootstrap standard errors is also shown.
    Data file : industry.txt
  27.   Time-Varying Linear Regression
flsSHA.txt Flexible least squares simulation experiment from Kalaba and Tesfatsion.
  28.   Tobit Regression
tobitSHA.txt Tobit regression.
    Data file : judge19.txt
tobitmSHA.txt Calculating marginal effects for Tobit models including the McDonald and Moffitt (1980) decomposition.
    Data file : judge19.txt
  29.   Two-Stage Least Squares and Systems of Equations
systemSHA.txt Estimation of Klein's Model I by 2SLS and 3SLS.
    Data file : klein.txt
hetcovSHA.txt Computation of heteroskedasticity-consistent standard errors for 2SLS estimation.
    Data file : klein.txt
  30.   Data Smoothing, Moving Averages and Seasonal Adjustment
smoothSHA.txt Seasonal adjustment.
expsmthSHA.txt Moving averages and exponential smoothing.
  31.   Financial Time Series
stockSHA.txt Chart of stock market prices.
    Data file : spy.txt
portfolSHA.txt Portfolio selection problem.
    Data file : p.txt
eurocallSHA.txt Pricing European call options.
bspriceSHA.txt Black-Scholes formula for a call option price, put option price and implied volatility.
  32.   Linear Programming
lpSHA.txt Linear Programming.
  33.   Matrix Manipulation
matrixSHA.txt Matrix operations.
matolsSHA.txt OLS estimation with the MATRIX command.
  34.   Price Indexes
prindexSHA.txt Computing price indexes.
  35.   Principal Components and Factor Analysis
pcompSHA.txt Example of multicollinearity diagnostics and principal components regression.
  36.   Probability Distributions
pvalueSHA.txt Calculating p-values for test statistics.
distchiSHA.txt Calculating probabilities for chi-square.
distfSHA.txt Calculating probabilities for non-central F.
  37.   Sorting Data
wreplaceSHA.txt Sampling Without Replacement.
  40.   Programming in SHAZAM
spliceSHA.txt Splicing price index series.
powerSHA.txt Computing the power of a test.
ridgeSHA.txt Ridge Regression.
nlsrocSHA.txt Nonlinear least squares by the rank one correction method.
mcarloSHA.txt Monte Carlo experiments.
bootSHA.txt Bootstrapping regression coefficients.
olscovSHA.txt Estimating the variance of the OLS estimator in the presence of heteroskedastic errors or autocorrelated errors.
hausmanSHA.txt Hausman specification test for errors in variables.
nonnestSHA.txt Non-Nested model testing.
solveSHA.txt Solving nonlinear sets of equations.
mnlogitSHA.txt Multinomial logit estimation.
        More Examples
corSHA.txt Computing p-values for correlation coefficients.
archprogSHA.txt ARCH estimation using Engle's algorithm.
vifSHA.txt Computation of Variance Inflation Factors as an indicator of the severity of multicollinearity.
probelasSHA.txt Computing elasticities from probit estimation when variables have been log-transformed. Also see logitSHA.txt.
    Data file : school.txt
bvprobSHA.txt Bivariate Probit models - Testing for zero error correlation by computing a Lagrange multiplier test statistic.
    Data file : school.txt
fimlSHA.txt Full information maximum likelihood - Klein Model I.
    Data file : klein.txt
  41.   SHAZAM Procedures
sqrta
sqrtm
Square root of a matrix using:
  - an eigenvalue-vector decomposition
  - the Golub-Van Loan procedure
    Command file : sqrtmSHA.txt
bs
impvol
Black-Scholes option pricing and implied volatility.
    Command file : bsvolSHA.txt
Note that Black-Scholes option pricing is implemented with the CALL and PUT commands as shown in the command file bspriceSHA.txt.
liml Limited information maximum likelihood.
    Command file : limlSHA.txt
    Data file : klein.txt
multi Generating multivariate random numbers.
    Command file : multiSHA.txt
        More Procedures
dwpvalue Calculation of a p-value for the Durbin-Watson statistic
    Command file : dwpvalueSHA.txt
gauss Nonlinear equation estimation by the Gauss-Newton method
    Command file : gaussSHA.txt
granger Testing for Granger causality
    Command file : grangerSHA.txt
    Data file : judge18.txt
Granger causality tests are also available using the commands shown in gcauseSHA.txt.
huf Robinson's heteroskedasticity of unknown form estimator
    Command file : hufSHA.txt
qr
hh
Solving OLS with the Householder transformation
    Command file : qrSHA.txt
randcoef Random coefficients models - pooled time-series cross-section data.
    Command file : randSHA.txt
seasroot Tests for seasonal unit roots
    Command file : seasSHA.txt
    Data file : gdpcan.txt
stest Stationarity tests proposed by Leybourne and McCabe
    Command file : stestSHA.txt
    Data file : citibase.txt
ols Replication of the SHAZAM OLS command.
    Command file : olsSHA.txt


A Note on using SHAZAM Procedures

SHAZAM command files that use SHAZAM procedures may need a revision to the FILE PROC command. This is required to ensure that the procedure file can be located. Further details are in the chapter SHAZAM PROCEDURES.