Output Options Examples References
ANALYZ computes the values and estimated covariance matrix for a set of (nonlinear) functions of the parameters estimated by the most recent OLSQ, LIML, LSQ, FIML, PROBIT, etc. procedure. It also computes the Wald test for the hypothesis that the set of functions are jointly zero. If the functions are linear, after an OLSQ command, the F test of the restrictions, and implied restricted original coefficients will be printed. ANALYZ can also be used to compute values and standard errors for function of parameters and series; in this case the result will be two series, one containing the values corresponding to each observation, and the other the standard errors.
The method used linearizes the nonlinear functions around the estimated parameter values and then uses the standard formulas for the variance and covariance of linear functions of random variables. See the references for further discussion of this "delta method". TSP obtains analytic derivatives internally for the nonlinear functions. ANALYZ can also be used to select/reorder a subset of a VCOV matrix and COEF vector, for use in making a Hausman specification test.
ANALYZ (COEF=<input parameter vector>, HALTON, NAMES=(<list of names>), NDRAW=<number of draws>, PRINT, PRMEAN, PRSERIES, SILENT, VCOV=<matrix name>) <list of equation names> ;
Usage
ANALYZ is followed by a list of equation (FRML) names. After estimation procedures with linear models (OLSQ, INST, LIML, PROBIT, ...), these equations specify functions of the estimated coefficients which are to be computed by referring to the coefficients by the names of the associated variables. After estimation procedures with nonlinear models (LSQ and FIML), the equations specify functions of the estimated parameters. ANALYZ has no provision for combining the variances from more than one estimation, because it cannot obtain the associated covariance of the coefficient estimates. The equations must be previously defined by FRML statements; if the FRML statements have variable names on the left hand side, the computed value of each function will be stored under that variable name.
If series names (other than the names of right hand side variables from the previous OLSQ, INST, LIML, or PROBIT estimation) are included in the FRML(s), a series of values will result. One application for this kind of FRML is an elasticity which depends on estimated parameters, and also on data such as income. ANALYZ will compute the standard errors for such a FRML using the covariance matrix of the estimated parameters, and treating the data as fixed constants. See the example below of computing an elasticity series.
If the PRINT option is on, ANALYZ prints a title, the names of the input parameters, the equations in symbolic form, a table of the derived functions and their standard errors, and the chi-squared value of a test that the functions are jointly zero. This chi-squared has degrees of freedom equal to the number of equations. The P-value (significance level) for the chi-squared test is also printed. If the print option is off (the default), only the derived functions and the chi-squared test are printed.
ANALYZ also stores the calculated parameters and their variances in data storage as though they were estimation results, whether or not the PRINT option is on. The results are stored under the following names.
|
variable |
type |
length |
description |
|
@RNMSA |
list |
#eqs |
Names of derived parameters. |
|
@WALD |
scalar |
1 |
Value of Wald test. |
|
@NCOEFA |
scalar |
1 |
Number of derived parameters. |
|
@NCIDA |
scalar |
1 |
Degrees of freedom. |
|
%WALD |
scalar |
1 |
P-value (significance) of Wald test. |
|
@COEFA |
vector |
#eqs |
Values of derived parameters. |
|
@SESA |
vector |
#eqs |
Standard errors of derived parameter. |
|
@TA |
vector |
#eqs |
T-statistics (asymptotically normal). |
|
%TA |
vector |
#eqs |
p-values corresponding to @TA |
|
@MSD |
matrix |
#eqs*8 |
Matrix of simulation results when NDRAW option is used. |
|
@VCOVA |
matrix |
#eqs*#eqs |
Estimated variance covariance of derived parameters. |
Method
Assume that a previous estimation in TSP has stored a vector of K parameter estimates b stored in @COEF and their variance covariance matrix Var(b) stored in @VCOV. Values and standard errors for the M functions f(b) are desired. To compute these, ANALYZ obtains the first derivatives of f with respect to b analytically:

The functions f(b) and the matrix G are evaluated at the current values of b and any constants or data values which may appear in f(b). The variance-covariance matrix for f(b) is then (asymptotically, or exactly if f(b) is linear in b) defined as

