Chapter 3. Data Input and Output

rdata.sha 
Reading character data with the FORMAT command (p. 36). 
readchar.sha 
Reading character data with the CHARVARS= option. 
Chapter 4. Descriptive Statistics 
anova.sha 
A twoway ANOVA table (p. 51). 
teststat.sha 
ttest statistic for differences in population mean and an Ftest statistic for different population variances (p. 52).
Data file : urate.txt Data file description: urate.html

stemleaf.sha 
StemandLeaf Display

Chapter 5. Plots and Graphs 
graph.sha 
Graph of monthly time series data with dates on the xaxis. (p. 56).
Data file : urate.txt Data file description: urate.html

Chapter 6. Generating Variables 
log10.sha 
Working with logarithms to the base 10 (pp. 6566).

wreplace.sha 
Sampling Without Replacement (p. 77).

Chapter 7. Ordinary Least Squares 
homeown.sha 
Weighted Least Squares  Analysis of Proportions Data 
Chapter 8. Hypothesis Testing and Confidence Intervals 
hyptest.sha 
Linear and nonlinear hypothesis tests (pp. 104110). 
confid.sha 
Interval estimation for a population mean (pp. 112113). 
confid2.sha 
Confidence ellipse for 2 regression coefficients from 2SLS estimation. (pp. 115116).
Also see system.sha.
Data file : klein.txt

Chapter 9. Inequality Restrictions 
bayes.sha 
Linear regression with inequality restrictions (pp. 119121). 
sureq.sha 
SURE with inequality restrictions (pp. 121122). 
Chapter 10. ARIMA Models 
pacf.sha 
Calculation of the partial autocorrelation function (pp. 127128). 
arima.sha 
ARIMA estimation  an example from Enders. 
arseas.sha 
Seasonal ARIMA models  examples with the Box and Jenkins airline passenger data set and the Enders Spanish tourism data set. 
Chapter 11. Autocorrelation Models 
ar1.sha 
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. 
Chapter 13. Cointegration and Unit Root Tests 
unitroot.sha 
Tests for unit roots using the Perron test applied to the NelsonPlosser data set.
Data file : nelplos.txt Data file description: nelplos.html

johansen.prc 
Johansen trace test procedure for cointegration (pp. 174177).
Command file : johan.sha
Data file : macro.txt Data file description: macro.html

Chapter 14. Diagnostic Tests 
diagnos.sha 
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 (pp. 182185). 
recur.sha 
More examples of programming test statistics. Calculations for recursive coefficient estimates and the Hansen test of model stability
are shown (pp. 185188). 
reset.sha 
More examples of programming test statistics. Calculations for RESET tests are shown (pp. 190191). 
Chapter 15. DistributedLag Models 
dlag.sha 
Estimation of distributed lag models including Almon lags (pp. 194199). 
gcause.sha 
Testing for Granger causality (pp. 199200).
Data file : judge18.txt

Chapter 16. Forecasting 
poolfc.sha 
Forecasting with timeseries crosssection data.

Chapter 17. Fuzzy Set Models 
fuzzy.sha 
Measuring the underground economy using the methodology of Giles and Draeseke (pp. 215216). 
Chapter 18. Generalized Entropy 
gme.sha 
Example of generalized entropy estimation (pp. 219222). 
Chapter 19. Generalized Least Squares 
glsar1.sha 
Example of generalized least squares estimation for the model with AR(1) errors (pp. 226228). 
Chapter 20. Heteroskedastic Models 
hetreg.sha 
Multiplicative Heteroskedasticity
Data file : credit.txt

Chapter 21. Maximum Likelihood Estimation of NonNormal Models 
poisson.sha 
Poisson regression. 
mlebeta.sha 
Models with BetaDistributed Dependent Variables
Data file : soss.txt

Chapter 22. Nonlinear Regression 
nlces.sha 
Estimation of a CES production function and testing for autocorrelated errors (p. 257).

maxfunc.sha 
Maximizing a function of a single variable (p. 257). 
nlsure.sha 
Nonlinear seemingly unrelated regression applied to the estimation of a linear expenditure system (p. 258).

sysnl.sha 
N2SLS, N3SLS and GMM estimation applied to Klein's Model I (pp. 260268).
Also see system.sha.
Data file : klein.txt

Examples of the LOGDEN option: 
mhet.sha 
Estimation of the multiplicative heteroskedastic error model. 
boxhet.sha 
Maximum likelihood estimation of BoxCox models with heteroskedasticity. 
poisnl.sha 
Poisson regression. Note that Poisson regression is implemented with the MLE command as shown
in the command file poisson.sha.

tobithet.sha 
Tobit model with heteroskedasticity.
Data file : mroz.txt 
homeown.sha 
Analysis of Proportions Data

Chapter 23. Nonparametric Methods 
nonpar.sha 
Nonparametric regression of a nonlinear function (pp. 279280).

semipar.sha 
Robinson's semiparametric regression. 
Chapter 24. Pooled CrossSection TimeSeries 
pool.sha 
Estimation methods available with the POOL command (pp. 289292). 
poolfc.sha 
Forecasting with timeseries crosssection data.

poolec.sha 
Pooling with error components  an example of programming in SHAZAM.

Chapter 25. Probit and Logit Regression 
logit.sha 
Logit model estimation  comparisons with the probit model are also shown (pp. 300301).
Data file : school.txt 
probit.sha 
Probit model estimation and Heckit procedure (pp. 302304).
Data file : mroz.txt 
logitw.sha 
Weighted Logit estimation

Chapter 26. Robust Estimation 
lad.sha 
Least Absolute Error estimation.
Calculation of bootstrap standard errors is also shown.
Data file : industry.txt

