Login  Register

Re: No chi-square value in McNemar test output?

Posted by PRogman on Jun 08, 2016; 11:00pm
URL: http://spssx-discussion.165.s1.nabble.com/No-chi-square-value-in-McNemar-test-output-tp1080750p5732355.html

The MATRIX command seems to use the SPSS installation folder, which is protected from Windows Vista and onward (I think). If a DATASET DECLARE command is used it probably tries to write a temporary file to that folder and crashes, unless you have administrator status.
So, before a MATRIX command is run you need to change the current working directory (folder, in modern terms) with the CD command to a folder with read/write permissions. %temp% is shorthand in the Windows environment for the temporary folder, but you can choose another if you want. I don't know what the corresponding Mac folder path would be, if you are in that environment.
PRESERVE and RESTORE just saves and restores whatever settings you have, including current working folder. They are not necessary, it is just a good habit restore things to original state when finished.
As the code already uses a PRESERVE an easy modification would be to place the CD command inside the macro, but then it makes the code windows-specific:
...
PRESERVE.
SET ERRORS=NONE RESULTS=NONE.
CD "%temp%"   /*Windows temp folder*/.
MATRIX.
...

HTH
Mieke wrote
Hi All!

Thanks a lot for your reply! Unfortunately, mine is still not working, giving error (even as administrator of with simplified matrix..) Progman, where do I use your PRESERVE -RESTORE? Do I use it in Syntax before putting the matrix in? or together? (I'm sorry I'm really not experienced with SPSS)


Mieke