Examples (PARTIAL CORR command)
Writing Results to a Matrix Data File
GET FILE='/data/city.sav'.
PARTIAL CORR VARIABLES=BUSDRVER MECHANIC ENGINEER TEACHER COOK
BY NETSALRY(1)
/MATRIX=OUT('/data/partial_matrix.sav').
-
PARTIAL CORR
reads data from file city.sav and writes one set of matrix materials to file partial_matrix.sav. - The active dataset is still city.sav. Subsequent commands are executed on city.sav.
Writing Matrix Results That Replace the Active Dataset
GET FILE='/data/city.sav'.
PARTIAL CORR VARIABLES=BUSDRVER MECHANIC ENGINEER TEACHER COOK
BY NETSALRY(1) /MATRIX=OUT(*).
LIST.
-
PARTIAL CORR
writes the same matrix as in the example above. However, the matrix data file replaces the active dataset. TheLIST
command is executed on the matrix file, not on the CITY file.
Using a Matrix Data File as Input
GET FILE='/data/personnel.sav'.
FREQUENCIES VARIABLES=AGE.
PARTIAL CORR VARIABLES=BUSDRVER MECHANIC ENGINEER TEACHER COOK
BY NETSALRY(1) /MATRIX=IN('/data/corr_matrix.sav').
- This example performs a frequencies analysis on file personnel.sav and then uses a different file
for
PARTIAL CORR
. The file is an existing matrix data file. -
MATRIX=IN
specifies the matrix data file. Both the active dataset and the corr_matrix.sav file must contain all variables that are specified on theVARIABLES
subcommand onPARTIAL CORR
. - The corr_matrix.sav file does not replace personnel.sav as the active dataset.
Using an Active Dataset That Contains Matrix Data
GET FILE='/data/corr_matrix.sav'.
PARTIAL CORR VARIABLES=BUSDRVER MECHANIC ENGINEER TEACHER COOK
BY NETSALRY(1)
/MATRIX=IN(*).
- The
GET
command retrieves the matrix data file corr_matrix.sav. -
MATRIX=IN
specifies an asterisk because the active dataset is the matrix file CORMTX. IfMATRIX=IN('/data/corr_matrix.sav')
is specified, the program issues an error message. - If the
GET
command is omitted, the program issues an error message.GET FILE='/data/city.sav'. REGRESSION MATRIX=OUT(*) /VARIABLES=NETPURSE PUBTRANS MECHANIC BUSDRVER /DEPENDENT=NETPURSE /ENTER. PARTIAL CORR VARIABLES = PUBTRANS MECHANIC BUSDRVER BY NETPURSE(1) /MATRIX=IN(*).
-
GET
retrieves the IBM® SPSS® Statistics data file city.sav. -
REGRESSION
computes correlations among the specified variables.MATRIX=OUT(*)
writes a matrix data file that replaces the active dataset.