This is known as the "delta method". For example, if M=1 and f(b) = f1 = 2*b1, then G=2 (with zeros elsewhere if K>1), and Var(f1) = 4*Var(b1) .
If the equations are linear, and an OLSQ command was used for estimation, ANALYZ prints the F-statistic for the set of joint restrictions (@FST = @WALD/@NCIDA). In addition, ANALYZ computes and prints the implied restricted original coefficients and their standard errors. These are stored under @COEFC, @VCOVC, etc.
COEF= vector containing the values of the parameters in the equations to be analyzed. This vector should correspond to the parameters listed in the NAMES= option, and also to the supplied VCOV matrix. The default is @COEF.
HALTON specifies that a (shuffled) Halton sequence is used for the random draws when the NDRAW option is given. This provides more uniform coverage of the range of values, so it may yield more accurate integration for a given number of draws.
NAMES= specifies an optional list of parameter names which are the labels for an associated covariance matrix supplied by the VCOV= option. The default is @RNMS.
NDRAW=n computes asymmetric confidence intervals for nonlinear functions by drawing n simulated parameter vectors. These functions can vary over time as well. This is an alternative to the default "delta method" which uses derivatives and is exact for linear functions. The percentiles 2.5% and 97.5% are computed, to construct a two-tailed confidence interval at the 95% significance level. A matrix named @MSD with columns SE T LB2.5% UB97.5% MEAN MIN MAX NUM_GOOD is stored. NUM_GOOD is the number of nonmissing results computed. Numeric errors such as division by zero result in missing values. When ANALYZ is used with series and NDRAW, the results are stored in series whose names are the name of the parameter computed followed by _SE _T _LB _UB _MEAN _MIN _MAX _NG. See the Examples for an illustration.
PRINT/NOPRINT tells whether or not the ANALYZ input is to be printed. Under the default, NOPRINT, only the results are printed.
PRMEAN/NOPRMEAN tells whether summary statistics (mean, standard deviation, minimum, maximum, and median) are to be computed for the derived series when ANALYZ is used on equations containing series. PRMEAN is true by default.
PRSERIES/NOPRSERIES tells whether the computed series are to be printed when ANALYZ is used on equations containing series. The default for PRSERIES is TRUE when the number of observations is less than or equal to 100 and FALSE otherwise.
SILENT/NOSILENT specifies that no output is to be produced. The results are stored under the names @RNMSA, @COEFA, etc. Note that REGOPT(NOPRINT) COEF; is also needed, to suppress printing of the table of coefficients.
VCOV= specifies the name of a variance-covariance matrix of the input parameters (whose names are given by NAMES=). The use of these two options enables one to do an ANALYZ on matrices other than the @VCOV matrix from a standard estimation procedure. The default is @VCOV.
Obtain "long-run" coefficients for models with lagged dependent variables:
FRML LR1 ALPHALR = ALPHA/(1-LAMBDA) ;
FRML LR2 PHILR = PHI/(1-PSI) ;
ANALYZ LR1,LR2 ;
See the EQSUB command for an example of using ANALYZ (with EQSUB) to evaluate and obtain standard errors for restricted parameters in a translog system.
The next example shows how to calculate an elasticity (and its standard errors) when the elasticity changes over the sample.
FRML EQ1 LQ1 = A1 + B1*LP1 + B2*LP2 + B12*LP1*LP2 +
B13*LP1*LP3 + B23*LP2*LP3;
FRML EL1 ELD1 = B1 + B12*LP2 + B13*LP3; ? d(LQ1)/d(LP1)
SMPL 48,95;
LSQ EQ1;
? Obtain and plot elasticity for each year between 1948 and 1995:
SMPL 48,95;
ANALYZ (NOPRSER) EL1;
PLOT ELD1 ;
? Compute the average elasticity and its average s.e. - not needed in v5.1 and later, as this is automatic.
MSD ELD1 ELD1_SE ;
Here is an example of using ANALYZ after OLSQ. It computes a chi-squared test of the hypothesis that the sum of the two coefficients is zero (this test statistic equals the standard F-statistic).
OLSQ Y C X1 X2 ;
FRML SUM X1+X2 ;
ANALYZ SUM ;
Suppose that we want to extract a few parameters and their associated VCOV matrix from a system with a large number of parameters in arbitrary order:
SUPRES COEF;
LSQ (SILENT) EQ1-EQ50; ? estimation with a large number of equations
SUPRES;
DOT B1-B5;
FRML EQ. . = . ; ? construct FRML EQB1 B1 = B1; etc.
ENDDOT;
ANALYZ EQB1-EQB5; ? print results for 5 of the parameters only
RENAME @VCOVA VCVB1_5; ? for use later
RENAME @COEFA CB1_B5;
Here is an example using random draws to compute asymmetric confidence intervals:
FRML EQ1 Y = A+B*X;
LSQ EQ1;
FRML EQS SUM = A+B;
FRML EQR RATIO = A/B;
ANALYZ(NDRAW=500) EQS EQR;
In this example, the scalars SUM and RATIO will be stored, and eight statistics on the 500 computations of the two functions will be printed and stored in the 2 x 8 matrix @MSD.
An example of series output and random draws:
PROBIT D C X;
FRML EQP P = CNORM(A+B*X);
ANALYZ(NDRAW=200,NAMES=(A,B)) EQP;
In this example the series P P_SE P_T P_LB P_UB P_MEAN P_MIN P_MAX P_NG will be stored and printed.
Bishop, Y. M. M., S. E. Fienberg, and P. W. Holland, Discrete Multivariate Analysis: Theory and Practice, MIT Press, Cambridge, MA, 1975, pp. 486-502.
Gallant, A. Ronald, and Dale Jorgenson, "Statistical Inference for a System of Simultaneous, Non-linear, Implicit Equations in the Context of Instrumental Variable Estimation", Journal of Econometrics 11, 1979, pp. 275-302.
Gallant, A. Ronald, and Alberto Holly, "Statistical Inference in an Implicit, Nonlinear, Simultaneous Equation Model in the Context of Maximum Likelihood Estimation", Econometrica 48, 1980, pp. 697-720.