dear list, i am trying to run the parallel analysis spss code for raw data provided by o'connor and when i run the "get raw / file = ..." command, spss will return an error message, because it can't handle the "raw" in front of "file". when i try to rename the file like "get file = ... dataset name raw dataset activate raw", the code won't run either, instead spss returns an error for almost every following code line saying that either the command has too many characters or it is not defined or that the characters don't match any existing function or vector. does anyone have an idea what i am doing wrong here? i am using a mac, maybe this is of interest. thanks a lot! etb
|
Administrator
|
Post you exact syntax and the exact error message.
This post is pretty much incoherent!
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?" |
Sorry!
Here's the Syntax: *** set mxloops=9000 printback=off width=80 seed = 1953125. matrix. * Enter the name/location of the data file for analyses after "FILE ="; If you specify "FILE = *", then the program will read the current, active SPSS data file; Alternatively, enter the name/location of a previously saved SPSS data file instead of "*" you can use the "/ VAR =" subcommand after "/ missing=omit" subcommand to select variables for the analyses. GET FILE = '/Users/etb/Desktop/NEO150.sav'. DATASET NAME raw. DATASET ACTIVATE raw. * Enter the desired number of parallel data sets here. compute ndatsets = 1000. * Enter the desired percentile here. compute percent = 95. compute kind = 1. compute randtype = 2. ****************** End of user specifications. ****************** compute ncases = nrow(raw). compute nvars = ncol(raw). do if (kind = 1 and randtype = 2). compute nm1 = 1 / (ncases-1). compute vcv = nm1 * (sscp(raw) - ((t(csum(raw))*csum(raw))/ncases)). compute d = inv(mdiag(sqrt(diag(vcv)))). compute realeval = eval(d * vcv * d). compute evals = make(nvars,ndatsets,-9999). loop #nds = 1 to ndatsets. compute x = raw. loop #c = 1 to nvars. loop #r = 1 to (ncases -1). compute k = trunc( (ncases - #r + 1) * uniform(1,1) + 1 ) + #r - 1. compute d = x(#r,#c). compute x(#r,#c) = x(k,#c). compute x(k,#c) = d. end loop. end loop. compute vcv = nm1 * (sscp(x) - ((t(csum(x))*csum(x))/ncases)). compute d = inv(mdiag(sqrt(diag(vcv)))). compute evals(:,#nds) = eval(d * vcv * d). end loop. end if. * identifying the eigenvalues corresponding to the desired percentile. compute num = rnd((percent*ndatsets)/100). compute results = { t(1:nvars), realeval, t(1:nvars), t(1:nvars) }. loop #root = 1 to nvars. compute ranks = rnkorder(evals(#root,:)). loop #col = 1 to ndatsets. do if (ranks(1,#col) = num). compute results(#root,4) = evals(#root,#col). break. end if. end loop. end loop. compute results(:,3) = rsum(evals) / ndatsets. print /title="PARALLEL ANALYSIS:". do if (kind = 1 and randtype = 1). print /title="Principal Components & Random Normal Data Generation". else if (kind = 1 and randtype = 2). print /title="Principal Components & Raw Data Permutation". else if (kind = 2 and randtype = 1). print /title="PAF/Common Factor Analysis & Random Normal Data Generation". else if (kind = 2 and randtype = 2). print /title="PAF/Common Factor Analysis & Raw Data Permutation". end if. compute specifs = {ncases; nvars; ndatsets; percent}. print specifs /title="Specifications for this Run:" /rlabels="Ncases" "Nvars" "Ndatsets" "Percent". print results /title="Raw Data Eigenvalues, & Mean & Percentile Random Data Eigenvalues" /clabels="Root" "Raw Data" "Means" "Prcntyle" /format "f12.6". compute root = results(:,1). compute rawdata = results(:,2). compute percntyl = results(:,4). save results /outfile= 'screedata.sav' / var=root rawdata means percntyl . end matrix. * plots the eigenvalues, by root, for the real/raw data and for the random data. GET file= 'screedata.sav'. TSPLOT VARIABLES= rawdata means percntyl /ID= root /NOLOG. **** It returns the following error message: ***>Error # 14330 in column 10. Text: = >MATRIX syntax error: illegal use of a reserved word or a relational operator. >Reserved words are: TO, BY, WITH, EQ, NE, GT, GE, LT, LE, NOT, OR, XOR, AND. >Relational operators are: =, ^=, <>, >, >=, <, <=. >Execution of this command stops. The MATRIX statement skipped. >Error # 12546 in column 1. Text: DATASET >MATRIX syntax error: unrecognized statement name. Is it spelled correctly? >Execution of this command stops. Scan error detected in parser. The MATRIX statement skipped. >Error # 12546 in column 1. Text: DATASET >MATRIX syntax error: unrecognized statement name. Is it spelled correctly? >Execution of this command stops. Scan error detected in parser. The MATRIX statement skipped. Run MATRIX procedure: >Error encountered in source line # 162 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'RAW' is undefined >Error encountered in source line # 162 >Error # 12345 >Undefined operand for NROW or NCOL. >Error encountered in source line # 167 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'RAW' is undefined >Error encountered in source line # 167 >Error # 12345 >Undefined operand for NROW or NCOL. >Error encountered in source line # 171 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'NCASES' is undefined >Error encountered in source line # 171 >Error # 12347 >Undefined operand for binary operator. >Error encountered in source line # 195 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'NVARS' is undefined >Error encountered in source line # 195 >Error # 12334 >Undefined or non-scalar operand in range. >Error encountered in source line # 196 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'NVARS' is undefined >Error encountered in source line # 196 >Error # 12339 >Loop "TO" value undefined or non-scalar. >Error encountered in source line # 205 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'EVALS' is undefined >Error encountered in source line # 205 >Error # 12422 >Undefined source operand for one of the RMAX, RMIN, RSSQ, RSUM. PARALLEL ANALYSIS: Principal Components & Raw Data Permutation >Error encountered in source line # 217 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'NCASES' is undefined >Error encountered in source line # 217 >Error # 12363 >Undefined operand in the expression inside brackets. >Error encountered in source line # 218 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'SPECIFS' is undefined >Error encountered in source line # 218 >Error # 12332 >Undefined variable in PRINT. >Error encountered in source line # 220 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'RESULTS' is undefined >Error encountered in source line # 220 >Error # 12332 >Undefined variable in PRINT. >Error encountered in source line # 223 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'RESULTS' is undefined >Error encountered in source line # 223 >Error # 12349 >Undefined error #12349 - not found in file "/Applications/IBM/SPSS/Statistics/24/SPSSStatistics.app/Contents/bin/lang/en/spss.err" >Error encountered in source line # 226 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'RESULTS' is undefined >Error encountered in source line # 226 >Error # 12349 >Undefined error #12349 - not found in file "/Applications/IBM/SPSS/Statistics/24/SPSSStatistics.app/Contents/bin/lang/en/spss.err" >Error encountered in source line # 227 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'RESULTS' is undefined >Error encountered in source line # 227 >Error # 12349 >Undefined error #12349 - not found in file "/Applications/IBM/SPSS/Statistics/24/SPSSStatistics.app/Contents/bin/lang/en/spss.err" >Error encountered in source line # 228 >Error # 12492 >An attempt has been made to use previously undefined matrix (or scalar). >Execution of this command stops. Matrix - 'RESULTS' is undefined >Error encountered in source line # 228 >Error # 12459 >The matrix to save is undefined. ------ END MATRIX ----- *** When I change the GET FILE command to... GET raw / FILE = .... and then run the rest of the Syntax, I get the following errors: ***>Error # 5252 in column 5. Text: raw >The GET command does not start with the FILE subcommand. The FILE subcommand >is required and must be the first subcommand. >Execution of this command stops. >Error # 4023 in column 20. Text: nrow >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4023 in column 20. Text: ncol >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4285 in column 20. Text: ncases >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4285 in column 15. Text: nm1 >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4023 in column 13. Text: inv >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4023 in column 20. Text: eval >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4023 in column 17. Text: make >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4285 in column 13. Text: raw >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4285 in column 16. Text: nvars >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4285 in column 17. Text: ncases >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4285 in column 21. Text: ncases >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4023 in column 13. Text: x >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4030 in column 9. Text: x >The operand appearing on the left side of the assignment operator (equals >sign) is not a known vector name or function name. >Execution of this command stops. >Error # 4030 in column 9. Text: x >The operand appearing on the left side of the assignment operator (equals >sign) is not a known vector name or function name. >Execution of this command stops. >Error # 4045. Command name: end loop >The END LOOP command does not follow an unclosed LOOP command. Maybe the LOOP >command was not recognized because of an error. Use the level-of-control >shown to the left of the SPSS Statistics commands to determine the range of >LOOPs and DO IFs. >Execution of this command stops. >Error # 4285 in column 15. Text: nm1 >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4023 in column 13. Text: inv >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4030 in column 9. Text: evals >The operand appearing on the left side of the assignment operator (equals >sign) is not a known vector name or function name. >Execution of this command stops. >Error # 4045. Command name: end loop >The END LOOP command does not follow an unclosed LOOP command. Maybe the LOOP >command was not recognized because of an error. Use the level-of-control >shown to the left of the SPSS Statistics commands to determine the range of >LOOPs and DO IFs. >Execution of this command stops. >Error # 4007 in column 19. Text: { >The expression is incomplete. Check for missing operands, invalid operators, >unmatched parentheses or excessive string length. >Execution of this command stops. >Error # 4285 in column 19. Text: nvars >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4023 in column 17. Text: rnkorder >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4317 in column 20. Text: ) >Incorrect number of arguments to the RANGE or ANY functions. RANGE requires >an odd number larger than two, and ANY requires at least two. Check for a >comma used as a decimal delimiter. Commas cannot be used as decimal >delimiters in transformations. >Execution of this command stops. >Error # 4030 in column 9. Text: results >The operand appearing on the left side of the assignment operator (equals >sign) is not a known vector name or function name. >Execution of this command stops. >Error # 4070. Command name: end if >The command does not follow an unclosed DO IF command. Maybe the DO IF >command was not recognized because of an error. Use the level-of-control >shown to the left of the SPSS Statistics commands to determine the range of >LOOPs and DO IFs. >Execution of this command stops. >Error # 4045. Command name: end loop >The END LOOP command does not follow an unclosed LOOP command. Maybe the LOOP >command was not recognized because of an error. Use the level-of-control >shown to the left of the SPSS Statistics commands to determine the range of >LOOPs and DO IFs. >Execution of this command stops. >Error # 4030 in column 9. Text: results >The operand appearing on the left side of the assignment operator (equals >sign) is not a known vector name or function name. >Execution of this command stops. >Error # 4285 in column 8. Text: title >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4285 in column 8. Text: title >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4285 in column 8. Text: title >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4285 in column 8. Text: title >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4285 in column 8. Text: title >Incorrect variable name: either the name is more than 64 characters, or it is >not defined by a previous command. >Execution of this command stops. >Error # 4007 in column 19. Text: { >The expression is incomplete. Check for missing operands, invalid operators, >unmatched parentheses or excessive string length. >Execution of this command stops. >Error # 4700 in column 7. Text: specifs >An output command contains an unrecognized keyword. The recognized keywords >are OUTFILE, RECORDS, TABLE, NOTABLE ENCODING and BOM. >Execution of this command stops. >Error # 4700 in column 7. Text: results >An output command contains an unrecognized keyword. The recognized keywords >are OUTFILE, RECORDS, TABLE, NOTABLE ENCODING and BOM. >Execution of this command stops. >Error # 4023 in column 21. Text: results >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4023 in column 19. Text: results >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 4023 in column 20. Text: results >An expression contains a string of characters followed by a left parenthesis, >indicating that the string of characters is a function or vector name, but the >characters do not match any existing function or vector. Check the spelling. >Execution of this command stops. >Error # 5312 in column 6. Text: results >A subcommand keyword is expected on the SAVE, XSAVE, OR SAVE CODEPAGE command. >The only recognized subcommands are: OUTFILE, KEEP, DROP, RENAME, MAP, >COMPRESSED, UNCOMPRESSED UNSELECTED, and ENCODING. >Execution of this command stops. >Error # 5312 in column 42. Text: var >A subcommand keyword is expected on the SAVE, XSAVE, OR SAVE CODEPAGE command. >The only recognized subcommands are: OUTFILE, KEEP, DROP, RENAME, MAP, >COMPRESSED, UNCOMPRESSED UNSELECTED, and ENCODING. >Error # 1. Command name: end >The first word in the line is not recognized as an SPSS Statistics command. >Execution of this command stops. >Error # 63 in column 11. Text: screedata.sav >The file does not exist. >Execution of this command stops. *** It seems like SPSS doesn't like the *raw* command... Anyone any idea what to do? Thanks a lot!!! |
Administrator
|
The following does NOT belong in the MATRIX block!
"GET FILE = '/Users/etb/Desktop/NEO150.sav'. DATASET NAME raw. DATASET ACTIVATE raw. "
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?" |
Administrator
|
Presumably that code is an incorrectly modified version of this:
https://people.ok.ubc.ca/brioconn/nfactors/rawpar.sps Go back to the source and pay attention! --
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?" |
Administrator
|
In reply to this post by etb
I don't have time to delve into this right now. But in case others do, it appears that the OP is using file rawpar.sps from this page:
https://people.ok.ubc.ca/brioconn/nfactors/nfactors.html HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Yes, exactly, and I tried to modify the GET FILE command so that the code will possibly run, but it doesn't and I have no idea why.
|
Administrator
|
Well you modified the code without paying attention to what is happening.
Try one of the following: matrix. GET raw /FILE = '/Users/etb/Desktop/NEO150.sav'. blah blah blah Alternatively: GET FILE = '/Users/etb/Desktop/NEO150.sav'. MATRIX. GET raw /FILE * . blah blah blah. If you are unfamiliar with the MATRIX command you might want to read a bit?
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?" |
Free forum by Nabble | Edit this page |