Aggregation Action Set: Syntax
Provides actions for aggregating the values of one or more variables
aggregate Action
Performs aggregation on selected variables.
| Examples: | Aggregate Data on Selected Columns |
| Aggregate Data on Selected Columns by Groups | |
| Aggregate Data on Selected Columns by Date Intervals | |
| Perform a Rolling Window Aggregation |
Summary: Input and Output Tables
If a row includes a subparameter, you can specify the name, caslib, and so on in the subparameter. Otherwise, you can specify the name, caslib, and so on in the parameter.
|
Parameter |
Subparameter |
Description |
|---|---|---|
|
required parametertable |
— |
specifies the table name, caslib, and other common parameters. |
|
Parameter |
Subparameter |
Description |
|---|---|---|
|
— |
specifies the settings for an output table. |
Parameter Descriptions
align="BEGINNING" | "ENDING" | "MIDDLE"
bin={double-1 <, double-2, ...>}
specifies the minimum and maximum values of a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, then the action constructs a time series with 11 bins. The first bin is [-5, 5] and the last bin is [95, 105]. The values on the upper boundary of a bin belong to this bin. The values on the lower boundary of a bin belong to the adjacent lower bin. This parameter is ignored unless you also specify an ID variable.
casOut={casouttable}
specifies the settings for an output table.
For more information about specifying the casOut parameter, see the common casouttable parameter.
contribute="variable-name"
when the doESP parameter is True, you can specify a variable whose values within each aggregation interval are recorded. The value can be used as a key to join with the original table in order to understand each row contribution toward the aggregated interval.
contributeColumnLabel="string"
specifies a value to override the variable label from the contribute variable. By default, the contribute variable's label is shown in the results.
contributeColumnName="string"
specifies a value to override the variable name from the contribute variable. By default, the contribute variable's name is shown in the results.
contributeDelimiter="string"
specifies a delimiter that is used between concatenated values of the contribute variable.
| Alias | delimiter |
|---|---|
| Default | "," |
contributeTrim=TRUE | FALSE
when set to True, leading and trailing blanks are removed from the formatted value of the contribute variable. This parameter is ignored if the contributeUnroll parameter is set to True.
| Default | FALSE |
|---|
contributeUnroll=TRUE | FALSE
by default, the formatted values from the contribute variable are concatenated together into a single row for the result table. When set to True, each raw value from the contribute variable adds a row to the result table.
| Alias | unroll |
|---|---|
| Default | FALSE |
copyVars={"variable-name-1" <, "variable-name-2", ...>}
specifies the variables to copy from the input table to the output table. The raw values are kept in the output. This parameter is ignored unless you also specify the groupBy parameter for the input table. When more than one record exists in a group, the minimum raw value is copied.
| Alias | copyVar |
|---|
doESP=TRUE | FALSE
when set to True, the action can take advantage of partitioning and ordering on the input table. You must specify the groupBy parameter for the input table. The ID variable must be specified as the last groupBy parameter and in the orderBy parameter. Setting this parameter to True implies setting the keepRecord parameter to True. When set to False (the default value), the keepRecordId, excludeSelf, contribute, contributeColumnName, contributeTrim, contributeDelimiter, and contributeUnroll parameters are ignored.
| Alias | partAndOrder |
|---|---|
| Default | FALSE |
edgeId="variable-name"
specifies a numeric variable whose values are used to order the values of each varSpecs specification that uses the FIRST, LAST, FNE, or LNE aggregator. This parameter can be overridden in a varSpecs specification that includes an edgeId subparameter.
exclnpwgt=TRUE | FALSE
when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis.
| Alias | excludeNonPositiveWeight |
|---|---|
| Default | FALSE |
excludeSelf=TRUE | FALSE
when set to True and the doESP parameter is True, the aggregation excludes the current observation's contribution.
| Default | FALSE |
|---|
freq="variable-name"
specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used.
| Alias | frequency |
|---|
freqStrict=TRUE | FALSE
this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded.
| Default | TRUE |
|---|
groupByLimit=64-bit-integer
specifies the maximum number of levels in a group-by set. When the server determines this number of levels, the server stops and does not return a result. Specify this parameter if you want to avoid creating large result sets in group-by operations.
| Minimum value | 1 |
|---|
groupedIntervalOutput=TRUE | FALSE
when set to True, save only one of the same aggregated intervals with respect to the last Id value. The option is ignored if 'doESP' is set to False.
| Default | FALSE |
|---|
id="variable-name"
specifies a numeric variable that identifies the timestamp that is associated with each observation in the input table. The values are typically SAS DATE, TIME, or DATETIME values, but that is not required. The specified variable must also be specified in the groupBy parameter for the input table.
idEnd=double
specifies the inclusive maximum value of the ID variable to be considered in the analysis. If the maximum value of the ID variable is less than the idEnd value, the series is extended with missing values. If the last ID variable value is greater than the idEnd value, the series is truncated. This parameter is ignored unless you also specify an ID variable.
idOutputName="string"
specifies the new name of the ID variable in the output table
idRange={double-1 <, double-2, ...>}
specifies the inclusive minimum and maximum values of the ID variable to be considered in the analysis. It is equivalent to specifying both idStart and idEnd.
idStart=double
specifies the inclusive minimum value of the ID variable to be considered in the analysis. If the minimum value of the ID variable is greater than the idStart value, then the series is prefixed with missing values. If the first ID variable value is less than the idStart value, then the series is truncated. This parameter is ignored unless you also specify an ID variable.
includeEmptyInterval=TRUE | FALSE
by default, intervals with a missing value for the ID variable are included in the output. When set to False, these intervals are excluded from the output.
| Aliases | includeMissInterval |
|---|---|
| includeMissingInterval | |
| Default | TRUE |
includeMissing=TRUE | FALSE
by default, missing values are included in the analysis. When set to False, observations with missing values are excluded.
| Aliases | includeMiss |
|---|---|
| incMissing | |
| incMiss | |
| Default | TRUE |
inputs={{casinvardesc-1} <, {casinvardesc-2}, ...>}
specifies the input variables to use in the analysis. For raw numeric variables, the default aggregator is SUMMARY. For all other situations, the default aggregator is N. You can specify variables in this parameter or exercise more control by specifying the varSpecs parameter, but you cannot use both.
For more information about specifying the inputs parameter, see the common casinvardesc parameter.
| Alias | input |
|---|
interval="string"
specifies the time period for the accumulation of observations. For example, if you specify interval='MONTH', then the action summarizes the observations in monthly intervals. This parameter is ignored unless you also specify an ID variable.
jumpingWindow=TRUE | FALSE
when set to True, specifies that aggregation occurs over a time window that can contain multiple intervals and aggregation is reset when the specified time range elapses. By default, a window always retains the same multiple of intervals.
| Alias | tumblingWindow |
|---|---|
| Default | FALSE |
keepRecord=TRUE | FALSE
when set to True, each observation's original value for the ID variable is kept without performing interval alignment.
| Default | FALSE |
|---|
keepRecordId=TRUE | FALSE
when set to True and the doESP parameter is True, each observation's original ID value is kept without performing interval alignment.
| Default | FALSE |
|---|
modeSingle=TRUE | FALSE
this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value.
| Default | FALSE |
|---|
offset=integer
specifies the offset of each interval. If you specify offset=-1, then every interval that is derived from the data set is shifted one interval backward. For example, a timestamp value for March 1 is derived from the data set to become February 1.
| Aliases | intOffset |
|---|---|
| dif | |
| intDif | |
| intOff | |
| Default | 0 |
partKey={"string-1" <, "string-2", ...>}
when the table is partitioned and you specify the partition parameter, you can specify a partition key so that the results are computed for the partition only.
pctlDef=integer
specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation.
| Default | 5 |
|---|---|
| Range | 1–5 |
pti=double
specifies the time value when the aggregation within an interval or a bin is terminated. For example, if you specify interval='MONTH' and partialToInterval='10FEB98'd, then the action aggregates only records from the first 10 days of each month.
| Aliases | ptd |
|---|---|
| partialToDate | |
| partialToInterval | |
| Default | 0 |
| Minimum value | 0 |
ptw=double
specifies the subinterval with respect to each window interval. For example, if you specify windowInterval='MONTH' and partialToWindow='08FEB98'd, then the action counts only the first 8 days from JANUARY and the first 8 days from FEBURARY when it aggregates on window interval FEBURARY, ..., DECEMBER each year. This parameter is ignored unless you also specify the jumpingWindow parameter because the starting time varies for a sliding window (a non-jumping window).
| Alias | partialToWindow |
|---|---|
| Default | 0 |
| Minimum value | 0 |
raw=TRUE | FALSE
when set to True, raw values of the variables in the input parameter are used.
| Default | FALSE |
|---|
saveGroupbyFormat=TRUE | FALSE
by default, the formatted values of the groupBy variables from the input table are copied to the results. When set to False, the formatted values are not copied.
| Alias | saveGbyFmt |
|---|---|
| Default | TRUE |
saveGroupbyRaw=TRUE | FALSE
by default, the raw values of the groupBy variables from the input table are copied to the results. When set to False, the raw values are not copied.
| Alias | saveGbyRaw |
|---|---|
| Default | TRUE |
saveVariableColumn=TRUE | FALSE
by default, the variable name for each analysis variable is included in the results. The result table includes the name in a column that is named 'Column.' When set to False, this column is not included in the results.
| Alias | saveVarCol |
|---|---|
| Default | TRUE |
saveVariableSpecification=TRUE | FALSE
by default, the results include a column that is named 'Variable Specification' to identify the varSpecs specification that produced the result. When set to False, this column is not included in the results.
| Alias | saveVarSpec |
|---|---|
| Default | TRUE |
subBinOffset=double
specifies an offset from the beginning of a bin. The value must be positive and less than or equal to the bin width. If the specified value is out of range, this parameter is ignored. This parameter is ignored unless you specify an ID variable and the bin parameter.
subBinWidth=double
specifies the width of the sub bin within a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, subBinOffset=2, and subBinWidth=5, then the action summarizes only the observations with ID variable values that fall into [-2, 3], [8, 13], [18, 23], ..., [98, 103]. The specified value must be positive and the sum of the subBinOffset value and subBinWidth value must be less than or equal to the bin width. If the value is out of range, this parameter is ignored. This parameter is ignored unless you also specify an ID variable and the bin parameter.
| Minimum value | 0 |
|---|
subInterval="string"
specifies a smaller interval to control the time period alignment within each interval for the aggregation of observations.
| Alias | subInt |
|---|
* table={castable}
specifies the table name, caslib, and other common parameters.
For more information about specifying the table parameter, see the common castable parameter.
varSpecs={{tkcasagg_varspecs-1} <, {tkcasagg_varspecs-2}, ...>}
specifies the variable to aggregate and the settings for the aggregator.
The tkcasagg_varspecs value can be one or more of the following:
agg="FIRST" | "FIRSTNOTEMPTY" | "LAST" | "LASTNOTEMPTY" | "MAXIMUM" | "MINIMUM" | "MODE" | "N" | "NDISTINCT" | "NMISS" | "NTOTAL" | "PERCENT" | "PERCENTILE" | "PGT" | "PLT" | "Q1" | "Q2" | "Q3" | "SUMMARY"
specifies the aggregator to apply to the analysis variable.
MODE
returns the most frequent value. You can specify the k parameter to return more than the most frequent values.
NDISTINCT
returns the number of distinct values. This is the default aggregator for character variables and numeric variables that have a format.
| Alias | NDIST |
|---|
PERCENT
returns the percentage of values in the range that is specified in the pRange or pStrRange parameter.
| Aliases | PIN |
|---|---|
| PCIN |
PGT
returns the percentage of values that are greater than the threshold specified in the pN or pStrN parameter.
| Alias | PCGT |
|---|
ciAlpha=double
specifies the level of significance for 100*(1-ciAlpha)% confidence intervals. The default value of 0.05 results in 95% confidence intervals.
| Default | 0.05 |
|---|---|
| Range | (0, 1) |
ciType="LOWER" | "TWOSIDED" | "UPPER"
specifies the type of confidence interval.
| Default | TWOSIDED |
|---|
LOWER
specifies to use the lower bound of where the true population mean is expected to lie, given the specified confidence.
| Alias | LEFT |
|---|
columnNames={"string-1" <, "string-2", ...>}
specifies replacement column names to use in the results. By default, the name of the analysis variable is used as a column name in the result tables.
| Aliases | colName |
|---|---|
| colNames | |
| Requirement | The specified values must be unique. |
edgeId="variable-name"
specifies a numeric variable whose values are used to order the values of the analysis variable. This parameter applies to the FIRST, LAST, FNE, or LNE aggregators. Specifying this parameter in a varSpec parameter overrides the setting for the action.
exclnpwgt=TRUE | FALSE
when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Alias | excludeNonPositiveWeight |
|---|---|
| Default | FALSE |
format="string"
specifies a temporary format for the analysis variable.
formats={"string-1" <, "string-2", ...>}
specifies a temporary format for the analysis variable.
freq="variable-name"
specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Alias | frequency |
|---|
freqStrict=TRUE | FALSE
this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Default | TRUE |
|---|
includeMissing=TRUE | FALSE
by default, missing values are included in the analysis. When set to False, observations with missing values are excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Aliases | includeMiss |
|---|---|
| incMissing | |
| incMiss | |
| Default | TRUE |
k=integer
specifies the number of the most frequent items to collect for the MODE aggregator.
| Default | 1 |
|---|---|
| Range | 1–MACINT |
missDbl=double
specifies the numeric value to use for replacing the missing values.
missStr="string"
specifies the character value to use for replacing the missing values.
modeSingle=TRUE | FALSE
this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Default | FALSE |
|---|
name="variable-name"
specifies the analysis variable name.
| Alias | var |
|---|
names={"variable-name-1" <, "variable-name-2", ...>}
specifies the analysis variable name.
| Alias | vars |
|---|
pctlDef=integer
specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Range | 1–5 |
|---|
percentile={double-1 <, double-2, ...>}
specifies the percentile to calculate when the aggregator is set to PERCENTILE.
| Aliases | percentiles |
|---|---|
| pctl | |
| pctls | |
| Requirement | The specified values must be unique. |
pN=double
specifies the numeric threshold for the PGT and PLT aggregators on a numeric variable.
pRange={double-1 <, double-2, ...>}
specifies the inclusive minimum and maximum values for the PIN aggregator on a numeric variable. It is equivalent to specifying both the pRangeMin and pRangeMax parameters.
pRangeMax=double
specifies the inclusive maximum value for the PIN aggregator on a numeric variable.
| Default | MACBIG |
|---|
pRangeMin=double
specifies the inclusive minimum value for the PIN aggregator on a numeric variable.
| Default | -MACBIG |
|---|
pStrN="string"
specifies the character threshold for the PGT and PLT aggregators on a character variable.
pStrRange={"string-1" <, "string-2", ...>}
specifies the inclusive minimum and maximum values for the PIN aggregator on a character variable. It is equivalent to specifying both the pStrRangeMin and pStrRangeMax parameters.
pStrRangeMax="string"
specifies the inclusive maximum value for the PIN aggregator on a character variable.
pStrRangeMin="string"
specifies the inclusive minimum value for the PIN aggregator on a character variable.
range={double-1 <, double-2, ...>}
specifies the inclusive minimum and maximum values of a numeric variable to be considered in the aggregation. It is equivalent to specifying both the rangeMin and rangeMax parameters.
rangeMax=double
specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.
| Default | MACBIG |
|---|
rangeMin=double
specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.
| Default | -MACBIG |
|---|
strRange={"string-1" <, "string-2", ...>}
specifies the inclusive minimum and maximum values of a character variable to be considered in the aggregation. It is equivalent to specifying both the strRangeMin and strRangeMax parameters.
strRangeMax="string"
specifies the inclusive maximum value of a character variable to be considered in the aggregation.
strRangeMin="string"
specifies the inclusive minimum value of a character variable to be considered in the aggregation.
summarySubset={"CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"}
specifies the summary statistics to generate. By default, the column order of the summary statistics is MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS, regardless of the order that you specify. If you want the columns returned in a particular order, be sure to provide a name for each results column using the columnNames parameter.
| Aliases | statistics |
|---|---|
| subSet | |
| Requirement | The specified values must be unique. |
weight="variable-name"
specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior. Specifying this parameter in a varSpec parameter overrides the setting for the action.
weight="variable-name"
specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior.
windowBin={double-1 <, double-2, ...>}
specifies the minimum and maximum values of a window bin. The specification and concepts are similar to the bin parameter, except the bins apply to intervals.
windowInt="string"
specifies the time window for the accumulation of observations with respect to each time interval. For example, if you specify interval='MONTH' and windowInt='YEAR', then the action summarizes one year's worth of observations in monthly intervals.
| Aliases | winInt |
|---|---|
| windowInterval |
windowOffset=integer
specifies the offset of each window interval. The effect is similar to how the offset parameter impacts the values for the interval parameter.
| Aliases | windowIntOffset |
|---|---|
| winDif | |
| winIntDif | |
| winIntOff | |
| windowIntervalOffset | |
| Default | 0 |
windowSubBinOffset=double
specifies the starting point within a window bin in which record values are aggregated. For example, if you specify windowBin={0, 10} and windowSubBinOffset=2, then records with ID variable values in the interval [0, 2) are ignored. The specified value must not be larger than the window bin's width.
| Alias | winSubBinOffset |
|---|
windowSubBinWidth=double
specifies the width of the sub bin within each windowBin. The minimum acceptable value is 0, which renders windows ineffective. For example, if you specify windowBin={0, 10}, windowSubBinOffset=2, and windowSubBinWidth=5, then records with ID variable values in the intervals [0, 2) and [7, 10) are ignored.
| Alias | winSubBinWidth |
|---|---|
| Minimum value | 0 |
windowSubInt="string"
this parameter is similar to subInterval. You can specify a smaller interval to control the sub time period alignment within each window interval for the aggregation of observations.
| Aliases | winSubInterval |
|---|---|
| winSubInt | |
| windowSubInterval |
aggregate Action
Performs aggregation on selected variables.
| Examples: | Aggregate Data on Selected Columns |
| Aggregate Data on Selected Columns by Groups | |
| Aggregate Data on Selected Columns by Date Intervals | |
| Perform a Rolling Window Aggregation |
Summary: Input and Output Tables
If a row includes a subparameter, you can specify the name, caslib, and so on in the subparameter. Otherwise, you can specify the name, caslib, and so on in the parameter.
|
Parameter |
Subparameter |
Description |
|---|---|---|
|
required parametertable |
— |
specifies the table name, caslib, and other common parameters. |
|
Parameter |
Subparameter |
Description |
|---|---|---|
|
— |
specifies the settings for an output table. |
Parameter Descriptions
align="BEGINNING" | "ENDING" | "MIDDLE"
bin={double-1 <, double-2, ...>}
specifies the minimum and maximum values of a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, then the action constructs a time series with 11 bins. The first bin is [-5, 5] and the last bin is [95, 105]. The values on the upper boundary of a bin belong to this bin. The values on the lower boundary of a bin belong to the adjacent lower bin. This parameter is ignored unless you also specify an ID variable.
casOut={casouttable}
specifies the settings for an output table.
For more information about specifying the casOut parameter, see the common casouttable parameter.
contribute="variable-name"
when the doESP parameter is True, you can specify a variable whose values within each aggregation interval are recorded. The value can be used as a key to join with the original table in order to understand each row contribution toward the aggregated interval.
contributeColumnLabel="string"
specifies a value to override the variable label from the contribute variable. By default, the contribute variable's label is shown in the results.
contributeColumnName="string"
specifies a value to override the variable name from the contribute variable. By default, the contribute variable's name is shown in the results.
contributeDelimiter="string"
specifies a delimiter that is used between concatenated values of the contribute variable.
| Alias | delimiter |
|---|---|
| Default | "," |
contributeTrim=true | false
when set to True, leading and trailing blanks are removed from the formatted value of the contribute variable. This parameter is ignored if the contributeUnroll parameter is set to True.
| Default | false |
|---|
contributeUnroll=true | false
by default, the formatted values from the contribute variable are concatenated together into a single row for the result table. When set to True, each raw value from the contribute variable adds a row to the result table.
| Alias | unroll |
|---|---|
| Default | false |
copyVars={"variable-name-1" <, "variable-name-2", ...>}
specifies the variables to copy from the input table to the output table. The raw values are kept in the output. This parameter is ignored unless you also specify the groupBy parameter for the input table. When more than one record exists in a group, the minimum raw value is copied.
| Alias | copyVar |
|---|
doESP=true | false
when set to True, the action can take advantage of partitioning and ordering on the input table. You must specify the groupBy parameter for the input table. The ID variable must be specified as the last groupBy parameter and in the orderBy parameter. Setting this parameter to True implies setting the keepRecord parameter to True. When set to False (the default value), the keepRecordId, excludeSelf, contribute, contributeColumnName, contributeTrim, contributeDelimiter, and contributeUnroll parameters are ignored.
| Alias | partAndOrder |
|---|---|
| Default | false |
edgeId="variable-name"
specifies a numeric variable whose values are used to order the values of each varSpecs specification that uses the FIRST, LAST, FNE, or LNE aggregator. This parameter can be overridden in a varSpecs specification that includes an edgeId subparameter.
exclnpwgt=true | false
when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis.
| Alias | excludeNonPositiveWeight |
|---|---|
| Default | false |
excludeSelf=true | false
when set to True and the doESP parameter is True, the aggregation excludes the current observation's contribution.
| Default | false |
|---|
freq="variable-name"
specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used.
| Alias | frequency |
|---|
freqStrict=true | false
this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded.
| Default | true |
|---|
groupByLimit=64-bit-integer
specifies the maximum number of levels in a group-by set. When the server determines this number of levels, the server stops and does not return a result. Specify this parameter if you want to avoid creating large result sets in group-by operations.
| Minimum value | 1 |
|---|
groupedIntervalOutput=true | false
when set to True, save only one of the same aggregated intervals with respect to the last Id value. The option is ignored if 'doESP' is set to False.
| Default | false |
|---|
id="variable-name"
specifies a numeric variable that identifies the timestamp that is associated with each observation in the input table. The values are typically SAS DATE, TIME, or DATETIME values, but that is not required. The specified variable must also be specified in the groupBy parameter for the input table.
idEnd=double
specifies the inclusive maximum value of the ID variable to be considered in the analysis. If the maximum value of the ID variable is less than the idEnd value, the series is extended with missing values. If the last ID variable value is greater than the idEnd value, the series is truncated. This parameter is ignored unless you also specify an ID variable.
idOutputName="string"
specifies the new name of the ID variable in the output table
idRange={double-1 <, double-2, ...>}
specifies the inclusive minimum and maximum values of the ID variable to be considered in the analysis. It is equivalent to specifying both idStart and idEnd.
idStart=double
specifies the inclusive minimum value of the ID variable to be considered in the analysis. If the minimum value of the ID variable is greater than the idStart value, then the series is prefixed with missing values. If the first ID variable value is less than the idStart value, then the series is truncated. This parameter is ignored unless you also specify an ID variable.
includeEmptyInterval=true | false
by default, intervals with a missing value for the ID variable are included in the output. When set to False, these intervals are excluded from the output.
| Aliases | includeMissInterval |
|---|---|
| includeMissingInterval | |
| Default | true |
includeMissing=true | false
by default, missing values are included in the analysis. When set to False, observations with missing values are excluded.
| Aliases | includeMiss |
|---|---|
| incMissing | |
| incMiss | |
| Default | true |
inputs={{casinvardesc-1} <, {casinvardesc-2}, ...>}
specifies the input variables to use in the analysis. For raw numeric variables, the default aggregator is SUMMARY. For all other situations, the default aggregator is N. You can specify variables in this parameter or exercise more control by specifying the varSpecs parameter, but you cannot use both.
For more information about specifying the inputs parameter, see the common casinvardesc parameter.
| Alias | input |
|---|
interval="string"
specifies the time period for the accumulation of observations. For example, if you specify interval='MONTH', then the action summarizes the observations in monthly intervals. This parameter is ignored unless you also specify an ID variable.
jumpingWindow=true | false
when set to True, specifies that aggregation occurs over a time window that can contain multiple intervals and aggregation is reset when the specified time range elapses. By default, a window always retains the same multiple of intervals.
| Alias | tumblingWindow |
|---|---|
| Default | false |
keepRecord=true | false
when set to True, each observation's original value for the ID variable is kept without performing interval alignment.
| Default | false |
|---|
keepRecordId=true | false
when set to True and the doESP parameter is True, each observation's original ID value is kept without performing interval alignment.
| Default | false |
|---|
modeSingle=true | false
this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value.
| Default | false |
|---|
offset=integer
specifies the offset of each interval. If you specify offset=-1, then every interval that is derived from the data set is shifted one interval backward. For example, a timestamp value for March 1 is derived from the data set to become February 1.
| Aliases | intOffset |
|---|---|
| dif | |
| intDif | |
| intOff | |
| Default | 0 |
partKey={"string-1" <, "string-2", ...>}
when the table is partitioned and you specify the partition parameter, you can specify a partition key so that the results are computed for the partition only.
pctlDef=integer
specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation.
| Default | 5 |
|---|---|
| Range | 1–5 |
pti=double
specifies the time value when the aggregation within an interval or a bin is terminated. For example, if you specify interval='MONTH' and partialToInterval='10FEB98'd, then the action aggregates only records from the first 10 days of each month.
| Aliases | ptd |
|---|---|
| partialToDate | |
| partialToInterval | |
| Default | 0 |
| Minimum value | 0 |
ptw=double
specifies the subinterval with respect to each window interval. For example, if you specify windowInterval='MONTH' and partialToWindow='08FEB98'd, then the action counts only the first 8 days from JANUARY and the first 8 days from FEBURARY when it aggregates on window interval FEBURARY, ..., DECEMBER each year. This parameter is ignored unless you also specify the jumpingWindow parameter because the starting time varies for a sliding window (a non-jumping window).
| Alias | partialToWindow |
|---|---|
| Default | 0 |
| Minimum value | 0 |
raw=true | false
when set to True, raw values of the variables in the input parameter are used.
| Default | false |
|---|
saveGroupbyFormat=true | false
by default, the formatted values of the groupBy variables from the input table are copied to the results. When set to False, the formatted values are not copied.
| Alias | saveGbyFmt |
|---|---|
| Default | true |
saveGroupbyRaw=true | false
by default, the raw values of the groupBy variables from the input table are copied to the results. When set to False, the raw values are not copied.
| Alias | saveGbyRaw |
|---|---|
| Default | true |
saveVariableColumn=true | false
by default, the variable name for each analysis variable is included in the results. The result table includes the name in a column that is named 'Column.' When set to False, this column is not included in the results.
| Alias | saveVarCol |
|---|---|
| Default | true |
saveVariableSpecification=true | false
by default, the results include a column that is named 'Variable Specification' to identify the varSpecs specification that produced the result. When set to False, this column is not included in the results.
| Alias | saveVarSpec |
|---|---|
| Default | true |
subBinOffset=double
specifies an offset from the beginning of a bin. The value must be positive and less than or equal to the bin width. If the specified value is out of range, this parameter is ignored. This parameter is ignored unless you specify an ID variable and the bin parameter.
subBinWidth=double
specifies the width of the sub bin within a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, subBinOffset=2, and subBinWidth=5, then the action summarizes only the observations with ID variable values that fall into [-2, 3], [8, 13], [18, 23], ..., [98, 103]. The specified value must be positive and the sum of the subBinOffset value and subBinWidth value must be less than or equal to the bin width. If the value is out of range, this parameter is ignored. This parameter is ignored unless you also specify an ID variable and the bin parameter.
| Minimum value | 0 |
|---|
subInterval="string"
specifies a smaller interval to control the time period alignment within each interval for the aggregation of observations.
| Alias | subInt |
|---|
* table={castable}
specifies the table name, caslib, and other common parameters.
For more information about specifying the table parameter, see the common castable parameter.
varSpecs={{tkcasagg_varspecs-1} <, {tkcasagg_varspecs-2}, ...>}
specifies the variable to aggregate and the settings for the aggregator.
The tkcasagg_varspecs value can be one or more of the following:
agg="FIRST" | "FIRSTNOTEMPTY" | "LAST" | "LASTNOTEMPTY" | "MAXIMUM" | "MINIMUM" | "MODE" | "N" | "NDISTINCT" | "NMISS" | "NTOTAL" | "PERCENT" | "PERCENTILE" | "PGT" | "PLT" | "Q1" | "Q2" | "Q3" | "SUMMARY"
specifies the aggregator to apply to the analysis variable.
MODE
returns the most frequent value. You can specify the k parameter to return more than the most frequent values.
NDISTINCT
returns the number of distinct values. This is the default aggregator for character variables and numeric variables that have a format.
| Alias | NDIST |
|---|
PERCENT
returns the percentage of values in the range that is specified in the pRange or pStrRange parameter.
| Aliases | PIN |
|---|---|
| PCIN |
PGT
returns the percentage of values that are greater than the threshold specified in the pN or pStrN parameter.
| Alias | PCGT |
|---|
ciAlpha=double
specifies the level of significance for 100*(1-ciAlpha)% confidence intervals. The default value of 0.05 results in 95% confidence intervals.
| Default | 0.05 |
|---|---|
| Range | (0, 1) |
ciType="LOWER" | "TWOSIDED" | "UPPER"
specifies the type of confidence interval.
| Default | TWOSIDED |
|---|
LOWER
specifies to use the lower bound of where the true population mean is expected to lie, given the specified confidence.
| Alias | LEFT |
|---|
columnNames={"string-1" <, "string-2", ...>}
specifies replacement column names to use in the results. By default, the name of the analysis variable is used as a column name in the result tables.
| Aliases | colName |
|---|---|
| colNames | |
| Requirement | The specified values must be unique. |
edgeId="variable-name"
specifies a numeric variable whose values are used to order the values of the analysis variable. This parameter applies to the FIRST, LAST, FNE, or LNE aggregators. Specifying this parameter in a varSpec parameter overrides the setting for the action.
exclnpwgt=true | false
when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Alias | excludeNonPositiveWeight |
|---|---|
| Default | false |
format="string"
specifies a temporary format for the analysis variable.
formats={"string-1" <, "string-2", ...>}
specifies a temporary format for the analysis variable.
freq="variable-name"
specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Alias | frequency |
|---|
freqStrict=true | false
this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Default | true |
|---|
includeMissing=true | false
by default, missing values are included in the analysis. When set to False, observations with missing values are excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Aliases | includeMiss |
|---|---|
| incMissing | |
| incMiss | |
| Default | true |
k=integer
specifies the number of the most frequent items to collect for the MODE aggregator.
| Default | 1 |
|---|---|
| Range | 1–MACINT |
missDbl=double
specifies the numeric value to use for replacing the missing values.
missStr="string"
specifies the character value to use for replacing the missing values.
modeSingle=true | false
this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Default | false |
|---|
name="variable-name"
specifies the analysis variable name.
| Alias | var |
|---|
names={"variable-name-1" <, "variable-name-2", ...>}
specifies the analysis variable name.
| Alias | vars |
|---|
pctlDef=integer
specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Range | 1–5 |
|---|
percentile={double-1 <, double-2, ...>}
specifies the percentile to calculate when the aggregator is set to PERCENTILE.
| Aliases | percentiles |
|---|---|
| pctl | |
| pctls | |
| Requirement | The specified values must be unique. |
pN=double
specifies the numeric threshold for the PGT and PLT aggregators on a numeric variable.
pRange={double-1 <, double-2, ...>}
specifies the inclusive minimum and maximum values for the PIN aggregator on a numeric variable. It is equivalent to specifying both the pRangeMin and pRangeMax parameters.
pRangeMax=double
specifies the inclusive maximum value for the PIN aggregator on a numeric variable.
| Default | MACBIG |
|---|
pRangeMin=double
specifies the inclusive minimum value for the PIN aggregator on a numeric variable.
| Default | -MACBIG |
|---|
pStrN="string"
specifies the character threshold for the PGT and PLT aggregators on a character variable.
pStrRange={"string-1" <, "string-2", ...>}
specifies the inclusive minimum and maximum values for the PIN aggregator on a character variable. It is equivalent to specifying both the pStrRangeMin and pStrRangeMax parameters.
pStrRangeMax="string"
specifies the inclusive maximum value for the PIN aggregator on a character variable.
pStrRangeMin="string"
specifies the inclusive minimum value for the PIN aggregator on a character variable.
range={double-1 <, double-2, ...>}
specifies the inclusive minimum and maximum values of a numeric variable to be considered in the aggregation. It is equivalent to specifying both the rangeMin and rangeMax parameters.
rangeMax=double
specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.
| Default | MACBIG |
|---|
rangeMin=double
specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.
| Default | -MACBIG |
|---|
strRange={"string-1" <, "string-2", ...>}
specifies the inclusive minimum and maximum values of a character variable to be considered in the aggregation. It is equivalent to specifying both the strRangeMin and strRangeMax parameters.
strRangeMax="string"
specifies the inclusive maximum value of a character variable to be considered in the aggregation.
strRangeMin="string"
specifies the inclusive minimum value of a character variable to be considered in the aggregation.
summarySubset={"CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"}
specifies the summary statistics to generate. By default, the column order of the summary statistics is MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS, regardless of the order that you specify. If you want the columns returned in a particular order, be sure to provide a name for each results column using the columnNames parameter.
| Aliases | statistics |
|---|---|
| subSet | |
| Requirement | The specified values must be unique. |
weight="variable-name"
specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior. Specifying this parameter in a varSpec parameter overrides the setting for the action.
weight="variable-name"
specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior.
windowBin={double-1 <, double-2, ...>}
specifies the minimum and maximum values of a window bin. The specification and concepts are similar to the bin parameter, except the bins apply to intervals.
windowInt="string"
specifies the time window for the accumulation of observations with respect to each time interval. For example, if you specify interval='MONTH' and windowInt='YEAR', then the action summarizes one year's worth of observations in monthly intervals.
| Aliases | winInt |
|---|---|
| windowInterval |
windowOffset=integer
specifies the offset of each window interval. The effect is similar to how the offset parameter impacts the values for the interval parameter.
| Aliases | windowIntOffset |
|---|---|
| winDif | |
| winIntDif | |
| winIntOff | |
| windowIntervalOffset | |
| Default | 0 |
windowSubBinOffset=double
specifies the starting point within a window bin in which record values are aggregated. For example, if you specify windowBin={0, 10} and windowSubBinOffset=2, then records with ID variable values in the interval [0, 2) are ignored. The specified value must not be larger than the window bin's width.
| Alias | winSubBinOffset |
|---|
windowSubBinWidth=double
specifies the width of the sub bin within each windowBin. The minimum acceptable value is 0, which renders windows ineffective. For example, if you specify windowBin={0, 10}, windowSubBinOffset=2, and windowSubBinWidth=5, then records with ID variable values in the intervals [0, 2) and [7, 10) are ignored.
| Alias | winSubBinWidth |
|---|---|
| Minimum value | 0 |
windowSubInt="string"
this parameter is similar to subInterval. You can specify a smaller interval to control the sub time period alignment within each window interval for the aggregation of observations.
| Aliases | winSubInterval |
|---|---|
| winSubInt | |
| windowSubInterval |
aggregate Action
Performs aggregation on selected variables.
| Examples: | Aggregate Data on Selected Columns |
| Aggregate Data on Selected Columns by Groups | |
| Aggregate Data on Selected Columns by Date Intervals | |
| Perform a Rolling Window Aggregation |
Summary: Input and Output Tables
If a row includes a subparameter, you can specify the name, caslib, and so on in the subparameter. Otherwise, you can specify the name, caslib, and so on in the parameter.
|
Parameter |
Subparameter |
Description |
|---|---|---|
|
required parametertable |
— |
specifies the table name, caslib, and other common parameters. |
|
Parameter |
Subparameter |
Description |
|---|---|---|
|
— |
specifies the settings for an output table. |
Parameter Descriptions
align="BEGINNING" | "ENDING" | "MIDDLE"
bin=[double-1 <, double-2, ...>]
specifies the minimum and maximum values of a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, then the action constructs a time series with 11 bins. The first bin is [-5, 5] and the last bin is [95, 105]. The values on the upper boundary of a bin belong to this bin. The values on the lower boundary of a bin belong to the adjacent lower bin. This parameter is ignored unless you also specify an ID variable.
casOut={casouttable}
specifies the settings for an output table.
For more information about specifying the casOut parameter, see the common casouttable parameter.
contribute="variable-name"
when the doESP parameter is True, you can specify a variable whose values within each aggregation interval are recorded. The value can be used as a key to join with the original table in order to understand each row contribution toward the aggregated interval.
contributeColumnLabel="string"
specifies a value to override the variable label from the contribute variable. By default, the contribute variable's label is shown in the results.
contributeColumnName="string"
specifies a value to override the variable name from the contribute variable. By default, the contribute variable's name is shown in the results.
contributeDelimiter="string"
specifies a delimiter that is used between concatenated values of the contribute variable.
| Alias | delimiter |
|---|---|
| Default | "," |
contributeTrim=True | False
when set to True, leading and trailing blanks are removed from the formatted value of the contribute variable. This parameter is ignored if the contributeUnroll parameter is set to True.
| Default | False |
|---|
contributeUnroll=True | False
by default, the formatted values from the contribute variable are concatenated together into a single row for the result table. When set to True, each raw value from the contribute variable adds a row to the result table.
| Alias | unroll |
|---|---|
| Default | False |
copyVars=["variable-name-1" <, "variable-name-2", ...>]
specifies the variables to copy from the input table to the output table. The raw values are kept in the output. This parameter is ignored unless you also specify the groupBy parameter for the input table. When more than one record exists in a group, the minimum raw value is copied.
| Alias | copyVar |
|---|
doESP=True | False
when set to True, the action can take advantage of partitioning and ordering on the input table. You must specify the groupBy parameter for the input table. The ID variable must be specified as the last groupBy parameter and in the orderBy parameter. Setting this parameter to True implies setting the keepRecord parameter to True. When set to False (the default value), the keepRecordId, excludeSelf, contribute, contributeColumnName, contributeTrim, contributeDelimiter, and contributeUnroll parameters are ignored.
| Alias | partAndOrder |
|---|---|
| Default | False |
edgeId="variable-name"
specifies a numeric variable whose values are used to order the values of each varSpecs specification that uses the FIRST, LAST, FNE, or LNE aggregator. This parameter can be overridden in a varSpecs specification that includes an edgeId subparameter.
exclnpwgt=True | False
when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis.
| Alias | excludeNonPositiveWeight |
|---|---|
| Default | False |
excludeSelf=True | False
when set to True and the doESP parameter is True, the aggregation excludes the current observation's contribution.
| Default | False |
|---|
freq="variable-name"
specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used.
| Alias | frequency |
|---|
freqStrict=True | False
this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded.
| Default | True |
|---|
groupByLimit=64-bit-integer
specifies the maximum number of levels in a group-by set. When the server determines this number of levels, the server stops and does not return a result. Specify this parameter if you want to avoid creating large result sets in group-by operations.
| Minimum value | 1 |
|---|
groupedIntervalOutput=True | False
when set to True, save only one of the same aggregated intervals with respect to the last Id value. The option is ignored if 'doESP' is set to False.
| Default | False |
|---|
id="variable-name"
specifies a numeric variable that identifies the timestamp that is associated with each observation in the input table. The values are typically SAS DATE, TIME, or DATETIME values, but that is not required. The specified variable must also be specified in the groupBy parameter for the input table.
idEnd=double
specifies the inclusive maximum value of the ID variable to be considered in the analysis. If the maximum value of the ID variable is less than the idEnd value, the series is extended with missing values. If the last ID variable value is greater than the idEnd value, the series is truncated. This parameter is ignored unless you also specify an ID variable.
idOutputName="string"
specifies the new name of the ID variable in the output table
idRange=[double-1 <, double-2, ...>]
specifies the inclusive minimum and maximum values of the ID variable to be considered in the analysis. It is equivalent to specifying both idStart and idEnd.
idStart=double
specifies the inclusive minimum value of the ID variable to be considered in the analysis. If the minimum value of the ID variable is greater than the idStart value, then the series is prefixed with missing values. If the first ID variable value is less than the idStart value, then the series is truncated. This parameter is ignored unless you also specify an ID variable.
includeEmptyInterval=True | False
by default, intervals with a missing value for the ID variable are included in the output. When set to False, these intervals are excluded from the output.
| Aliases | includeMissInterval |
|---|---|
| includeMissingInterval | |
| Default | True |
includeMissing=True | False
by default, missing values are included in the analysis. When set to False, observations with missing values are excluded.
| Aliases | includeMiss |
|---|---|
| incMissing | |
| incMiss | |
| Default | True |
inputs=[{casinvardesc-1} <, {casinvardesc-2}, ...>]
specifies the input variables to use in the analysis. For raw numeric variables, the default aggregator is SUMMARY. For all other situations, the default aggregator is N. You can specify variables in this parameter or exercise more control by specifying the varSpecs parameter, but you cannot use both.
For more information about specifying the inputs parameter, see the common casinvardesc parameter.
| Alias | input |
|---|
interval="string"
specifies the time period for the accumulation of observations. For example, if you specify interval='MONTH', then the action summarizes the observations in monthly intervals. This parameter is ignored unless you also specify an ID variable.
jumpingWindow=True | False
when set to True, specifies that aggregation occurs over a time window that can contain multiple intervals and aggregation is reset when the specified time range elapses. By default, a window always retains the same multiple of intervals.
| Alias | tumblingWindow |
|---|---|
| Default | False |
keepRecord=True | False
when set to True, each observation's original value for the ID variable is kept without performing interval alignment.
| Default | False |
|---|
keepRecordId=True | False
when set to True and the doESP parameter is True, each observation's original ID value is kept without performing interval alignment.
| Default | False |
|---|
modeSingle=True | False
this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value.
| Default | False |
|---|
offset=integer
specifies the offset of each interval. If you specify offset=-1, then every interval that is derived from the data set is shifted one interval backward. For example, a timestamp value for March 1 is derived from the data set to become February 1.
| Aliases | intOffset |
|---|---|
| dif | |
| intDif | |
| intOff | |
| Default | 0 |
partKey=["string-1" <, "string-2", ...>]
when the table is partitioned and you specify the partition parameter, you can specify a partition key so that the results are computed for the partition only.
pctlDef=integer
specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation.
| Default | 5 |
|---|---|
| Range | 1–5 |
pti=double
specifies the time value when the aggregation within an interval or a bin is terminated. For example, if you specify interval='MONTH' and partialToInterval='10FEB98'd, then the action aggregates only records from the first 10 days of each month.
| Aliases | ptd |
|---|---|
| partialToDate | |
| partialToInterval | |
| Default | 0 |
| Minimum value | 0 |
ptw=double
specifies the subinterval with respect to each window interval. For example, if you specify windowInterval='MONTH' and partialToWindow='08FEB98'd, then the action counts only the first 8 days from JANUARY and the first 8 days from FEBURARY when it aggregates on window interval FEBURARY, ..., DECEMBER each year. This parameter is ignored unless you also specify the jumpingWindow parameter because the starting time varies for a sliding window (a non-jumping window).
| Alias | partialToWindow |
|---|---|
| Default | 0 |
| Minimum value | 0 |
raw=True | False
when set to True, raw values of the variables in the input parameter are used.
| Default | False |
|---|
saveGroupbyFormat=True | False
by default, the formatted values of the groupBy variables from the input table are copied to the results. When set to False, the formatted values are not copied.
| Alias | saveGbyFmt |
|---|---|
| Default | True |
saveGroupbyRaw=True | False
by default, the raw values of the groupBy variables from the input table are copied to the results. When set to False, the raw values are not copied.
| Alias | saveGbyRaw |
|---|---|
| Default | True |
saveVariableColumn=True | False
by default, the variable name for each analysis variable is included in the results. The result table includes the name in a column that is named 'Column.' When set to False, this column is not included in the results.
| Alias | saveVarCol |
|---|---|
| Default | True |
saveVariableSpecification=True | False
by default, the results include a column that is named 'Variable Specification' to identify the varSpecs specification that produced the result. When set to False, this column is not included in the results.
| Alias | saveVarSpec |
|---|---|
| Default | True |
subBinOffset=double
specifies an offset from the beginning of a bin. The value must be positive and less than or equal to the bin width. If the specified value is out of range, this parameter is ignored. This parameter is ignored unless you specify an ID variable and the bin parameter.
subBinWidth=double
specifies the width of the sub bin within a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, subBinOffset=2, and subBinWidth=5, then the action summarizes only the observations with ID variable values that fall into [-2, 3], [8, 13], [18, 23], ..., [98, 103]. The specified value must be positive and the sum of the subBinOffset value and subBinWidth value must be less than or equal to the bin width. If the value is out of range, this parameter is ignored. This parameter is ignored unless you also specify an ID variable and the bin parameter.
| Minimum value | 0 |
|---|
subInterval="string"
specifies a smaller interval to control the time period alignment within each interval for the aggregation of observations.
| Alias | subInt |
|---|
* table={castable}
specifies the table name, caslib, and other common parameters.
For more information about specifying the table parameter, see the common castable parameter.
varSpecs=[{tkcasagg_varspecs-1} <, {tkcasagg_varspecs-2}, ...>]
specifies the variable to aggregate and the settings for the aggregator.
The tkcasagg_varspecs value can be one or more of the following:
"agg":"FIRST" | "FIRSTNOTEMPTY" | "LAST" | "LASTNOTEMPTY" | "MAXIMUM" | "MINIMUM" | "MODE" | "N" | "NDISTINCT" | "NMISS" | "NTOTAL" | "PERCENT" | "PERCENTILE" | "PGT" | "PLT" | "Q1" | "Q2" | "Q3" | "SUMMARY"
specifies the aggregator to apply to the analysis variable.
MODE
returns the most frequent value. You can specify the k parameter to return more than the most frequent values.
NDISTINCT
returns the number of distinct values. This is the default aggregator for character variables and numeric variables that have a format.
| Alias | NDIST |
|---|
PERCENT
returns the percentage of values in the range that is specified in the pRange or pStrRange parameter.
| Aliases | PIN |
|---|---|
| PCIN |
PGT
returns the percentage of values that are greater than the threshold specified in the pN or pStrN parameter.
| Alias | PCGT |
|---|
"ciAlpha":double
specifies the level of significance for 100*(1-ciAlpha)% confidence intervals. The default value of 0.05 results in 95% confidence intervals.
| Default | 0.05 |
|---|---|
| Range | (0, 1) |
"ciType":"LOWER" | "TWOSIDED" | "UPPER"
specifies the type of confidence interval.
| Default | TWOSIDED |
|---|
LOWER
specifies to use the lower bound of where the true population mean is expected to lie, given the specified confidence.
| Alias | LEFT |
|---|
"columnNames":["string-1" <, "string-2", ...>]
specifies replacement column names to use in the results. By default, the name of the analysis variable is used as a column name in the result tables.
| Aliases | colName |
|---|---|
| colNames | |
| Requirement | The specified values must be unique. |
"edgeId":"variable-name"
specifies a numeric variable whose values are used to order the values of the analysis variable. This parameter applies to the FIRST, LAST, FNE, or LNE aggregators. Specifying this parameter in a varSpec parameter overrides the setting for the action.
"exclnpwgt":True | False
when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Alias | excludeNonPositiveWeight |
|---|---|
| Default | False |
"format":"string"
specifies a temporary format for the analysis variable.
"formats":["string-1" <, "string-2", ...>]
specifies a temporary format for the analysis variable.
"freq":"variable-name"
specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Alias | frequency |
|---|
"freqStrict":True | False
this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Default | True |
|---|
"includeMissing":True | False
by default, missing values are included in the analysis. When set to False, observations with missing values are excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Aliases | includeMiss |
|---|---|
| incMissing | |
| incMiss | |
| Default | True |
"k":integer
specifies the number of the most frequent items to collect for the MODE aggregator.
| Default | 1 |
|---|---|
| Range | 1–MACINT |
"missDbl":double
specifies the numeric value to use for replacing the missing values.
"missStr":"string"
specifies the character value to use for replacing the missing values.
"modeSingle":True | False
this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Default | False |
|---|
"name":"variable-name"
specifies the analysis variable name.
| Alias | var |
|---|
"names":["variable-name-1" <, "variable-name-2", ...>]
specifies the analysis variable name.
| Alias | vars |
|---|
"pctlDef":integer
specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Range | 1–5 |
|---|
"percentile":[double-1 <, double-2, ...>]
specifies the percentile to calculate when the aggregator is set to PERCENTILE.
| Aliases | percentiles |
|---|---|
| pctl | |
| pctls | |
| Requirement | The specified values must be unique. |
"pN":double
specifies the numeric threshold for the PGT and PLT aggregators on a numeric variable.
"pRange":[double-1 <, double-2, ...>]
specifies the inclusive minimum and maximum values for the PIN aggregator on a numeric variable. It is equivalent to specifying both the pRangeMin and pRangeMax parameters.
"pRangeMax":double
specifies the inclusive maximum value for the PIN aggregator on a numeric variable.
| Default | MACBIG |
|---|
"pRangeMin":double
specifies the inclusive minimum value for the PIN aggregator on a numeric variable.
| Default | -MACBIG |
|---|
"pStrN":"string"
specifies the character threshold for the PGT and PLT aggregators on a character variable.
"pStrRange":["string-1" <, "string-2", ...>]
specifies the inclusive minimum and maximum values for the PIN aggregator on a character variable. It is equivalent to specifying both the pStrRangeMin and pStrRangeMax parameters.
"pStrRangeMax":"string"
specifies the inclusive maximum value for the PIN aggregator on a character variable.
"pStrRangeMin":"string"
specifies the inclusive minimum value for the PIN aggregator on a character variable.
"range":[double-1 <, double-2, ...>]
specifies the inclusive minimum and maximum values of a numeric variable to be considered in the aggregation. It is equivalent to specifying both the rangeMin and rangeMax parameters.
"rangeMax":double
specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.
| Default | MACBIG |
|---|
"rangeMin":double
specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.
| Default | -MACBIG |
|---|
"strRange":["string-1" <, "string-2", ...>]
specifies the inclusive minimum and maximum values of a character variable to be considered in the aggregation. It is equivalent to specifying both the strRangeMin and strRangeMax parameters.
"strRangeMax":"string"
specifies the inclusive maximum value of a character variable to be considered in the aggregation.
"strRangeMin":"string"
specifies the inclusive minimum value of a character variable to be considered in the aggregation.
"summarySubset":["CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR"]
specifies the summary statistics to generate. By default, the column order of the summary statistics is MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS, regardless of the order that you specify. If you want the columns returned in a particular order, be sure to provide a name for each results column using the columnNames parameter.
| Aliases | statistics |
|---|---|
| subSet | |
| Requirement | The specified values must be unique. |
"weight":"variable-name"
specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior. Specifying this parameter in a varSpec parameter overrides the setting for the action.
weight="variable-name"
specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior.
windowBin=[double-1 <, double-2, ...>]
specifies the minimum and maximum values of a window bin. The specification and concepts are similar to the bin parameter, except the bins apply to intervals.
windowInt="string"
specifies the time window for the accumulation of observations with respect to each time interval. For example, if you specify interval='MONTH' and windowInt='YEAR', then the action summarizes one year's worth of observations in monthly intervals.
| Aliases | winInt |
|---|---|
| windowInterval |
windowOffset=integer
specifies the offset of each window interval. The effect is similar to how the offset parameter impacts the values for the interval parameter.
| Aliases | windowIntOffset |
|---|---|
| winDif | |
| winIntDif | |
| winIntOff | |
| windowIntervalOffset | |
| Default | 0 |
windowSubBinOffset=double
specifies the starting point within a window bin in which record values are aggregated. For example, if you specify windowBin={0, 10} and windowSubBinOffset=2, then records with ID variable values in the interval [0, 2) are ignored. The specified value must not be larger than the window bin's width.
| Alias | winSubBinOffset |
|---|
windowSubBinWidth=double
specifies the width of the sub bin within each windowBin. The minimum acceptable value is 0, which renders windows ineffective. For example, if you specify windowBin={0, 10}, windowSubBinOffset=2, and windowSubBinWidth=5, then records with ID variable values in the intervals [0, 2) and [7, 10) are ignored.
| Alias | winSubBinWidth |
|---|---|
| Minimum value | 0 |
windowSubInt="string"
this parameter is similar to subInterval. You can specify a smaller interval to control the sub time period alignment within each window interval for the aggregation of observations.
| Aliases | winSubInterval |
|---|---|
| winSubInt | |
| windowSubInterval |
aggregate Action
Performs aggregation on selected variables.
| Examples: | Aggregate Data on Selected Columns |
| Aggregate Data on Selected Columns by Groups | |
| Aggregate Data on Selected Columns by Date Intervals | |
| Perform a Rolling Window Aggregation |
Summary: Input and Output Tables
If a row includes a subparameter, you can specify the name, caslib, and so on in the subparameter. Otherwise, you can specify the name, caslib, and so on in the parameter.
|
Parameter |
Subparameter |
Description |
|---|---|---|
|
required parametertable |
— |
specifies the table name, caslib, and other common parameters. |
|
Parameter |
Subparameter |
Description |
|---|---|---|
|
— |
specifies the settings for an output table. |
Parameter Descriptions
align="BEGINNING" | "ENDING" | "MIDDLE"
bin=list(double-1 <, double-2, ...>)
specifies the minimum and maximum values of a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, then the action constructs a time series with 11 bins. The first bin is [-5, 5] and the last bin is [95, 105]. The values on the upper boundary of a bin belong to this bin. The values on the lower boundary of a bin belong to the adjacent lower bin. This parameter is ignored unless you also specify an ID variable.
casOut=list(casouttable)
specifies the settings for an output table.
For more information about specifying the casOut parameter, see the common casouttable parameter.
contribute="variable-name"
when the doESP parameter is True, you can specify a variable whose values within each aggregation interval are recorded. The value can be used as a key to join with the original table in order to understand each row contribution toward the aggregated interval.
contributeColumnLabel="string"
specifies a value to override the variable label from the contribute variable. By default, the contribute variable's label is shown in the results.
contributeColumnName="string"
specifies a value to override the variable name from the contribute variable. By default, the contribute variable's name is shown in the results.
contributeDelimiter="string"
specifies a delimiter that is used between concatenated values of the contribute variable.
| Alias | delimiter |
|---|---|
| Default | "," |
contributeTrim=TRUE | FALSE
when set to True, leading and trailing blanks are removed from the formatted value of the contribute variable. This parameter is ignored if the contributeUnroll parameter is set to True.
| Default | FALSE |
|---|
contributeUnroll=TRUE | FALSE
by default, the formatted values from the contribute variable are concatenated together into a single row for the result table. When set to True, each raw value from the contribute variable adds a row to the result table.
| Alias | unroll |
|---|---|
| Default | FALSE |
copyVars=list("variable-name-1" <, "variable-name-2", ...>)
specifies the variables to copy from the input table to the output table. The raw values are kept in the output. This parameter is ignored unless you also specify the groupBy parameter for the input table. When more than one record exists in a group, the minimum raw value is copied.
| Alias | copyVar |
|---|
doESP=TRUE | FALSE
when set to True, the action can take advantage of partitioning and ordering on the input table. You must specify the groupBy parameter for the input table. The ID variable must be specified as the last groupBy parameter and in the orderBy parameter. Setting this parameter to True implies setting the keepRecord parameter to True. When set to False (the default value), the keepRecordId, excludeSelf, contribute, contributeColumnName, contributeTrim, contributeDelimiter, and contributeUnroll parameters are ignored.
| Alias | partAndOrder |
|---|---|
| Default | FALSE |
edgeId="variable-name"
specifies a numeric variable whose values are used to order the values of each varSpecs specification that uses the FIRST, LAST, FNE, or LNE aggregator. This parameter can be overridden in a varSpecs specification that includes an edgeId subparameter.
exclnpwgt=TRUE | FALSE
when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis.
| Alias | excludeNonPositiveWeight |
|---|---|
| Default | FALSE |
excludeSelf=TRUE | FALSE
when set to True and the doESP parameter is True, the aggregation excludes the current observation's contribution.
| Default | FALSE |
|---|
freq="variable-name"
specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used.
| Alias | frequency |
|---|
freqStrict=TRUE | FALSE
this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded.
| Default | TRUE |
|---|
groupByLimit=64-bit-integer
specifies the maximum number of levels in a group-by set. When the server determines this number of levels, the server stops and does not return a result. Specify this parameter if you want to avoid creating large result sets in group-by operations.
| Minimum value | 1 |
|---|
groupedIntervalOutput=TRUE | FALSE
when set to True, save only one of the same aggregated intervals with respect to the last Id value. The option is ignored if 'doESP' is set to False.
| Default | FALSE |
|---|
id="variable-name"
specifies a numeric variable that identifies the timestamp that is associated with each observation in the input table. The values are typically SAS DATE, TIME, or DATETIME values, but that is not required. The specified variable must also be specified in the groupBy parameter for the input table.
idEnd=double
specifies the inclusive maximum value of the ID variable to be considered in the analysis. If the maximum value of the ID variable is less than the idEnd value, the series is extended with missing values. If the last ID variable value is greater than the idEnd value, the series is truncated. This parameter is ignored unless you also specify an ID variable.
idOutputName="string"
specifies the new name of the ID variable in the output table
idRange=list(double-1 <, double-2, ...>)
specifies the inclusive minimum and maximum values of the ID variable to be considered in the analysis. It is equivalent to specifying both idStart and idEnd.
idStart=double
specifies the inclusive minimum value of the ID variable to be considered in the analysis. If the minimum value of the ID variable is greater than the idStart value, then the series is prefixed with missing values. If the first ID variable value is less than the idStart value, then the series is truncated. This parameter is ignored unless you also specify an ID variable.
includeEmptyInterval=TRUE | FALSE
by default, intervals with a missing value for the ID variable are included in the output. When set to False, these intervals are excluded from the output.
| Aliases | includeMissInterval |
|---|---|
| includeMissingInterval | |
| Default | TRUE |
includeMissing=TRUE | FALSE
by default, missing values are included in the analysis. When set to False, observations with missing values are excluded.
| Aliases | includeMiss |
|---|---|
| incMissing | |
| incMiss | |
| Default | TRUE |
inputs=list( list(casinvardesc-1) <, list(casinvardesc-2), ...>)
specifies the input variables to use in the analysis. For raw numeric variables, the default aggregator is SUMMARY. For all other situations, the default aggregator is N. You can specify variables in this parameter or exercise more control by specifying the varSpecs parameter, but you cannot use both.
For more information about specifying the inputs parameter, see the common casinvardesc parameter.
| Alias | input |
|---|
interval="string"
specifies the time period for the accumulation of observations. For example, if you specify interval='MONTH', then the action summarizes the observations in monthly intervals. This parameter is ignored unless you also specify an ID variable.
jumpingWindow=TRUE | FALSE
when set to True, specifies that aggregation occurs over a time window that can contain multiple intervals and aggregation is reset when the specified time range elapses. By default, a window always retains the same multiple of intervals.
| Alias | tumblingWindow |
|---|---|
| Default | FALSE |
keepRecord=TRUE | FALSE
when set to True, each observation's original value for the ID variable is kept without performing interval alignment.
| Default | FALSE |
|---|
keepRecordId=TRUE | FALSE
when set to True and the doESP parameter is True, each observation's original ID value is kept without performing interval alignment.
| Default | FALSE |
|---|
modeSingle=TRUE | FALSE
this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value.
| Default | FALSE |
|---|
offset=integer
specifies the offset of each interval. If you specify offset=-1, then every interval that is derived from the data set is shifted one interval backward. For example, a timestamp value for March 1 is derived from the data set to become February 1.
| Aliases | intOffset |
|---|---|
| dif | |
| intDif | |
| intOff | |
| Default | 0 |
partKey=list("string-1" <, "string-2", ...>)
when the table is partitioned and you specify the partition parameter, you can specify a partition key so that the results are computed for the partition only.
pctlDef=integer
specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation.
| Default | 5 |
|---|---|
| Range | 1–5 |
pti=double
specifies the time value when the aggregation within an interval or a bin is terminated. For example, if you specify interval='MONTH' and partialToInterval='10FEB98'd, then the action aggregates only records from the first 10 days of each month.
| Aliases | ptd |
|---|---|
| partialToDate | |
| partialToInterval | |
| Default | 0 |
| Minimum value | 0 |
ptw=double
specifies the subinterval with respect to each window interval. For example, if you specify windowInterval='MONTH' and partialToWindow='08FEB98'd, then the action counts only the first 8 days from JANUARY and the first 8 days from FEBURARY when it aggregates on window interval FEBURARY, ..., DECEMBER each year. This parameter is ignored unless you also specify the jumpingWindow parameter because the starting time varies for a sliding window (a non-jumping window).
| Alias | partialToWindow |
|---|---|
| Default | 0 |
| Minimum value | 0 |
raw=TRUE | FALSE
when set to True, raw values of the variables in the input parameter are used.
| Default | FALSE |
|---|
saveGroupbyFormat=TRUE | FALSE
by default, the formatted values of the groupBy variables from the input table are copied to the results. When set to False, the formatted values are not copied.
| Alias | saveGbyFmt |
|---|---|
| Default | TRUE |
saveGroupbyRaw=TRUE | FALSE
by default, the raw values of the groupBy variables from the input table are copied to the results. When set to False, the raw values are not copied.
| Alias | saveGbyRaw |
|---|---|
| Default | TRUE |
saveVariableColumn=TRUE | FALSE
by default, the variable name for each analysis variable is included in the results. The result table includes the name in a column that is named 'Column.' When set to False, this column is not included in the results.
| Alias | saveVarCol |
|---|---|
| Default | TRUE |
saveVariableSpecification=TRUE | FALSE
by default, the results include a column that is named 'Variable Specification' to identify the varSpecs specification that produced the result. When set to False, this column is not included in the results.
| Alias | saveVarSpec |
|---|---|
| Default | TRUE |
subBinOffset=double
specifies an offset from the beginning of a bin. The value must be positive and less than or equal to the bin width. If the specified value is out of range, this parameter is ignored. This parameter is ignored unless you specify an ID variable and the bin parameter.
subBinWidth=double
specifies the width of the sub bin within a bin. For example, if the values of the ID variable range from 0 to 100 and you specify bin={5, 15}, subBinOffset=2, and subBinWidth=5, then the action summarizes only the observations with ID variable values that fall into [-2, 3], [8, 13], [18, 23], ..., [98, 103]. The specified value must be positive and the sum of the subBinOffset value and subBinWidth value must be less than or equal to the bin width. If the value is out of range, this parameter is ignored. This parameter is ignored unless you also specify an ID variable and the bin parameter.
| Minimum value | 0 |
|---|
subInterval="string"
specifies a smaller interval to control the time period alignment within each interval for the aggregation of observations.
| Alias | subInt |
|---|
* table=list(castable)
specifies the table name, caslib, and other common parameters.
For more information about specifying the table parameter, see the common castable parameter.
varSpecs=list( list(tkcasagg_varspecs-1) <, list(tkcasagg_varspecs-2), ...>)
specifies the variable to aggregate and the settings for the aggregator.
The tkcasagg_varspecs value can be one or more of the following:
agg="FIRST" | "FIRSTNOTEMPTY" | "LAST" | "LASTNOTEMPTY" | "MAXIMUM" | "MINIMUM" | "MODE" | "N" | "NDISTINCT" | "NMISS" | "NTOTAL" | "PERCENT" | "PERCENTILE" | "PGT" | "PLT" | "Q1" | "Q2" | "Q3" | "SUMMARY"
specifies the aggregator to apply to the analysis variable.
MODE
returns the most frequent value. You can specify the k parameter to return more than the most frequent values.
NDISTINCT
returns the number of distinct values. This is the default aggregator for character variables and numeric variables that have a format.
| Alias | NDIST |
|---|
PERCENT
returns the percentage of values in the range that is specified in the pRange or pStrRange parameter.
| Aliases | PIN |
|---|---|
| PCIN |
PGT
returns the percentage of values that are greater than the threshold specified in the pN or pStrN parameter.
| Alias | PCGT |
|---|
ciAlpha=double
specifies the level of significance for 100*(1-ciAlpha)% confidence intervals. The default value of 0.05 results in 95% confidence intervals.
| Default | 0.05 |
|---|---|
| Range | (0, 1) |
ciType="LOWER" | "TWOSIDED" | "UPPER"
specifies the type of confidence interval.
| Default | TWOSIDED |
|---|
LOWER
specifies to use the lower bound of where the true population mean is expected to lie, given the specified confidence.
| Alias | LEFT |
|---|
columnNames=list("string-1" <, "string-2", ...>)
specifies replacement column names to use in the results. By default, the name of the analysis variable is used as a column name in the result tables.
| Aliases | colName |
|---|---|
| colNames | |
| Requirement | The specified values must be unique. |
edgeId="variable-name"
specifies a numeric variable whose values are used to order the values of the analysis variable. This parameter applies to the FIRST, LAST, FNE, or LNE aggregators. Specifying this parameter in a varSpec parameter overrides the setting for the action.
exclnpwgt=TRUE | FALSE
when set to True and a weight variable is specified, then observations with a non-positive weight value are excluded from the analysis. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Alias | excludeNonPositiveWeight |
|---|---|
| Default | FALSE |
format="string"
specifies a temporary format for the analysis variable.
formats=list("string-1" <, "string-2", ...>)
specifies a temporary format for the analysis variable.
freq="variable-name"
specifies a numeric variable whose values are used as the frequency of analysis variable values. This parameter has an effect when the aggregator is SUMMARY, Q1, Q2, Q3, PERCENTILE, PLT, PIN, PGT, or MODE. With the exception of MODE, records with frequency values that are missing or less than 1 are excluded from the analysis. Only the integer portion of the frequency value is used. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Alias | frequency |
|---|
freqStrict=TRUE | FALSE
this parameter is related to using the MODE aggregator. By default, observations with frequency values that are missing or less than 1 are excluded and only the integer portion of decimal values is used. When set to False, negative and the decimal values are used. Missing values are still excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Default | TRUE |
|---|
includeMissing=TRUE | FALSE
by default, missing values are included in the analysis. When set to False, observations with missing values are excluded. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Aliases | includeMiss |
|---|---|
| incMissing | |
| incMiss | |
| Default | TRUE |
k=integer
specifies the number of the most frequent items to collect for the MODE aggregator.
| Default | 1 |
|---|---|
| Range | 1–MACINT |
missDbl=double
specifies the numeric value to use for replacing the missing values.
missStr="string"
specifies the character value to use for replacing the missing values.
modeSingle=TRUE | FALSE
this parameter is related to using the MODE aggregator. By default, the most frequent value is 'missing' if all the distinct values have a frequency of 1. When set to True, the minimum of these distinct values is returned as the most frequent value. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Default | FALSE |
|---|
name="variable-name"
specifies the analysis variable name.
| Alias | var |
|---|
names=list("variable-name-1" <, "variable-name-2", ...>)
specifies the analysis variable name.
| Alias | vars |
|---|
pctlDef=integer
specifies how to compute quantile statistics (percentiles) as described in the UNIVARIATE procedure documentation. Specifying this parameter in a varSpec parameter overrides the setting for the action.
| Range | 1–5 |
|---|
percentile=list(double-1 <, double-2, ...>)
specifies the percentile to calculate when the aggregator is set to PERCENTILE.
| Aliases | percentiles |
|---|---|
| pctl | |
| pctls | |
| Requirement | The specified values must be unique. |
pN=double
specifies the numeric threshold for the PGT and PLT aggregators on a numeric variable.
pRange=list(double-1 <, double-2, ...>)
specifies the inclusive minimum and maximum values for the PIN aggregator on a numeric variable. It is equivalent to specifying both the pRangeMin and pRangeMax parameters.
pRangeMax=double
specifies the inclusive maximum value for the PIN aggregator on a numeric variable.
| Default | MACBIG |
|---|
pRangeMin=double
specifies the inclusive minimum value for the PIN aggregator on a numeric variable.
| Default | -MACBIG |
|---|
pStrN="string"
specifies the character threshold for the PGT and PLT aggregators on a character variable.
pStrRange=list("string-1" <, "string-2", ...>)
specifies the inclusive minimum and maximum values for the PIN aggregator on a character variable. It is equivalent to specifying both the pStrRangeMin and pStrRangeMax parameters.
pStrRangeMax="string"
specifies the inclusive maximum value for the PIN aggregator on a character variable.
pStrRangeMin="string"
specifies the inclusive minimum value for the PIN aggregator on a character variable.
range=list(double-1 <, double-2, ...>)
specifies the inclusive minimum and maximum values of a numeric variable to be considered in the aggregation. It is equivalent to specifying both the rangeMin and rangeMax parameters.
rangeMax=double
specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.
| Default | MACBIG |
|---|
rangeMin=double
specifies the inclusive minimum value of a numeric variable to be considered in the aggregation.
| Default | -MACBIG |
|---|
strRange=list("string-1" <, "string-2", ...>)
specifies the inclusive minimum and maximum values of a character variable to be considered in the aggregation. It is equivalent to specifying both the strRangeMin and strRangeMax parameters.
strRangeMax="string"
specifies the inclusive maximum value of a character variable to be considered in the aggregation.
strRangeMin="string"
specifies the inclusive minimum value of a character variable to be considered in the aggregation.
summarySubset=list("CSS", "CV", "KURT", "KURTOSIS", "MAX", "MAXIMUM", "MEAN", "MIN", "MINIMUM", "N", "NMISS", "PROBT", "SKEW", "SKEWNESS", "STD", "STDERR", "SUM", "T", "TSTAT", "USS", "VAR")
specifies the summary statistics to generate. By default, the column order of the summary statistics is MIN, MAX, NOBS, MEAN, SUM, STD, STDERR, CV, NMISS, VAR, USS, CSS, TVALUE, PROBT, SKEWNESS, and KURTOSIS, regardless of the order that you specify. If you want the columns returned in a particular order, be sure to provide a name for each results column using the columnNames parameter.
| Aliases | statistics |
|---|---|
| subSet | |
| Requirement | The specified values must be unique. |
weight="variable-name"
specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior. Specifying this parameter in a varSpec parameter overrides the setting for the action.
weight="variable-name"
specifies a numeric variable whose values are used as the weight of numeric analysis variable values when the aggregator is SUMMARY. This parameter is meaningful with the SUMMARY aggregator only. Observations with missing values are excluded from the analysis. By default, negative values of the weight variable are treated as 0. Use the excludeNonPositiveWeight parameter to change this behavior.
windowBin=list(double-1 <, double-2, ...>)
specifies the minimum and maximum values of a window bin. The specification and concepts are similar to the bin parameter, except the bins apply to intervals.
windowInt="string"
specifies the time window for the accumulation of observations with respect to each time interval. For example, if you specify interval='MONTH' and windowInt='YEAR', then the action summarizes one year's worth of observations in monthly intervals.
| Aliases | winInt |
|---|---|
| windowInterval |
windowOffset=integer
specifies the offset of each window interval. The effect is similar to how the offset parameter impacts the values for the interval parameter.
| Aliases | windowIntOffset |
|---|---|
| winDif | |
| winIntDif | |
| winIntOff | |
| windowIntervalOffset | |
| Default | 0 |
windowSubBinOffset=double
specifies the starting point within a window bin in which record values are aggregated. For example, if you specify windowBin={0, 10} and windowSubBinOffset=2, then records with ID variable values in the interval [0, 2) are ignored. The specified value must not be larger than the window bin's width.
| Alias | winSubBinOffset |
|---|
windowSubBinWidth=double
specifies the width of the sub bin within each windowBin. The minimum acceptable value is 0, which renders windows ineffective. For example, if you specify windowBin={0, 10}, windowSubBinOffset=2, and windowSubBinWidth=5, then records with ID variable values in the intervals [0, 2) and [7, 10) are ignored.
| Alias | winSubBinWidth |
|---|---|
| Minimum value | 0 |
windowSubInt="string"
this parameter is similar to subInterval. You can specify a smaller interval to control the sub time period alignment within each window interval for the aggregation of observations.
| Aliases | winSubInterval |
|---|---|
| winSubInt | |
| windowSubInterval |