Overview (CREATE command)
CREATE
produces
new series as a function of existing series. You can also use CREATE
to replace the values of existing
series.
CREATE
displays
a list of the new series, the case numbers of the first and last nonmissing
cases, the number of valid cases, and the functions used to create
the variables.
Basic specification
The basic specification is a new series name, an equals sign, a function, and the existing series, along with any additional specifications needed.
Syntax rules
- The existing series together with any additional specifications (order, span, or periodicity) must be enclosed in parentheses.
- The equals sign is required.
- Series names and additional specifications must be separated by commas or spaces.
- You can specify only one function per equation.
- You can create more than one new series per equation by specifying more than one new series name on the left side of the equation and either multiple existing series names or multiple orders on the right.
- The number of new series named on the left side of the equation must equal the number of series
created on the right. Note that the
FFT
function creates two new series for each existing series, andIFFT
creates one series from two existing series. - You can specify more than one equation on a
CREATE
command. Equations are separated by slashes. - A newly created series can be specified in subsequent equations on the same
CREATE
command.
Operations
- Each new series created is added to the active dataset.
- If the new series named already exist, their values are replaced.
- If the new series named do not already exist, they are created.
- Series are created in the order in which they are specified on the
CREATE
command. - If multiple series are created by a single equation, the first new series named is assigned the values of the first series created, the second series named is assigned the values of the second series created, and so on.
-
CREATE
automatically generates a variable label for each new series describing the function and series used to create it. - The format of the new series is based on the function specified and the format of the existing series.
-
CREATE
honors theTSET MISSING
setting that is currently in effect. - If split file processing is on, the scope is limited to each split group. A new value cannot be created from a case in a preceding or subsequent split group.
-
CREATE
does not honor theUSE
command. - When an even-length span is specified for the functions
MA
andRMED
, the centering algorithm uses an average of two spans of the specified length. The first span ranges from span/2 cases before the current observation to the span length. The second span ranges from (span/2)−1 cases before the current observation to the span length.
Limitations
- A maximum of 1 function per equation.
- There is no limit on the number of series created by an equation.
- There is no limit on the number of equations.