Differences between revisions 1 and 2
Revision 1 as of 2022-08-22 12:09:20
Size: 6538
Comment:
Revision 2 as of 2022-08-22 14:04:06
Size: 6634
Comment:
Deletions are marked like this. Additions are marked like this.
Line 175: Line 175:
If specified with a variable list argument, the `N` function returns a weighted number of cases with non-missing values for each source variable. If specified with a variable list argument, the `N` function returns a weighted number of cases with non-missing values for each source variable. String values will never be considered missing.
Line 195: Line 195:
If specified with a variable list argument, the `NU` function returns an unweighted number of cases with non-missing values for each source variable. If specified with a variable list argument, the `NU` function returns an unweighted number of cases with non-missing values for each source variable. String values will never be considered missing.

SPSS Aggregate Functions

These are the functions that can be used on the AGGREGATE command.


General Syntax

The number of target variables must match the number of source variables.


Variable Metadata

Only the MAX, MIN, FIRST, and LAST functions copy the metadata of a source variable. All other created variables lack metadata by default.

To specify a variable label for a new target variable, list the label in quotes following the new variable name.

Value labels cannot be specified.

Variable formats cannot be specified.


Cgt

The CGT function returns a count of cases with a value greater than a specified second argument for each source variable.


Cin

The CIN function returns a count of cases with a value within some range for each source variable.

The range is specified by the second and third arguments, and it is inclusive of those two values as well. If the second argument is greater than the third, they are automatically reversed.

If the second and third arguments are equal, CIN returns a count of cases with a value equal to the second argument.


Clt

The CLT function returns a count of cases with a value lesser than a specified second argument for each source variable.


Cout

The COUT function returns a count of cases with a value outside of some range for each source variable.

The range is specified by the second and third arguments, and it is inclusive of those two values as well. If the second argument is greater than the third, they are automatically reversed.

If the second and third arguments are equal, COUT returns a count of cases with a value not equal to the second argument.

COUT is complementary of CIN.


Fgt

The FGT function returns a fraction of cases with a value greater than a specified second argument for each source variable.


Fin

The FIN function returns a fraction of cases with a value within some range for each source variable.

The range is specified by the second and third arguments, and it is inclusive of those two values as well. If the second argument is greater than the third, they are automatically reversed.

If the second and third arguments are equal, FIN returns a fraction of cases with a value equal to the second argument.


First

The FIRST function returns the first non-missing value in a break group.

TODO: what happens if specified with a variable list argument?


Flt

The FLT function returns a fraction of cases with a value lesser than a specified second argument for each source variable.


Fout

The FOUT function returns a percentage of cases with a value outside of some range for each source variable.

The range is specified by the second and third arguments, and it is inclusive of those two values as well. If the second argument is greater than the third, they are automatically reversed.

If the second and third arguments are equal, FOUT returns a fraction of cases with a value not equal to the second argument.

FOUT is complementary of FIN.


Last

The LAST function returns the last non-missing value in a break group.

TODO: what happens if specified with a variable list argument?


Mean

The MEAN function returns a mean across cases for each source variable.

Note: only valid for numeric variables.


Max

The MAX function returns a maximum value for each source variable.


Median

The MEDIAN function returns a median value for each source variable.


Min

The MIN function returns a minimum value for each source variable.


N

The N function returns a weighted number of cases in a break group.

If specified with a variable list argument, the N function returns a weighted number of cases with non-missing values for each source variable. String values will never be considered missing.


Nmiss

The NMISS function returns a weighted number of missing cases in a break group.

TODO: what happens if specified with a variable list argument?


Nu

The NU function returns an unweighted number of cases in a break group.

If specified with a variable list argument, the NU function returns an unweighted number of cases with non-missing values for each source variable. String values will never be considered missing.


Numiss

The NUMISS function returns an unweighted number of missing cases in a break group.

TODO: what happens if specified with a variable list argument?


Pgt

The PGT function returns a percentage of cases with a value greater than a specified second argument for each source variable.


Pin

The PIN function returns a percentage of cases with a value within some range for each source variable.

The range is specified by the second and third arguments, and it is inclusive of those two values as well. If the second argument is greater than the third, they are automatically reversed.

If the second and third arguments are equal, PIN returns a percentage of cases with a value equal to the second argument.


Plt

The PLT function returns a percentage of cases with a value lesser than a specified second argument for each source variable.


Pout

The POUT function returns a percentage of cases with a value outside of some range for each source variable.

The range is specified by the second and third arguments, and it is inclusive of those two values as well. If the second argument is greater than the third, they are automatically reversed.

If the second and third arguments are equal, POUT returns a percentage of cases with a value not equal to the second argument.

POUT is complementary of PIN.


SD

The SD function returns a standard deviation across cases for each source variable.

Note: only valid for numeric variables.


Sum

The SUM function returns a sum across cases for each source variable.

Note: only valid for numeric variables.


CategoryRicottone

SPSS/Aggregate/Functions (last edited 2024-01-02 17:05:51 by DominicRicottone)