Chapter 27. TimeVarying Linear Regression 
fls.sha 
Flexible least squares simulation experiment from Kalaba and Tesfatsion (pp. 313314).

Chapter 28. Tobit Regression 
tobit.sha 
Tobit regression (pp. 321322).
Data file : judge19.txt

tobitm.sha 
Calculating marginal effects for Tobit models including the McDonald and Moffitt (1980) decomposition.
Data file : judge19.txt

Chapter 29. TwoStage Least Squares and Systems of Equations 
system.sha 
Estimation of Klein's Model I by 2SLS and 3SLS (pp. 325326 and pp. 335337).
Data file : klein.txt

hetcov.sha 
Computation of heteroskedasticityconsistent standard errors for 2SLS estimation.
Data file : klein.txt

Chapter 30. Data Smoothing, Moving Averages and Seasonal Adjustment 
smooth.sha 
Seasonal adjustment (p. 342). 
expsmth.sha 
Moving averages and exponential smoothing. 
Chapter 31. Financial Time Series 
stock.sha 
Chart of stock market prices (pp. 349350).
Data file : spy.txt

portfol.sha 
Portfolio selection problem (pp. 353355).
Data file : p.txt

eurocall.sha 
Pricing European call options (pp. 358359). 
bsprice.sha 
BlackScholes formula for a call option price, put option price and implied volatility. 
Chapter 32. Linear Programming 
lp.sha 
Linear Programming (pp. 362364). 
Chapter 33. Matrix Manipulation 
matrix.sha 
Matrix operations (p. 366). 
matols.sha 
OLS estimation with the MATRIX command (p. 370). 
Chapter 34. Price Indexes 
prindex.sha 
Computing price indexes (p. 376). 
Chapter 35. Principal Components and Factor Analysis 
pcomp.sha 
Example of multicollinearity diagnostics and principal components regression (pp. 381382). 
Chapter 36. Probability Distributions 
pvalue.sha 
Calculating pvalues for test statistics (pp. 394395). 
distchi.sha 
Calculating probabilities for chisquare (p. 395). 
distf.sha 
Calculating probabilities for noncentral F (pp. 395396). 
Chapter 37. Sorting Data 
wreplace.sha 
Sampling Without Replacement (p. 77).

Chapter 40. Programming in SHAZAM 
splice.sha 
Splicing price index series (p. 417). 
power.sha 
Computing the power of a test (pp. 418420). 
ridge.sha 
Ridge Regression. (pp. 420422). 
nlsroc.sha 
Nonlinear least squares by the rank one correction method (pp. 426427). 
mcarlo.sha 
Monte Carlo experiments (pp. 428430). 
boot.sha 
Bootstrapping regression coefficients (pp. 430432). 
olscov.sha 
Estimating the variance of the OLS estimator in the presence of heteroskedastic errors or autocorrelated errors (pp. 432434). 
hausman.sha 
Hausman specification test for errors in variables (pp. 434435). 
nonnest.sha 
NonNested model testing (pp. 435438). 
solve.sha 
Solving nonlinear sets of equations (pp. 438439). 
mnlogit.sha 
Multinomial logit estimation (pp. 440442). 
More Examples 
window.sha 
Performing a regression with a moving window. 
cor.sha 
Computing pvalues for correlation coefficients. 
archprog.sha 
ARCH estimation using Engle's algorithm. 
vif.sha 
Computation of Variance Inflation Factors as an indicator of the severity of multicollinearity. 
probelas.sha 
Computing elasticities from probit estimation when variables have been logtransformed.
Also see logit.sha.
Data file : school.txt

bvprob.sha 
Bivariate Probit models  Testing for zero error correlation by computing a Lagrange multiplier test statistic.
Data file : school.txt

fiml.sha 
Full information maximum likelihood  Klein Model I.
Data file : klein.txt

Chapter 41. SHAZAM Procedures 
sqrta.prc
sqrtm.prc 
Square root of a matrix (pp. 448449) using:
 an eigenvaluevector decomposition
 the GolubVan Loan procedure
Command file : sqrtm.sha

bs.prc
impvol.prc 
BlackScholes option pricing and implied
volatility (pp. 451454).
Command file : bsvol.sha
Note that BlackScholes option pricing is implemented with the CALL and PUT commands as shown
in the command file bsprice.sha. 
liml.prc 
Limited information maximum likelihood (pp. 454457).
Command file : liml.sha
Data file : klein.txt

multi.prc 
Generating multivariate random numbers (pp. 457459).
Command file : multi.sha

More Procedures 
dwpvalue.prc 
Calculation of a pvalue for the DurbinWatson statistic
Command file : dwpvalue.sha

gauss.prc 
Nonlinear equation estimation by the GaussNewton method Command file : gauss.sha

granger.prc 
Testing for Granger causality
Command file : granger.sha
Data file : judge18.txt
Granger causality tests are also available using the commands shown in gcause.sha. 
huf.prc 
Robinson's heteroskedasticity of unknown form estimator
Command file : huf.sha

qr.prc
hh.prc 
Solving OLS with the Householder transformation
Command file : qr.sha

randcoef.prc 
Random coefficients models  pooled timeseries crosssection data.
Command file : rand.sha

seasroot.prc 
Tests for seasonal unit roots
Command file : seas.sha
Data file : gdpcan.txt

stest.prc 
Stationarity tests proposed by Leybourne and McCabe
Command file : stest.sha
Data file : citibase.txt Data file description: citibase.html

ols.prc 
Replication of the SHAZAM OLS command.
Command file : ols.sha
