EXPAND Procedure

OUTEST= Data Set

The OUTEST= data set contains the coefficients of the spline curves fit to the input series. The OUTEST= data set is of interest if you want to verify the interpolating curve PROC EXPAND uses, or if you want to use this function in another context, (for example, in a SAS/IML program).

The OUTEST= data set contains the following variables:

  • the BY variables, if any

  • VARNAME, a character variable containing the name of the input variable to which the coefficients apply

  • METHOD, a character variable containing the value of the METHOD= option used to fit the series

  • OBSERVED, a character variable containing the first letter of the OBSERVED= option name for the input series

  • the ID variable that contains the lower breakpoint (or "knot") of the spline segment to which the coefficients apply. The ID variable has the same name as the variable used in the ID statement. If an ID statement is not used, but the FROM= option is used, then the name of the ID variable is DATE or DATETIME, depending on whether the FROM= option indicates SAS date or SAS datetime values. If neither an ID statement nor the FROM= option is used, the ID variable is named TIME.

  • CONSTANT, the constant coefficient for the spline segment

  • LINEAR, the linear coefficient for the spline segment

  • QUAD, the quadratic coefficient for the spline segment

  • CUBIC, the cubic coefficient for the spline segment

For each BY group, the OUTEST= data set contains observations for each polynomial segment of the spline curve fit to each input series. To obtain the observations defining the spline curve used for a series, select the observations where the value of VARNAME equals the name of the series.

The observations for a series in the OUTEST= data set encode the spline function fit to the series as follows. Let a Subscript i Baseline comma b Subscript i Baseline comma c Subscript i Baseline comma and d Subscript i be the values of the variables CUBIC, QUAD, LINEAR, and CONSTANT, respectively, for the ith observation for the series. Let x Subscript i be the value of the ID variable for the ith observation for the series. Let n be the number of observations in the OUTEST= data set for the series. The value of the spline function evaluated at a point x is

f left-parenthesis x right-parenthesis equals a Subscript i Baseline left-parenthesis x minus x Subscript i Baseline right-parenthesis cubed plus b Subscript i Baseline left-parenthesis x minus x Subscript i Baseline right-parenthesis squared plus c Subscript i Baseline left-parenthesis x minus x Subscript i Baseline right-parenthesis plus d Subscript i

where the segment number i is selected as follows:

i equals StartLayout Enlarged left-brace 1st Row 1st Column i 2nd Column x Subscript i Baseline less-than-or-equal-to x less-than x Subscript i plus 1 Baseline comma 1 less-than-or-equal-to i less-than n 2nd Row 1st Column 1 2nd Column x less-than x 1 3rd Row 1st Column n 2nd Column x greater-than-or-equal-to x Subscript n EndLayout

In other words, if x is between the first and last ID values (x 1 less-than-or-equal-to x less-than x Subscript n), use the observation from the OUTEST= data set with the largest ID value less than or equal to x. If x is less than the first ID value x 1, then i equals 1. If x is greater than or equal to the last ID value (x greater-than-or-equal-to x Subscript n), then i equals n.

For METHOD=JOIN, the curve is a linear spline, and the values of CUBIC and QUAD are 0. For METHOD=STEP, the curve is a constant spline, and the values of CUBIC, QUAD, and LINEAR are 0. For METHOD=AGGREGATE, no coefficients are output.

Last updated: June 19, 2025