The MODEL Procedure |
RANGE Statement |
The RANGE statement specifies the range of observations to be read from the DATA= data set. For FIT tasks, the RANGE statement controls the period of fit for the estimation. For SOLVE tasks, the RANGE statement controls the simulation period or forecast horizon.
The RANGE variable must be a numeric variable in the DATA= data set that identifies the observations, and the data set must be sorted by the RANGE variable. The first observation in the range is identified by first, and the last observation is identified by last.
PROC MODEL uses the first l observations prior to first to initialize the lags, where l is the maximum number of lags needed to evaluate any of the equations to be fit or solved, or the maximum number of lags needed to compute any of the instruments when an instrumental variables estimation method is used. There should be at least l observations in the data set before first. If last is not specified, all the nonmissing observations starting with first are used.
If first is omitted, the first l observations are used to initialize the lags, and the rest of the data, until last, is used. If a RANGE statement is used but both first and last are omitted, the RANGE statement variable is used to report the range of observations processed.
The RANGE variable should be nonmissing for all observations. Observations that contain missing RANGE values are deleted.
The following are examples of RANGE statements:
range year = 1971 to 1988; /* yearly data */ range date = '1feb73'd to '1nov82'd; /* monthly data */ range time = 60.5; /* time in years */ range year to 1977; /* use all years through 1977 */ range date; /* use values of date to report period-of-fit */
If no RANGE statements follow multiple FIT statements and a single RANGE statement is declared before all the FIT statements, estimation in each of the multiple FIT statements is based on the data specified in the single RANGE statement. A single RANGE statement following multiple FIT statements affects only the fit immediately preceding it.
If the FIT statement is both followed by and preceded by RANGE statements, the following RANGE statement takes precedence over the preceding RANGE statement.
In the case where a range of data is to be used for a particular SOLVE task, the RANGE statement should be specified following the SOLVE statement in the case of either single or multiple SOLVE statements.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.