Quantcast

Re: Graphing multiple data elements with a grouping variable

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphing multiple data elements with a grouping variable

Matthew Nulle
I just upgraded from v18 to v21 within spss.  I was using the below syntax for relative weights but now am getting all types of errors.  Any advice on some corrections or other syntax to use for relative weights for v21?

The first error is concerning the naming structure of Corr.sav.  I am guessing if I fix this throughout the syntax it will correct most of the issues.  (full list of the first 50 errors below syntax.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT (Corr.sav).



***************************************************
********** RELATIVE WEIGHT ANALYSIS ************
***********Author : Deepanshu Bhalla*******************
****************************************************

*Specify a path where INPUT DATA FILE is saved.
FILE HANDLE Datafile /NAME='R:\APECS Clients\Compass\Key Drivers\Q1 2017\SPSS\Compass ATM.sav'.

*Specify a path where you wish OUTPUT files to be saved.
FILE HANDLE Directory /NAME='R:\APECS Clients\Compass\Key Drivers\Q1 2017\Output'.

*Define Independent Variable names.
DEFINE Ivars ( )
Q3B_NPS
Q3E_NPS
Q3F_NPS
Q3H_NPS
Q3I_NPS
Q3J_NPS
Q12_NPS
Q13B_NPS
Q17_NPS
S4_NPS
!ENDDEFINE .

*Define Dependent Variable name.
DEFINE Target ( )
Q9a_NPS
!ENDDEFINE .

*Define VARIABLE LABELING for Independent variables.
*Order of variable labeling and independent variables must be same.
*Space in labels should not be used, rather words separated by"_".
DEFINE LABELING ( )
Consistently_Op
Conduct_Trans
Fast_No_Wait
Accuracy_Trans
Easy_to_Understand
Easy_to_Use
Problem
Prob_Resolve
Sat_w_Resol
Successful
!ENDDEFINE.

GET FILE = 'DataFile'.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT (Corr.sav).

oms
  /select tables
  /if commands =['Regression'] SUBTYPES=['Coefficients']
  /destination format =SAV  outfile ='Betas.sav'
  /columns sequence =[RALL CALL LALL].

regression
  /dependent Target
  /method= enter Ivars.
omsend.

GET FILE='Betas.sav'.

FLIP ALL.

COMPUTE var6=INDEX(CASE_LBL, '_Beta').
RECODE var6 (1 THRU HIGHEST=1) (else=0).
SELECT IF var6=1.
EXECUTE .

DELETE VARIABLES CASE_LBL VAR6.

SAVE Outfile = 'Directory\Coefficients.sav'
/ RENAME = (var001=Coefficients).

GET FILE = corr.sav .
SELECT IF rowtype_ = 'CORR' .
EXECUTE.

matrix.

MGET / FILE = 'Corr.sav'
     / TYPE = CORR.

COMPUTE R = CR.

COMPUTE N = NCOL(R).
COMPUTE RXX = R(2:N,2:N).
COMPUTE RXY = R(2:N,1).
CALL EIGEN(RXX,EVEC,EV).
COMPUTE D = MDIAG(EV).
COMPUTE DELTA = SQRT(D).
COMPUTE LAMBDA = EVEC * DELTA * T(EVEC).
COMPUTE LAMBDASQ = LAMBDA &**2.
COMPUTE BETA1 = INV(LAMBDA) * RXY.
COMPUTE RSQUARE = CSSQ(BETA1).
COMPUTE RAWWGT = LAMBDASQ * BETA1 &**2.
COMPUTE IMPORT = (RAWWGT &/ RSQUARE) * 100.

PRINT RSQUARE /FORMAT=F8.8.
PRINT RAWWGT /FORMAT=F8.8
/TITLE = "Raw Relative Weights" .
PRINT IMPORT /FORMAT=PCT8.8
/TITLE = "Relative Weights as Percentage of R-square" .

SAVE RSQUARE
/OUTFILE='RSQ.sav'.
SAVE RAWWGT
/OUTFILE='Raw.sav'.
SAVE IMPORT
/OUTFILE='Relative.sav'.
END MATRIX.

INPUT PROGRAM.
NUMERIC LABELING (F25).
LOOP #=1 TO 1.
END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.
FLIP.

SAVE OUTFILE = 'Labeling.sav'
/ DROP VAR001
/ RENAME (CASE_LBL=Categories).

MATCH FILES FILE ='Labeling.sav'
/ FILE = 'Raw.sav'
/ Rename = (COL1 = RAW_RELATIVE)
/ FILE = 'Relative.sav'
/ Rename = (COL1 = PERCENT_RSQUARE)
/ FILE = 'Directory\Coefficients.sav'
/ FILE = 'RSQ.sav'
/ Rename = (COL1 = RSQUARE).

FORMATS  RAW_RELATIVE TO RSQUARE (F8.6).

SAVE TRANSLATE OUTFILE='Directory\Output_ALL.xls'  
  /TYPE=XLS
  /VERSION=8
  /REPLACE
  /FIELDNAMES
  /CELLS=VALUES.
EXECUTE.

Errors below...
49 Correlations Text: Corr.sav Command: CORRELATIONS
The filename is not valid.
Execution of this command stops.
63 OMSEnd Invalid file specification "Betas.sav".
65 GET FILE The filename is not valid.
79 GET FILE The filename is not valid.
80 SELECT IF Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command.
85 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
88 matrix An attempt has been made to use previously undefined matrix (or scalar).
88 matrix Right hand side of COMPUTE is undefined.
90 matrix An attempt has been made to use previously undefined matrix (or scalar).
90 matrix Undefined operand for NROW or NCOL.
91 matrix An attempt has been made to use previously undefined matrix (or scalar).
91 matrix Undefined or non-scalar operand in range.
92 matrix An attempt has been made to use previously undefined matrix (or scalar).
92 matrix Undefined or non-scalar operand in range.
93 matrix An attempt has been made to use previously undefined matrix (or scalar).
93 matrix Undefined source operand for EIGEN.
94 matrix An attempt has been made to use previously undefined matrix (or scalar).
94 matrix The argument of the MDIAG function is undefined.
95 matrix An attempt has been made to use previously undefined matrix (or scalar).
95 matrix Undefined operand for unary operator.
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix Undefined operand in matrix multiply.
97 matrix An attempt has been made to use previously undefined matrix (or scalar).
97 matrix Undefined operand for binary operator.
98 matrix An attempt has been made to use previously undefined matrix (or scalar).
98 matrix The matrix to invert is undefined.
99 matrix An attempt has been made to use previously undefined matrix (or scalar).
99 matrix Undefined source operand in one of the CMAX, CMIN, CSSQ, CSUM.
100 matrix An attempt has been made to use previously undefined matrix (or scalar).
100 matrix Undefined operand for binary operator.
101 matrix An attempt has been made to use previously undefined matrix (or scalar).
101 matrix An attempt has been made to use previously undefined matrix (or scalar).
101 matrix Undefined operand for binary operator.
103 matrix An attempt has been made to use previously undefined matrix (or scalar).
103 matrix Undefined variable in PRINT.
104 matrix An attempt has been made to use previously undefined matrix (or scalar).
104 matrix Undefined variable in PRINT.
106 matrix An attempt has been made to use previously undefined matrix (or scalar).
106 matrix Undefined variable in PRINT.
109 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
111 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
113 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
126 SAVE The specified file or directory is read-only and cannot be written to.  The file will not be saved.  Save the file with another name or to a different location or change the access permissions first.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES There is no working file to restore.  You must define a working file before proceeding with your analysis.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphing multiple data elements with a grouping variable

Maguin, Eugene
I may be misreading your syntax but I read it to say that in the correlation statement you are correlating to macro definition names. That fails and since what follows depends on that command executing correctly you get a lot of errors. No surprise. I don't think your macro is written correctly; however, I may be wrong. There's others on the list that are macro stars.
 Gene Maguin

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Matthew Nulle
Sent: Thursday, April 27, 2017 9:01 AM
To: [hidden email]
Subject: Re: Graphing multiple data elements with a grouping variable

I just upgraded from v18 to v21 within spss.  I was using the below syntax for relative weights but now am getting all types of errors.  Any advice on some corrections or other syntax to use for relative weights for v21?

The first error is concerning the naming structure of Corr.sav.  I am guessing if I fix this throughout the syntax it will correct most of the issues.  (full list of the first 50 errors below syntax.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT (Corr.sav).



***************************************************
********** RELATIVE WEIGHT ANALYSIS ************ ***********Author : Deepanshu Bhalla*******************
****************************************************

*Specify a path where INPUT DATA FILE is saved.
FILE HANDLE Datafile /NAME='R:\APECS Clients\Compass\Key Drivers\Q1 2017\SPSS\Compass ATM.sav'.

*Specify a path where you wish OUTPUT files to be saved.
FILE HANDLE Directory /NAME='R:\APECS Clients\Compass\Key Drivers\Q1 2017\Output'.

*Define Independent Variable names.
DEFINE Ivars ( )
Q3B_NPS
Q3E_NPS
Q3F_NPS
Q3H_NPS
Q3I_NPS
Q3J_NPS
Q12_NPS
Q13B_NPS
Q17_NPS
S4_NPS
!ENDDEFINE .

*Define Dependent Variable name.
DEFINE Target ( )
Q9a_NPS
!ENDDEFINE .

*Define VARIABLE LABELING for Independent variables.
*Order of variable labeling and independent variables must be same.
*Space in labels should not be used, rather words separated by"_".
DEFINE LABELING ( )
Consistently_Op
Conduct_Trans
Fast_No_Wait
Accuracy_Trans
Easy_to_Understand
Easy_to_Use
Problem
Prob_Resolve
Sat_w_Resol
Successful
!ENDDEFINE.

GET FILE = 'DataFile'.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT (Corr.sav).

oms
  /select tables
  /if commands =['Regression'] SUBTYPES=['Coefficients']
  /destination format =SAV  outfile ='Betas.sav'
  /columns sequence =[RALL CALL LALL].

regression
  /dependent Target
  /method= enter Ivars.
omsend.

GET FILE='Betas.sav'.

FLIP ALL.

COMPUTE var6=INDEX(CASE_LBL, '_Beta').
RECODE var6 (1 THRU HIGHEST=1) (else=0).
SELECT IF var6=1.
EXECUTE .

DELETE VARIABLES CASE_LBL VAR6.

SAVE Outfile = 'Directory\Coefficients.sav'
/ RENAME = (var001=Coefficients).

GET FILE = corr.sav .
SELECT IF rowtype_ = 'CORR' .
EXECUTE.

matrix.

MGET / FILE = 'Corr.sav'
     / TYPE = CORR.

COMPUTE R = CR.

COMPUTE N = NCOL(R).
COMPUTE RXX = R(2:N,2:N).
COMPUTE RXY = R(2:N,1).
CALL EIGEN(RXX,EVEC,EV).
COMPUTE D = MDIAG(EV).
COMPUTE DELTA = SQRT(D).
COMPUTE LAMBDA = EVEC * DELTA * T(EVEC).
COMPUTE LAMBDASQ = LAMBDA &**2.
COMPUTE BETA1 = INV(LAMBDA) * RXY.
COMPUTE RSQUARE = CSSQ(BETA1).
COMPUTE RAWWGT = LAMBDASQ * BETA1 &**2.
COMPUTE IMPORT = (RAWWGT &/ RSQUARE) * 100.

PRINT RSQUARE /FORMAT=F8.8.
PRINT RAWWGT /FORMAT=F8.8
/TITLE = "Raw Relative Weights" .
PRINT IMPORT /FORMAT=PCT8.8
/TITLE = "Relative Weights as Percentage of R-square" .

SAVE RSQUARE
/OUTFILE='RSQ.sav'.
SAVE RAWWGT
/OUTFILE='Raw.sav'.
SAVE IMPORT
/OUTFILE='Relative.sav'.
END MATRIX.

INPUT PROGRAM.
NUMERIC LABELING (F25).
LOOP #=1 TO 1.
END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.
FLIP.

SAVE OUTFILE = 'Labeling.sav'
/ DROP VAR001
/ RENAME (CASE_LBL=Categories).

MATCH FILES FILE ='Labeling.sav'
/ FILE = 'Raw.sav'
/ Rename = (COL1 = RAW_RELATIVE)
/ FILE = 'Relative.sav'
/ Rename = (COL1 = PERCENT_RSQUARE)
/ FILE = 'Directory\Coefficients.sav'
/ FILE = 'RSQ.sav'
/ Rename = (COL1 = RSQUARE).

FORMATS  RAW_RELATIVE TO RSQUARE (F8.6).

SAVE TRANSLATE OUTFILE='Directory\Output_ALL.xls'  
  /TYPE=XLS
  /VERSION=8
  /REPLACE
  /FIELDNAMES
  /CELLS=VALUES.
EXECUTE.

Errors below...
49 Correlations Text: Corr.sav Command: CORRELATIONS The filename is not valid.
Execution of this command stops.
63 OMSEnd Invalid file specification "Betas.sav".
65 GET FILE The filename is not valid.
79 GET FILE The filename is not valid.
80 SELECT IF Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command.
85 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
88 matrix An attempt has been made to use previously undefined matrix (or scalar).
88 matrix Right hand side of COMPUTE is undefined.
90 matrix An attempt has been made to use previously undefined matrix (or scalar).
90 matrix Undefined operand for NROW or NCOL.
91 matrix An attempt has been made to use previously undefined matrix (or scalar).
91 matrix Undefined or non-scalar operand in range.
92 matrix An attempt has been made to use previously undefined matrix (or scalar).
92 matrix Undefined or non-scalar operand in range.
93 matrix An attempt has been made to use previously undefined matrix (or scalar).
93 matrix Undefined source operand for EIGEN.
94 matrix An attempt has been made to use previously undefined matrix (or scalar).
94 matrix The argument of the MDIAG function is undefined.
95 matrix An attempt has been made to use previously undefined matrix (or scalar).
95 matrix Undefined operand for unary operator.
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix Undefined operand in matrix multiply.
97 matrix An attempt has been made to use previously undefined matrix (or scalar).
97 matrix Undefined operand for binary operator.
98 matrix An attempt has been made to use previously undefined matrix (or scalar).
98 matrix The matrix to invert is undefined.
99 matrix An attempt has been made to use previously undefined matrix (or scalar).
99 matrix Undefined source operand in one of the CMAX, CMIN, CSSQ, CSUM.
100 matrix An attempt has been made to use previously undefined matrix (or scalar).
100 matrix Undefined operand for binary operator.
101 matrix An attempt has been made to use previously undefined matrix (or scalar).
101 matrix An attempt has been made to use previously undefined matrix (or scalar).
101 matrix Undefined operand for binary operator.
103 matrix An attempt has been made to use previously undefined matrix (or scalar).
103 matrix Undefined variable in PRINT.
104 matrix An attempt has been made to use previously undefined matrix (or scalar).
104 matrix Undefined variable in PRINT.
106 matrix An attempt has been made to use previously undefined matrix (or scalar).
106 matrix Undefined variable in PRINT.
109 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
111 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
113 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
126 SAVE The specified file or directory is read-only and cannot be written to.  The file will not be saved.  Save the file with another name or to a different location or change the access permissions first.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES There is no working file to restore.  You must define a working file before proceeding with your analysis.

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphing multiple data elements with a grouping variable

David Marso
Administrator
Best and only advice I will provide at the moment is to use DATASETS rather than files where applicable.
look up SET MPRINT ON and use it.
Note that just prior to the barrage of chaos, the file you are trying to use is the active file so use * rather than the disc file name.
FINALLY!!! Start a NEW topic rather than hijacking a prior thread.


Maguin, Eugene wrote
I may be misreading your syntax but I read it to say that in the correlation statement you are correlating to macro definition names. That fails and since what follows depends on that command executing correctly you get a lot of errors. No surprise. I don't think your macro is written correctly; however, I may be wrong. There's others on the list that are macro stars.
 Gene Maguin

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Matthew Nulle
Sent: Thursday, April 27, 2017 9:01 AM
To: [hidden email]
Subject: Re: Graphing multiple data elements with a grouping variable

I just upgraded from v18 to v21 within spss.  I was using the below syntax for relative weights but now am getting all types of errors.  Any advice on some corrections or other syntax to use for relative weights for v21?

The first error is concerning the naming structure of Corr.sav.  I am guessing if I fix this throughout the syntax it will correct most of the issues.  (full list of the first 50 errors below syntax.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT (Corr.sav).



***************************************************
********** RELATIVE WEIGHT ANALYSIS ************ ***********Author : Deepanshu Bhalla*******************
****************************************************

*Specify a path where INPUT DATA FILE is saved.
FILE HANDLE Datafile /NAME='R:\APECS Clients\Compass\Key Drivers\Q1 2017\SPSS\Compass ATM.sav'.

*Specify a path where you wish OUTPUT files to be saved.
FILE HANDLE Directory /NAME='R:\APECS Clients\Compass\Key Drivers\Q1 2017\Output'.

*Define Independent Variable names.
DEFINE Ivars ( )
Q3B_NPS
Q3E_NPS
Q3F_NPS
Q3H_NPS
Q3I_NPS
Q3J_NPS
Q12_NPS
Q13B_NPS
Q17_NPS
S4_NPS
!ENDDEFINE .

*Define Dependent Variable name.
DEFINE Target ( )
Q9a_NPS
!ENDDEFINE .

*Define VARIABLE LABELING for Independent variables.
*Order of variable labeling and independent variables must be same.
*Space in labels should not be used, rather words separated by"_".
DEFINE LABELING ( )
Consistently_Op
Conduct_Trans
Fast_No_Wait
Accuracy_Trans
Easy_to_Understand
Easy_to_Use
Problem
Prob_Resolve
Sat_w_Resol
Successful
!ENDDEFINE.

GET FILE = 'DataFile'.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT (Corr.sav).

oms
  /select tables
  /if commands =['Regression'] SUBTYPES=['Coefficients']
  /destination format =SAV  outfile ='Betas.sav'
  /columns sequence =[RALL CALL LALL].

regression
  /dependent Target
  /method= enter Ivars.
omsend.

GET FILE='Betas.sav'.

FLIP ALL.

COMPUTE var6=INDEX(CASE_LBL, '_Beta').
RECODE var6 (1 THRU HIGHEST=1) (else=0).
SELECT IF var6=1.
EXECUTE .

DELETE VARIABLES CASE_LBL VAR6.

SAVE Outfile = 'Directory\Coefficients.sav'
/ RENAME = (var001=Coefficients).

GET FILE = corr.sav .
SELECT IF rowtype_ = 'CORR' .
EXECUTE.

matrix.

MGET / FILE = 'Corr.sav'
     / TYPE = CORR.

COMPUTE R = CR.

COMPUTE N = NCOL(R).
COMPUTE RXX = R(2:N,2:N).
COMPUTE RXY = R(2:N,1).
CALL EIGEN(RXX,EVEC,EV).
COMPUTE D = MDIAG(EV).
COMPUTE DELTA = SQRT(D).
COMPUTE LAMBDA = EVEC * DELTA * T(EVEC).
COMPUTE LAMBDASQ = LAMBDA &**2.
COMPUTE BETA1 = INV(LAMBDA) * RXY.
COMPUTE RSQUARE = CSSQ(BETA1).
COMPUTE RAWWGT = LAMBDASQ * BETA1 &**2.
COMPUTE IMPORT = (RAWWGT &/ RSQUARE) * 100.

PRINT RSQUARE /FORMAT=F8.8.
PRINT RAWWGT /FORMAT=F8.8
/TITLE = "Raw Relative Weights" .
PRINT IMPORT /FORMAT=PCT8.8
/TITLE = "Relative Weights as Percentage of R-square" .

SAVE RSQUARE
/OUTFILE='RSQ.sav'.
SAVE RAWWGT
/OUTFILE='Raw.sav'.
SAVE IMPORT
/OUTFILE='Relative.sav'.
END MATRIX.

INPUT PROGRAM.
NUMERIC LABELING (F25).
LOOP #=1 TO 1.
END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.
FLIP.

SAVE OUTFILE = 'Labeling.sav'
/ DROP VAR001
/ RENAME (CASE_LBL=Categories).

MATCH FILES FILE ='Labeling.sav'
/ FILE = 'Raw.sav'
/ Rename = (COL1 = RAW_RELATIVE)
/ FILE = 'Relative.sav'
/ Rename = (COL1 = PERCENT_RSQUARE)
/ FILE = 'Directory\Coefficients.sav'
/ FILE = 'RSQ.sav'
/ Rename = (COL1 = RSQUARE).

FORMATS  RAW_RELATIVE TO RSQUARE (F8.6).

SAVE TRANSLATE OUTFILE='Directory\Output_ALL.xls'  
  /TYPE=XLS
  /VERSION=8
  /REPLACE
  /FIELDNAMES
  /CELLS=VALUES.
EXECUTE.

Errors below...
49 Correlations Text: Corr.sav Command: CORRELATIONS The filename is not valid.
Execution of this command stops.
63 OMSEnd Invalid file specification "Betas.sav".
65 GET FILE The filename is not valid.
79 GET FILE The filename is not valid.
80 SELECT IF Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command.
85 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
88 matrix An attempt has been made to use previously undefined matrix (or scalar).
88 matrix Right hand side of COMPUTE is undefined.
90 matrix An attempt has been made to use previously undefined matrix (or scalar).
90 matrix Undefined operand for NROW or NCOL.
91 matrix An attempt has been made to use previously undefined matrix (or scalar).
91 matrix Undefined or non-scalar operand in range.
92 matrix An attempt has been made to use previously undefined matrix (or scalar).
92 matrix Undefined or non-scalar operand in range.
93 matrix An attempt has been made to use previously undefined matrix (or scalar).
93 matrix Undefined source operand for EIGEN.
94 matrix An attempt has been made to use previously undefined matrix (or scalar).
94 matrix The argument of the MDIAG function is undefined.
95 matrix An attempt has been made to use previously undefined matrix (or scalar).
95 matrix Undefined operand for unary operator.
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix Undefined operand in matrix multiply.
97 matrix An attempt has been made to use previously undefined matrix (or scalar).
97 matrix Undefined operand for binary operator.
98 matrix An attempt has been made to use previously undefined matrix (or scalar).
98 matrix The matrix to invert is undefined.
99 matrix An attempt has been made to use previously undefined matrix (or scalar).
99 matrix Undefined source operand in one of the CMAX, CMIN, CSSQ, CSUM.
100 matrix An attempt has been made to use previously undefined matrix (or scalar).
100 matrix Undefined operand for binary operator.
101 matrix An attempt has been made to use previously undefined matrix (or scalar).
101 matrix An attempt has been made to use previously undefined matrix (or scalar).
101 matrix Undefined operand for binary operator.
103 matrix An attempt has been made to use previously undefined matrix (or scalar).
103 matrix Undefined variable in PRINT.
104 matrix An attempt has been made to use previously undefined matrix (or scalar).
104 matrix Undefined variable in PRINT.
106 matrix An attempt has been made to use previously undefined matrix (or scalar).
106 matrix Undefined variable in PRINT.
109 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
111 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
113 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
126 SAVE The specified file or directory is read-only and cannot be written to.  The file will not be saved.  Save the file with another name or to a different location or change the access permissions first.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES There is no working file to restore.  You must define a working file before proceeding with your analysis.

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphing multiple data elements with a grouping variable

PRogman
In reply to this post by Matthew Nulle
Correlations...

The keyword OUT specifies the file to which the matrix is written. Specify an asterisk to replace the active dataset or a quoted file specification or dataset name, enclosed in parentheses.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT ('Corr.sav').

/PR

Matthew Nulle wrote
I just upgraded from v18 to v21 within spss.  I was using the below syntax for relative weights but now am getting all types of errors.  Any advice on some corrections or other syntax to use for relative weights for v21?

The first error is concerning the naming structure of Corr.sav.  I am guessing if I fix this throughout the syntax it will correct most of the issues.  (full list of the first 50 errors below syntax.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT (Corr.sav).

...


Errors below...
49 Correlations Text: Corr.sav Command: CORRELATIONS
The filename is not valid.
Execution of this command stops.

...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphing multiple data elements with a grouping variable

David Marso
Administrator
In reply to this post by David Marso
BTW:  The "design" of this (if you can even call it that) is truly ABYSMAL!  Try reading up on how to send parameters into a macro.  Having this batch of stand alone multiple macro definitions is terribly flawed!

HINT!!!

DEFINE !Parameterized (dep TOKENS(1) /indep CHAREND("/") /labels !CMDEND )
REGRESSION DEPENDENT !dep /METHOD ENTER !indep .
!ENDDEFINE .

!Parameterized dep =var1 indep= x y z var2 TO var10 var11 /labels= a b c d e f .

Suggestions:  Bag up those howling cats and repackage appropriately.  
Resubmit question after doing a bit of weekend RTFMing and learning how to write proper code.
HTH



David Marso wrote
Best and only advice I will provide at the moment is to use DATASETS rather than files where applicable.
look up SET MPRINT ON and use it.
Note that just prior to the barrage of chaos, the file you are trying to use is the active file so use * rather than the disc file name.
FINALLY!!! Start a NEW topic rather than hijacking a prior thread.


Maguin, Eugene wrote
I may be misreading your syntax but I read it to say that in the correlation statement you are correlating to macro definition names. That fails and since what follows depends on that command executing correctly you get a lot of errors. No surprise. I don't think your macro is written correctly; however, I may be wrong. There's others on the list that are macro stars.
 Gene Maguin

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Matthew Nulle
Sent: Thursday, April 27, 2017 9:01 AM
To: [hidden email]
Subject: Re: Graphing multiple data elements with a grouping variable

I just upgraded from v18 to v21 within spss.  I was using the below syntax for relative weights but now am getting all types of errors.  Any advice on some corrections or other syntax to use for relative weights for v21?

The first error is concerning the naming structure of Corr.sav.  I am guessing if I fix this throughout the syntax it will correct most of the issues.  (full list of the first 50 errors below syntax.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT (Corr.sav).



***************************************************
********** RELATIVE WEIGHT ANALYSIS ************ ***********Author : Deepanshu Bhalla*******************
****************************************************

*Specify a path where INPUT DATA FILE is saved.
FILE HANDLE Datafile /NAME='R:\APECS Clients\Compass\Key Drivers\Q1 2017\SPSS\Compass ATM.sav'.

*Specify a path where you wish OUTPUT files to be saved.
FILE HANDLE Directory /NAME='R:\APECS Clients\Compass\Key Drivers\Q1 2017\Output'.

*Define Independent Variable names.
DEFINE Ivars ( )
Q3B_NPS
Q3E_NPS
Q3F_NPS
Q3H_NPS
Q3I_NPS
Q3J_NPS
Q12_NPS
Q13B_NPS
Q17_NPS
S4_NPS
!ENDDEFINE .

*Define Dependent Variable name.
DEFINE Target ( )
Q9a_NPS
!ENDDEFINE .

*Define VARIABLE LABELING for Independent variables.
*Order of variable labeling and independent variables must be same.
*Space in labels should not be used, rather words separated by"_".
DEFINE LABELING ( )
Consistently_Op
Conduct_Trans
Fast_No_Wait
Accuracy_Trans
Easy_to_Understand
Easy_to_Use
Problem
Prob_Resolve
Sat_w_Resol
Successful
!ENDDEFINE.

GET FILE = 'DataFile'.

CORRELATIONS
/VARIABLES= Target Ivars
/MISSING=PAIRWISE
/MATRIX = OUT (Corr.sav).

oms
  /select tables
  /if commands =['Regression'] SUBTYPES=['Coefficients']
  /destination format =SAV  outfile ='Betas.sav'
  /columns sequence =[RALL CALL LALL].

regression
  /dependent Target
  /method= enter Ivars.
omsend.

GET FILE='Betas.sav'.

FLIP ALL.

COMPUTE var6=INDEX(CASE_LBL, '_Beta').
RECODE var6 (1 THRU HIGHEST=1) (else=0).
SELECT IF var6=1.
EXECUTE .

DELETE VARIABLES CASE_LBL VAR6.

SAVE Outfile = 'Directory\Coefficients.sav'
/ RENAME = (var001=Coefficients).

GET FILE = corr.sav .
SELECT IF rowtype_ = 'CORR' .
EXECUTE.

matrix.

MGET / FILE = 'Corr.sav'
     / TYPE = CORR.

COMPUTE R = CR.

COMPUTE N = NCOL(R).
COMPUTE RXX = R(2:N,2:N).
COMPUTE RXY = R(2:N,1).
CALL EIGEN(RXX,EVEC,EV).
COMPUTE D = MDIAG(EV).
COMPUTE DELTA = SQRT(D).
COMPUTE LAMBDA = EVEC * DELTA * T(EVEC).
COMPUTE LAMBDASQ = LAMBDA &**2.
COMPUTE BETA1 = INV(LAMBDA) * RXY.
COMPUTE RSQUARE = CSSQ(BETA1).
COMPUTE RAWWGT = LAMBDASQ * BETA1 &**2.
COMPUTE IMPORT = (RAWWGT &/ RSQUARE) * 100.

PRINT RSQUARE /FORMAT=F8.8.
PRINT RAWWGT /FORMAT=F8.8
/TITLE = "Raw Relative Weights" .
PRINT IMPORT /FORMAT=PCT8.8
/TITLE = "Relative Weights as Percentage of R-square" .

SAVE RSQUARE
/OUTFILE='RSQ.sav'.
SAVE RAWWGT
/OUTFILE='Raw.sav'.
SAVE IMPORT
/OUTFILE='Relative.sav'.
END MATRIX.

INPUT PROGRAM.
NUMERIC LABELING (F25).
LOOP #=1 TO 1.
END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.
FLIP.

SAVE OUTFILE = 'Labeling.sav'
/ DROP VAR001
/ RENAME (CASE_LBL=Categories).

MATCH FILES FILE ='Labeling.sav'
/ FILE = 'Raw.sav'
/ Rename = (COL1 = RAW_RELATIVE)
/ FILE = 'Relative.sav'
/ Rename = (COL1 = PERCENT_RSQUARE)
/ FILE = 'Directory\Coefficients.sav'
/ FILE = 'RSQ.sav'
/ Rename = (COL1 = RSQUARE).

FORMATS  RAW_RELATIVE TO RSQUARE (F8.6).

SAVE TRANSLATE OUTFILE='Directory\Output_ALL.xls'  
  /TYPE=XLS
  /VERSION=8
  /REPLACE
  /FIELDNAMES
  /CELLS=VALUES.
EXECUTE.

Errors below...
49 Correlations Text: Corr.sav Command: CORRELATIONS The filename is not valid.
Execution of this command stops.
63 OMSEnd Invalid file specification "Betas.sav".
65 GET FILE The filename is not valid.
79 GET FILE The filename is not valid.
80 SELECT IF Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command.
85 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
88 matrix An attempt has been made to use previously undefined matrix (or scalar).
88 matrix Right hand side of COMPUTE is undefined.
90 matrix An attempt has been made to use previously undefined matrix (or scalar).
90 matrix Undefined operand for NROW or NCOL.
91 matrix An attempt has been made to use previously undefined matrix (or scalar).
91 matrix Undefined or non-scalar operand in range.
92 matrix An attempt has been made to use previously undefined matrix (or scalar).
92 matrix Undefined or non-scalar operand in range.
93 matrix An attempt has been made to use previously undefined matrix (or scalar).
93 matrix Undefined source operand for EIGEN.
94 matrix An attempt has been made to use previously undefined matrix (or scalar).
94 matrix The argument of the MDIAG function is undefined.
95 matrix An attempt has been made to use previously undefined matrix (or scalar).
95 matrix Undefined operand for unary operator.
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix An attempt has been made to use previously undefined matrix (or scalar).
96 matrix Undefined operand in matrix multiply.
97 matrix An attempt has been made to use previously undefined matrix (or scalar).
97 matrix Undefined operand for binary operator.
98 matrix An attempt has been made to use previously undefined matrix (or scalar).
98 matrix The matrix to invert is undefined.
99 matrix An attempt has been made to use previously undefined matrix (or scalar).
99 matrix Undefined source operand in one of the CMAX, CMIN, CSSQ, CSUM.
100 matrix An attempt has been made to use previously undefined matrix (or scalar).
100 matrix Undefined operand for binary operator.
101 matrix An attempt has been made to use previously undefined matrix (or scalar).
101 matrix An attempt has been made to use previously undefined matrix (or scalar).
101 matrix Undefined operand for binary operator.
103 matrix An attempt has been made to use previously undefined matrix (or scalar).
103 matrix Undefined variable in PRINT.
104 matrix An attempt has been made to use previously undefined matrix (or scalar).
104 matrix Undefined variable in PRINT.
106 matrix An attempt has been made to use previously undefined matrix (or scalar).
106 matrix Undefined variable in PRINT.
109 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
111 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
113 matrix SPSS Statistics cannot access a file with the given file specification.  The file specification is either syntactically invalid, specifies an invalid drive, specifies a protected directory, specifies a protected file, or specifies a non-sharable file.
126 SAVE The specified file or directory is read-only and cannot be written to.  The file will not be saved.  Save the file with another name or to a different location or change the access permissions first.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES The filename is not valid.
130 MATCH FILES There is no working file to restore.  You must define a working file before proceeding with your analysis.

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphing multiple data elements with a grouping variable

Bruce Weaver
Administrator
In reply to this post by David Marso
Re the point about starting a new topic, I agree.  At the moment, however, this is challenging for folks who use Nabble to post to the list, because the New Topic button has been missing for some time.  David, I believe you notified Hugo about this, right?  Any word from him on when we can expect it to be fixed?  

Cheers,
Bruce

David Marso wrote
Best and only advice I will provide at the moment is to use DATASETS rather than files where applicable.
look up SET MPRINT ON and use it.
Note that just prior to the barrage of chaos, the file you are trying to use is the active file so use * rather than the disc file name.
FINALLY!!! Start a NEW topic rather than hijacking a prior thread.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphing multiple data elements with a grouping variable

David Marso
Administrator
Point taken.  I just fired off an email to relevant parties/powers that be.
I tried to retitle this earlier today and it didn't take.
I guess you might have moved it from the earlier thread?
--
Bruce Weaver wrote
Re the point about starting a new topic, I agree.  At the moment, however, this is challenging for folks who use Nabble to post to the list, because the New Topic button has been missing for some time.  David, I believe you notified Hugo about this, right?  Any word from him on when we can expect it to be fixed?  

Cheers,
Bruce

David Marso wrote
Best and only advice I will provide at the moment is to use DATASETS rather than files where applicable.
look up SET MPRINT ON and use it.
Note that just prior to the barrage of chaos, the file you are trying to use is the active file so use * rather than the disc file name.
FINALLY!!! Start a NEW topic rather than hijacking a prior thread.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Graphing multiple data elements with a grouping variable

Bruce Weaver
Administrator
Yes, I moved it from the other thread a day or two ago.  I also tried to edit the title, but that didn't work for me either.


David Marso wrote
Point taken.  I just fired off an email to relevant parties/powers that be.
I tried to retitle this earlier today and it didn't take.
I guess you might have moved it from the earlier thread?
--
Bruce Weaver wrote
Re the point about starting a new topic, I agree.  At the moment, however, this is challenging for folks who use Nabble to post to the list, because the New Topic button has been missing for some time.  David, I believe you notified Hugo about this, right?  Any word from him on when we can expect it to be fixed?  

Cheers,
Bruce

David Marso wrote
Best and only advice I will provide at the moment is to use DATASETS rather than files where applicable.
look up SET MPRINT ON and use it.
Note that just prior to the barrage of chaos, the file you are trying to use is the active file so use * rather than the disc file name.
FINALLY!!! Start a NEW topic rather than hijacking a prior thread.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
Loading...