Chapter Contents 
Previous 
Next 
The MODEL Procedure 
Parameter values read from the ESTDATA= data set provide initial starting values for parameters estimated. Observations providing covariance values, if any are present in the ESTDATA= data set, are ignored.
The ESTDATA= data set is usually created by the OUTEST= option in a previous FIT statement. You can also create an ESTDATA= data set with a SAS DATA step program. The data set must contain a numeric variable for each parameter to be given a value or covariance column. The name of the variable in the ESTDATA= data set must match the name of the parameter in the model. Parameters with names longer than eight characters cannot be set from an ESTDATA= data set. The data set must also contain a character variable _NAME_ of length 8. _NAME_ has a blank value for the observation that gives values to the parameters. _NAME_ contains the name of a parameter for observations defining rows of the covariance matrix.
More than one set of parameter estimates and covariances can be stored in the ESTDATA= data set if the observations for the different estimates are identified by the variable _TYPE_. _TYPE_ must be a character variable of length 8. The TYPE= option is used to select for input the part of the ESTDATA= data set for which the _TYPE_ value matches the value of the TYPE= option.
The following SAS statements generate the ESTDATA= data set shown in Figure 14.55. The second FIT statement uses the TYPE= option to select the estimates from the GMM estimation as starting values for the FIML estimation.
/* Generate test data */ data gmm2; do t=1 to 50; x1 = sqrt(t) ; x2 = rannor(10) * 10; y1 = .002 * x2 * x2  .05 / x2  0.001 * x1 * x1; y2 = 0.002* y1 + 2 * x2 * x2 + 50 / x2 + 5 * rannor(1); y1 = y1 + 5 * rannor(1); z1 = 1; z2 = x1 * x1; z3 = x2 * x2; z4 = 1.0/x2; output; end; run; proc model data=gmm2 ; exogenous x1 x2; parms a1 a2 b1 2.5 b2 c2 55 d1; inst b1 b2 c2 x1 x2; y1 = a1 * y2 + b1 * x1 * x1 + d1; y2 = a2 * y1 + b2 * x2 * x2 + c2 / x2 + d1; fit y1 y2 / 3sls gmm kernel=(qs,1,0.2) outest=gmmest; fit y1 y2 / fiml type=gmm estdata=gmmest; run; proc print data=gmmest; run;
The option MISSING=PAIRWISE specifies that missing values are tracked on an equationbyequation basis. The MISSING=DELETE option specifies that the entire observation is omitted from the analysis when any equation has a missing predicted or actual value for the equation. The default is MISSING=DELETE.
When you specify the MISSING=PAIRWISE option, the S matrix is computed as
where D is a diagonal matrix that depends on the VARDEF= option, the matrix R is (r_{1}, ... ,r_{g}), and r_{i} is the vector of residuals for the ith equation with r_{ij} replaced with zero when r_{ij} is missing.
For MISSING=PAIRWISE, the calculation of the diagonal element d_{i,i} of D is based on n_{i}, the number of nonmissing observations for the ith equation, instead of on n or, for VARDEF=WGT or WDF, on the sum of the weights for the nonmissing observations for the ith equation instead of on the sum of the weights for all observations. Refer to the description of the VARDEF= option for the definition of D.
The degrees of freedom correction for a shared parameter is computed using the average number of observations used in its estimation.
The MISSING=PAIRWISE option is not valid for the GMM and FIML estimation methods.
For the instrumental variables estimation methods (2SLS, 3SLS), when an instrument is missing for an observation, that observation is dropped for all equations, regardless of the MISSING= option.
Together, the OUTPARMS= and PARMSDATA= options allow you to change part of a model and recompile the new model program without the need to reestimate equations that were not changed.
Suppose you have a large model with parameters estimated and you now want to replace one equation, Y, with a new specification. Although the model program must be recompiled with the new equation, you don't need to reestimate all the equations, just the one that changed.
Using the OUTPARMS= and PARMSDATA= options, you could do the following:
proc model model=oldmod outparms=temp; run; proc model outmodel=newmod parmsdata=temp data=in; ... include new model definition with changed y eq. here ... fit y; run;
The model file NEWMOD will then contain the new model and its estimated parameters plus the old models with their original parameter values.
Most often, the SDATA= data set has been created by the OUTS= or OUTSUSED= option on a previous FIT statement. The OUTS= and OUTSUSED= data sets from a FIT statement can be read back in by a FIT statement in the same PROC MODEL step.
You can create an input SDATA= data set using the DATA step. PROC MODEL expects to find a character variable _NAME_ in the SDATA= data set as well as variables for the equations in the estimation or solution. For each observation with a _NAME_ value matching the name of an equation, PROC MODEL fills the corresponding row of the S matrix with the values of the names of equations found in the data set. If a row or column is omitted from the data set, a 1 is placed on the diagonal for the row or column. Missing values are ignored, and since the S matrix is symmetric, you can include only a triangular part of the S matrix in the SDATA= data set with the omitted part indicated by missing values. If the SDATA= data set contains multiple observations with the same _NAME_, the last values supplied for the _NAME_ are used. The structure of the expected data set is further described in the "OUTS=Data Set" section.
Use the TYPE= option on the PROC MODEL or FIT statement to specify the type of estimation method used to produce the S matrix you want to input.
The following SAS statements are used to generate an S matrix from a GMM and a 3SLS estimation and to store that estimate in the data set GMMS:
proc model data=gmm2 ; exogenous x1 x2; parms a1 a2 b1 2.5 b2 c2 55 d1; inst b1 b2 c2 x1 x2; y1 = a1 * y2 + b1 * x1 * x1 + d1; y2 = a2 * y1 + b2 * x2 * x2 + c2 / x2 + d1; fit y1 y2 / 3sls gmm kernel=(qs,1,0.2) outest=gmmest outs=gmms; run;
The data set GMMS is shown in Figure 14.56.

Normally the VDATA= matrix is created from the OUTV= option on a previous FIT statement. Alternately an input VDATA= data set can be created using the DATA step. Each row and column of the V matrix is associated with an equation and an instrument. The position of each element in the V matrix can then be indicated by an equation name and an instrument name for the row of the element and an equation name and an instrument name for the column. Each observation in the VDATA= data set is an element in the V matrix. The row and column of the element are indicated by four variables EQ_ROW, INST_ROW, EQ_COL, and INST_COL which contain the equation name or instrument name. The variable name for an element is VALUE. Missing values are set to 0. Because the variance matrix is symmetric, only a triangular part of the matrix needs to be input.
The following SAS statements are used to generate a V matrix estimation from GMM and to store that estimate in the data set GMMV:
proc model data=gmm2 ; exogenous x1 x2; parms a1 a2 b2 b1 2.5 c2 55 d1; inst b1 b2 c2 x1 x2; y1 = a1 * y2 + b1 * x1 * x1 + d1; y2 = a2 * y1 + b2 * x2 * x2 + c2 / x2 + d1; fit y1 y2 / gmm outv=gmmv; run;
The data set GMM2 was generated by the example in the preceding ESTDATA= section. The V matrix stored in GMMV is selected for use in an additional GMM estimation by the following FIT statement:
fit y1 y2 / gmm vdata=gmmv; run; proc print data=gmmv(obs=15); run;
A partial listing of the GMMV data set is shown in Figure 14.57. There are a total of 78 observations in this data set. The V matrix is 12 by 12 for this example.

Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.